From 0675716162013f10ea8f786d60cd40db46e48bfe Mon Sep 17 00:00:00 2001 From: Stenzek Date: Sat, 1 Jun 2024 17:33:01 +1000 Subject: [PATCH] D3D11Device: Fix redundant SRV set on RT change --- src/util/d3d11_device.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util/d3d11_device.cpp b/src/util/d3d11_device.cpp index 9d23a627d..4e056a667 100644 --- a/src/util/d3d11_device.cpp +++ b/src/util/d3d11_device.cpp @@ -977,7 +977,7 @@ void D3D11Device::SetRenderTargets(GPUTexture* const* rts, u32 num_rts, GPUTextu const ID3D11ShaderResourceView* srv = static_cast(ds)->GetD3DSRV(); for (u32 i = 0; i < MAX_TEXTURE_SAMPLERS; i++) { - if (m_current_textures[i] == srv) + if (m_current_textures[i] && m_current_textures[i] == srv) { m_current_textures[i] = nullptr; m_context->PSSetShaderResources(i, 1, &m_current_textures[i]); @@ -996,7 +996,7 @@ void D3D11Device::SetRenderTargets(GPUTexture* const* rts, u32 num_rts, GPUTextu const ID3D11ShaderResourceView* srv = dt->GetD3DSRV(); for (u32 j = 0; j < MAX_TEXTURE_SAMPLERS; j++) { - if (m_current_textures[j] == srv) + if (m_current_textures[j] && m_current_textures[j] == srv) { m_current_textures[j] = nullptr; m_context->PSSetShaderResources(j, 1, &m_current_textures[j]);