From ddb528cc8eda52c9b779d85d855ee5a5564a2896 Mon Sep 17 00:00:00 2001 From: Robin Kertels Date: Sun, 7 Aug 2022 01:09:38 +0200 Subject: [PATCH] [d3d9] Change texture before updating fetch4 --- src/d3d9/d3d9_device.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/d3d9/d3d9_device.cpp b/src/d3d9/d3d9_device.cpp index 2572e342..92d77561 100644 --- a/src/d3d9/d3d9_device.cpp +++ b/src/d3d9/d3d9_device.cpp @@ -3760,6 +3760,10 @@ namespace dxvk { DWORD oldUsage = oldTexture != nullptr ? oldTexture->Desc()->Usage : 0; DWORD newUsage = newTexture != nullptr ? newTexture->Desc()->Usage : 0; + DWORD combinedUsage = oldUsage | newUsage; + TextureChangePrivate(m_state.textures[StateSampler], pTexture); + m_dirtyTextures |= 1u << StateSampler; + UpdateActiveTextures(StateSampler, combinedUsage); if (newTexture != nullptr) { const bool oldDepth = m_depthTextures & (1u << StateSampler); @@ -3780,14 +3784,6 @@ namespace dxvk { UpdateActiveFetch4(StateSampler); } - DWORD combinedUsage = oldUsage | newUsage; - - TextureChangePrivate(m_state.textures[StateSampler], pTexture); - - m_dirtyTextures |= 1u << StateSampler; - - UpdateActiveTextures(StateSampler, combinedUsage); - return D3D_OK; }