GPU/HW: Prefer shader over image copy if not dirty
This commit is contained in:
parent
2c57817803
commit
99e65282f6
|
@ -3468,12 +3468,15 @@ void GPU_HW::CopyVRAM(u32 src_x, u32 src_y, u32 dst_x, u32 dst_y, u32 width, u32
|
||||||
GL_SCOPE_FMT("CopyVRAM({}x{} @ {},{} => {},{}", width, height, src_x, src_y, dst_x, dst_y);
|
GL_SCOPE_FMT("CopyVRAM({}x{} @ {},{} => {},{}", width, height, src_x, src_y, dst_x, dst_y);
|
||||||
|
|
||||||
// masking enabled, oversized, or overlapping
|
// masking enabled, oversized, or overlapping
|
||||||
|
const GSVector4i src_bounds = GetVRAMTransferBounds(src_x, src_y, width, height);
|
||||||
|
const GSVector4i dst_bounds = GetVRAMTransferBounds(dst_x, dst_y, width, height);
|
||||||
|
const bool intersect_with_draw = m_vram_dirty_draw_rect.rintersects(src_bounds);
|
||||||
|
const bool intersect_with_write = m_vram_dirty_write_rect.rintersects(src_bounds);
|
||||||
const bool use_shader =
|
const bool use_shader =
|
||||||
(m_GPUSTAT.IsMaskingEnabled() || ((src_x % VRAM_WIDTH) + width) > VRAM_WIDTH ||
|
(m_GPUSTAT.IsMaskingEnabled() || ((src_x % VRAM_WIDTH) + width) > VRAM_WIDTH ||
|
||||||
((src_y % VRAM_HEIGHT) + height) > VRAM_HEIGHT || ((dst_x % VRAM_WIDTH) + width) > VRAM_WIDTH ||
|
((src_y % VRAM_HEIGHT) + height) > VRAM_HEIGHT || ((dst_x % VRAM_WIDTH) + width) > VRAM_WIDTH ||
|
||||||
((dst_y % VRAM_HEIGHT) + height) > VRAM_HEIGHT);
|
((dst_y % VRAM_HEIGHT) + height) > VRAM_HEIGHT) ||
|
||||||
const GSVector4i src_bounds = GetVRAMTransferBounds(src_x, src_y, width, height);
|
(!intersect_with_draw && !intersect_with_write);
|
||||||
const GSVector4i dst_bounds = GetVRAMTransferBounds(dst_x, dst_y, width, height);
|
|
||||||
|
|
||||||
// If we're copying a region that hasn't been drawn to, and we're using the TC, we can do it in local memory.
|
// If we're copying a region that hasn't been drawn to, and we're using the TC, we can do it in local memory.
|
||||||
if (m_use_texture_cache && !GPUTextureCache::IsRectDrawn(src_bounds))
|
if (m_use_texture_cache && !GPUTextureCache::IsRectDrawn(src_bounds))
|
||||||
|
@ -3499,8 +3502,6 @@ void GPU_HW::CopyVRAM(u32 src_x, u32 src_y, u32 dst_x, u32 dst_y, u32 width, u32
|
||||||
m_sw_renderer->PushCommand(cmd);
|
m_sw_renderer->PushCommand(cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
const bool intersect_with_draw = m_vram_dirty_draw_rect.rintersects(src_bounds);
|
|
||||||
const bool intersect_with_write = m_vram_dirty_write_rect.rintersects(src_bounds);
|
|
||||||
if (use_shader || IsUsingMultisampling())
|
if (use_shader || IsUsingMultisampling())
|
||||||
{
|
{
|
||||||
if (intersect_with_draw || intersect_with_write)
|
if (intersect_with_draw || intersect_with_write)
|
||||||
|
|
Loading…
Reference in New Issue