GPU: Keep drawing area invalidated after invalidating shadow VRAM copy

Partially fixes the motion blur in Vagrant Story.
This commit is contained in:
Connor McLaughlin 2020-02-07 00:10:58 +09:00
parent d1c8775996
commit a36fe8bfe6
4 changed files with 10 additions and 11 deletions

View File

@ -257,7 +257,8 @@ GPU_HW::BatchPrimitive GPU_HW::GetPrimitiveForCommand(RenderCommand rc)
void GPU_HW::FillVRAM(u32 x, u32 y, u32 width, u32 height, u32 color) void GPU_HW::FillVRAM(u32 x, u32 y, u32 width, u32 height, u32 color)
{ {
m_vram_dirty_rect.Include(Common::Rectangle<u32>::FromExtents(x, y, width, height).Clamped(0, 0, VRAM_WIDTH, VRAM_HEIGHT)); m_vram_dirty_rect.Include(
Common::Rectangle<u32>::FromExtents(x, y, width, height).Clamped(0, 0, VRAM_WIDTH, VRAM_HEIGHT));
} }
void GPU_HW::UpdateVRAM(u32 x, u32 y, u32 width, u32 height, const void* data) void GPU_HW::UpdateVRAM(u32 x, u32 y, u32 width, u32 height, const void* data)
@ -268,7 +269,8 @@ void GPU_HW::UpdateVRAM(u32 x, u32 y, u32 width, u32 height, const void* data)
void GPU_HW::CopyVRAM(u32 src_x, u32 src_y, u32 dst_x, u32 dst_y, u32 width, u32 height) void GPU_HW::CopyVRAM(u32 src_x, u32 src_y, u32 dst_x, u32 dst_y, u32 width, u32 height)
{ {
m_vram_dirty_rect.Include(Common::Rectangle<u32>::FromExtents(dst_x, dst_y, width, height).Clamped(0, 0, VRAM_WIDTH, VRAM_HEIGHT)); m_vram_dirty_rect.Include(
Common::Rectangle<u32>::FromExtents(dst_x, dst_y, width, height).Clamped(0, 0, VRAM_WIDTH, VRAM_HEIGHT));
} }
void GPU_HW::DispatchRenderCommand(RenderCommand rc, u32 num_vertices, const u32* command_ptr) void GPU_HW::DispatchRenderCommand(RenderCommand rc, u32 num_vertices, const u32* command_ptr)
@ -288,6 +290,12 @@ void GPU_HW::DispatchRenderCommand(RenderCommand rc, u32 num_vertices, const u32
FlushRender(); FlushRender();
UpdateVRAMReadTexture(); UpdateVRAMReadTexture();
m_renderer_stats.num_vram_read_texture_updates++;
// At this point, we're still drawing to the same area. Without knowing the polygon bounds, potentially the
// whole area can be drawn over in this call. So we have to keep that range dirty. This is not ideal, since
// we're going to be doing a bunch of potentially redundant copies.
m_vram_dirty_rect = m_drawing_area;
} }
} }

View File

@ -713,9 +713,6 @@ void GPU_HW_D3D11::UpdateVRAMReadTexture()
const CD3D11_BOX src_box(scaled_rect.left, scaled_rect.top, 0, scaled_rect.right, scaled_rect.bottom, 1); const CD3D11_BOX src_box(scaled_rect.left, scaled_rect.top, 0, scaled_rect.right, scaled_rect.bottom, 1);
m_context->CopySubresourceRegion(m_vram_read_texture, 0, scaled_rect.left, scaled_rect.top, 0, m_vram_texture, 0, m_context->CopySubresourceRegion(m_vram_read_texture, 0, scaled_rect.left, scaled_rect.top, 0, m_vram_texture, 0,
&src_box); &src_box);
m_renderer_stats.num_vram_read_texture_updates++;
ClearVRAMDirtyRectangle();
} }
void GPU_HW_D3D11::FlushRender() void GPU_HW_D3D11::FlushRender()

View File

@ -812,9 +812,6 @@ void GPU_HW_OpenGL::UpdateVRAMReadTexture()
glEnable(GL_SCISSOR_TEST); glEnable(GL_SCISSOR_TEST);
m_vram_texture.BindFramebuffer(GL_FRAMEBUFFER); m_vram_texture.BindFramebuffer(GL_FRAMEBUFFER);
} }
m_renderer_stats.num_vram_read_texture_updates++;
ClearVRAMDirtyRectangle();
} }
void GPU_HW_OpenGL::FlushRender() void GPU_HW_OpenGL::FlushRender()

View File

@ -634,9 +634,6 @@ void GPU_HW_OpenGL_ES::UpdateVRAMReadTexture()
glEnable(GL_SCISSOR_TEST); glEnable(GL_SCISSOR_TEST);
m_vram_texture.BindFramebuffer(GL_FRAMEBUFFER); m_vram_texture.BindFramebuffer(GL_FRAMEBUFFER);
} }
m_renderer_stats.num_vram_read_texture_updates++;
ClearVRAMDirtyRectangle();
} }
void GPU_HW_OpenGL_ES::FlushRender() void GPU_HW_OpenGL_ES::FlushRender()