GS/DX12: Backport dx11 full rt copy optimizations.
Some checks are pending
🐧 Linux Builds / AppImage (push) Waiting to run
🐧 Linux Builds / Flatpak (push) Waiting to run
🍎 MacOS Builds / Defaults (push) Waiting to run
🖥️ Windows Builds / Lint VS Project Files (push) Waiting to run
🖥️ Windows Builds / SSE4 (push) Blocked by required conditions
🖥️ Windows Builds / AVX2 (push) Blocked by required conditions
🖥️ Windows Builds / CMake (push) Waiting to run

We are copying the whole RT so just call CopyResource instead of CopyTextureRegion which will be faster.
This commit is contained in:
lightningterror 2025-10-07 17:25:18 +02:00
parent 3f437e7496
commit b7e17646a3
2 changed files with 13 additions and 4 deletions

View File

@ -1409,9 +1409,18 @@ void GSDevice12::CopyRect(GSTexture* sTex, GSTexture* dTex, const GSVector4i& r,
dstloc.Type = D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX;
dstloc.SubresourceIndex = 0;
const D3D12_BOX srcbox{static_cast<UINT>(r.left), static_cast<UINT>(r.top), 0u, static_cast<UINT>(r.right),
static_cast<UINT>(r.bottom), 1u};
GetCommandList()->CopyTextureRegion(&dstloc, destX, destY, 0, &srcloc, &srcbox);
const GSVector4i src_rect(0, 0, sTex->GetWidth(), sTex->GetHeight());
const bool full_rt_copy = destX == 0 && destY == 0 && r.eq(src_rect) && src_rect.eq(dst_rect);
if (full_rt_copy)
{
GetCommandList()->CopyResource(dTex12->GetResource(), sTex12->GetResource());
}
else
{
const D3D12_BOX srcbox{static_cast<UINT>(r.left), static_cast<UINT>(r.top), 0u, static_cast<UINT>(r.right),
static_cast<UINT>(r.bottom), 1u};
GetCommandList()->CopyTextureRegion(&dstloc, destX, destY, 0, &srcloc, &srcbox);
}
dTex12->SetState(GSTexture::State::Dirty);
}

View File

@ -1802,7 +1802,7 @@ void GSRendererHW::HandleManualDeswizzle()
// we're gonna have to get creative and swap around the quandrants, but that's a TODO.
GSVertex* v = &m_vertex.buff[0];
// Check for page quadrant and compare it to the quadrant from the verts, if it doesn't match then we need to do correction.
// Check for page quadrant and compare it to the quadrant from the verts, if it does match then we need to do correction.
const GSVector2i page_quadrant = GSLocalMemory::m_psm[m_cached_ctx.FRAME.PSM].pgs / 2;
if (PRIM->FST)