Compare commits

...

1 Commits

Author SHA1 Message Date
lightningterror
ed09dca17e GS/DX11: Also check DrawMultiStretchRects copy for srv conflicts with rtv.
Also adjust the naming.
2025-06-23 15:09:03 +02:00
2 changed files with 5 additions and 4 deletions

View File

@@ -1281,7 +1281,7 @@ void GSDevice11::StretchRect(GSTexture* sTex, const GSVector4& sRect, GSTexture*
if (dTex)
{
ds = dTex->GetSize();
PSUnbindConflictingSRVs(dTex, nullptr);
PSUnbindConflictingSRVs(dTex);
if (draw_in_depth)
OMSetRenderTargets(nullptr, dTex);
else
@@ -1457,6 +1457,7 @@ void GSDevice11::DrawMultiStretchRects(const MultiStretchRect* rects, u32 num_re
PSSetShader(m_convert.ps[static_cast<int>(shader)].get(), nullptr);
OMSetDepthStencilState(dTex->IsRenderTarget() ? m_convert.dss.get() : m_convert.dss_write.get(), 0);
PSUnbindConflictingSRVs(dTex);
OMSetRenderTargets(dTex->IsRenderTarget() ? dTex : nullptr, dTex->IsDepthStencil() ? dTex : nullptr);
const GSVector2 ds(static_cast<float>(dTex->GetWidth()), static_cast<float>(dTex->GetHeight()));
@@ -2365,13 +2366,13 @@ void GSDevice11::PSUpdateShaderState()
m_ctx->PSSetSamplers(0, m_state.ps_ss.size(), m_state.ps_ss.data());
}
void GSDevice11::PSUnbindConflictingSRVs(GSTexture* rt, GSTexture* ds)
void GSDevice11::PSUnbindConflictingSRVs(GSTexture* tex1, GSTexture* tex2)
{
// Make sure no SRVs are bound using the same texture before binding it to a RTV.
bool changed = false;
for (size_t i = 0; i < m_state.ps_sr_views.size(); i++)
{
if ((rt && m_state.ps_sr_views[i] == *(GSTexture11*)rt) || (ds && m_state.ps_sr_views[i] == *(GSTexture11*)ds))
if ((tex1 && m_state.ps_sr_views[i] == *(GSTexture11*)tex1) || (tex2 && m_state.ps_sr_views[i] == *(GSTexture11*)tex2))
{
m_state.ps_sr_views[i] = nullptr;
changed = true;

View File

@@ -325,7 +325,7 @@ public:
void PSSetShaderResource(int i, GSTexture* sr);
void PSSetShader(ID3D11PixelShader* ps, ID3D11Buffer* ps_cb);
void PSUpdateShaderState();
void PSUnbindConflictingSRVs(GSTexture* rt, GSTexture* ds);
void PSUnbindConflictingSRVs(GSTexture* tex1 = nullptr, GSTexture* tex2 = nullptr);
void PSSetSamplerState(ID3D11SamplerState* ss0);
void OMSetDepthStencilState(ID3D11DepthStencilState* dss, u8 sref);