GPU/HW: Eliminate CPU round trip on oversized VRAM writes

This commit is contained in:
Connor McLaughlin
2020-07-11 20:18:07 +10:00
parent e144392187
commit d1a2ebd8f3
6 changed files with 67 additions and 113 deletions

View File

@ -529,6 +529,20 @@ bool GPU_HW::UseVRAMCopyShader(u32 src_x, u32 src_y, u32 dst_x, u32 dst_y, u32 w
.Intersects(Common::Rectangle<u32>::FromExtents(dst_x, dst_y, width, height)));
}
GPU_HW::VRAMWriteUBOData GPU_HW::GetVRAMWriteUBOData(u32 x, u32 y, u32 width, u32 height, u32 buffer_offset) const
{
const VRAMWriteUBOData uniforms = {x,
y,
((x + width) % VRAM_WIDTH),
((y + height) % VRAM_HEIGHT),
width,
height,
buffer_offset,
m_GPUSTAT.set_mask_while_drawing ? 0x8000u : 0x00,
GetCurrentNormalizedVertexDepth()};
return uniforms;
}
GPU_HW::VRAMFillUBOData GPU_HW::GetVRAMFillUBOData(u32 x, u32 y, u32 width, u32 height, u32 color) const
{
// drop precision unless true colour is enabled