D3D11Device: Fix redundant SRV set on RT change

This commit is contained in:
Stenzek 2024-06-01 17:33:01 +10:00
parent 05395c8c1a
commit 0675716162
No known key found for this signature in database
1 changed files with 2 additions and 2 deletions

View File

@ -977,7 +977,7 @@ void D3D11Device::SetRenderTargets(GPUTexture* const* rts, u32 num_rts, GPUTextu
const ID3D11ShaderResourceView* srv = static_cast<D3D11Texture*>(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]);