[d3d9] Change texture before updating fetch4

This commit is contained in:
Robin Kertels 2022-08-07 01:09:38 +02:00 committed by Joshie
parent 7b28bbae11
commit ddb528cc8e
1 changed files with 4 additions and 8 deletions

View File

@ -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;
}