GPU/HW: Clear dirty rectangle when updating shadow texture

Fixes high GPU usage in Robbit mon Dieu in D3D11, should improve overall
performance slightly when VRAM copies are heavily used.
This commit is contained in:
Connor McLaughlin 2020-06-02 21:45:36 +10:00
parent 9ea163e666
commit c8e1881ea9
4 changed files with 11 additions and 3 deletions

View File

@ -99,6 +99,12 @@ void GPU_HW::PrintSettingsToLog()
Log_InfoPrintf("Dual-source blending: %s", m_supports_dual_source_blend ? "Supported" : "Not supported");
}
void GPU_HW::UpdateVRAMReadTexture()
{
m_renderer_stats.num_vram_read_texture_updates++;
ClearVRAMDirtyRectangle();
}
void GPU_HW::HandleFlippedQuadTextureCoordinates(BatchVertex* vertices)
{
// Taken from beetle-psx gpu_polygon.cpp
@ -661,8 +667,6 @@ void GPU_HW::DispatchRenderCommand()
FlushRender();
UpdateVRAMReadTexture();
m_renderer_stats.num_vram_read_texture_updates++;
ClearVRAMDirtyRectangle();
}
}

View File

@ -157,7 +157,7 @@ protected:
static_cast<float>(rgba >> 24) * (1.0f / 255.0f));
}
virtual void UpdateVRAMReadTexture() = 0;
virtual void UpdateVRAMReadTexture();
virtual void UpdateDepthBufferFromMaskBit() = 0;
virtual void SetScissorFromDrawingArea() = 0;
virtual void MapBatchVertexPointer(u32 required_vertices) = 0;

View File

@ -805,6 +805,8 @@ void GPU_HW_D3D11::UpdateVRAMReadTexture()
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,
&src_box);
GPU_HW::UpdateVRAMReadTexture();
}
void GPU_HW_D3D11::UpdateDepthBufferFromMaskBit()

View File

@ -945,6 +945,8 @@ void GPU_HW_OpenGL::UpdateVRAMReadTexture()
glEnable(GL_SCISSOR_TEST);
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, m_vram_fbo_id);
}
GPU_HW::UpdateVRAMReadTexture();
}
void GPU_HW_OpenGL::UpdateDepthBufferFromMaskBit()