diff --git a/src/dxvk/rtx_render/rtx_asset_data.h b/src/dxvk/rtx_render/rtx_asset_data.h index 89ae188d2..1b8664a22 100644 --- a/src/dxvk/rtx_render/rtx_asset_data.h +++ b/src/dxvk/rtx_render/rtx_asset_data.h @@ -53,6 +53,18 @@ namespace dxvk { uint32_t numLayers = 0; const char* filename = nullptr; + + bool matches(const AssetInfo& other) const { + return other.type == type && + other.compression == compression && + other.format == format && + other.extent.width == extent.width && + other.extent.height == extent.height && + other.extent.depth == extent.depth && + other.mipLevels == mipLevels && + other.looseLevels == looseLevels && + other.numLayers == numLayers; + } }; class AssetData : public RcObject { diff --git a/src/dxvk/rtx_render/rtx_texture_manager.cpp b/src/dxvk/rtx_render/rtx_texture_manager.cpp index 06c1f3380..f7c530503 100644 --- a/src/dxvk/rtx_render/rtx_texture_manager.cpp +++ b/src/dxvk/rtx_render/rtx_texture_manager.cpp @@ -365,7 +365,13 @@ namespace dxvk { auto it = m_assetHashToTextures.find(hash); if (it != m_assetHashToTextures.end()) { - return it->second; + // Is this truly the same asset? + if (it->second->assetData->info().matches(assetData->info())) { + return it->second; + } + + // Else, clear out the old + m_assetHashToTextures.erase(it); } {