mirror of https://github.com/PCSX2/pcsx2.git
GS/HW: Fix invalid self copy from move in DX renderers
This commit is contained in:
parent
fdb751ed1a
commit
95843dc84a
|
@ -3626,7 +3626,8 @@ bool GSTextureCache::Move(u32 SBP, u32 SBW, u32 SPSM, int sx, int sy, u32 DBP, u
|
||||||
// DX11/12 is a bit lame and can't partial copy depth targets. We could do this with a blit instead,
|
// DX11/12 is a bit lame and can't partial copy depth targets. We could do this with a blit instead,
|
||||||
// but so far haven't seen anything which needs it.
|
// but so far haven't seen anything which needs it.
|
||||||
const GSRendererType renderer = GSGetCurrentRenderer();
|
const GSRendererType renderer = GSGetCurrentRenderer();
|
||||||
if (renderer == GSRendererType::DX11 || renderer == GSRendererType::DX12)
|
const bool renderer_is_directx = (renderer == GSRendererType::DX11 || renderer == GSRendererType::DX12);
|
||||||
|
if (renderer_is_directx)
|
||||||
{
|
{
|
||||||
if (spsm_s.depth || dpsm_s.depth)
|
if (spsm_s.depth || dpsm_s.depth)
|
||||||
return false;
|
return false;
|
||||||
|
@ -3744,7 +3745,8 @@ bool GSTextureCache::Move(u32 SBP, u32 SBW, u32 SPSM, int sx, int sy, u32 DBP, u
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the copies overlap, this is a validation error, so we need to copy to a temporary texture first.
|
// If the copies overlap, this is a validation error, so we need to copy to a temporary texture first.
|
||||||
if ((SBP == DBP) && !(GSVector4i(sx, sy, sx + w, sy + h).rintersect(GSVector4i(dx, dy, dx + w, dy + h))).rempty())
|
// DirectX also can't copy to the same texture it's reading from (except potentially with enhanced barriers).
|
||||||
|
if (SBP == DBP && (!(GSVector4i(sx, sy, sx + w, sy + h).rintersect(GSVector4i(dx, dy, dx + w, dy + h))).rempty() || renderer_is_directx))
|
||||||
{
|
{
|
||||||
GSTexture* tmp_texture = src->m_texture->IsDepthStencil() ?
|
GSTexture* tmp_texture = src->m_texture->IsDepthStencil() ?
|
||||||
g_gs_device->CreateDepthStencil(src->m_texture->GetWidth(), src->m_texture->GetHeight(), src->m_texture->GetFormat(), false) :
|
g_gs_device->CreateDepthStencil(src->m_texture->GetWidth(), src->m_texture->GetHeight(), src->m_texture->GetFormat(), false) :
|
||||||
|
|
Loading…
Reference in New Issue