mirror of
https://github.com/PCSX2/pcsx2.git
synced 2025-12-16 04:08:48 +00:00
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
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:
parent
3f437e7496
commit
b7e17646a3
@ -1409,9 +1409,18 @@ void GSDevice12::CopyRect(GSTexture* sTex, GSTexture* dTex, const GSVector4i& r,
|
|||||||
dstloc.Type = D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX;
|
dstloc.Type = D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX;
|
||||||
dstloc.SubresourceIndex = 0;
|
dstloc.SubresourceIndex = 0;
|
||||||
|
|
||||||
const D3D12_BOX srcbox{static_cast<UINT>(r.left), static_cast<UINT>(r.top), 0u, static_cast<UINT>(r.right),
|
const GSVector4i src_rect(0, 0, sTex->GetWidth(), sTex->GetHeight());
|
||||||
static_cast<UINT>(r.bottom), 1u};
|
const bool full_rt_copy = destX == 0 && destY == 0 && r.eq(src_rect) && src_rect.eq(dst_rect);
|
||||||
GetCommandList()->CopyTextureRegion(&dstloc, destX, destY, 0, &srcloc, &srcbox);
|
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);
|
dTex12->SetState(GSTexture::State::Dirty);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1802,7 +1802,7 @@ void GSRendererHW::HandleManualDeswizzle()
|
|||||||
// we're gonna have to get creative and swap around the quandrants, but that's a TODO.
|
// we're gonna have to get creative and swap around the quandrants, but that's a TODO.
|
||||||
GSVertex* v = &m_vertex.buff[0];
|
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;
|
const GSVector2i page_quadrant = GSLocalMemory::m_psm[m_cached_ctx.FRAME.PSM].pgs / 2;
|
||||||
|
|
||||||
if (PRIM->FST)
|
if (PRIM->FST)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user