GPU: Flush render before changing drawing area/offset

Fixes "random" broken polygons in hardware backends.
This commit is contained in:
Connor McLaughlin 2019-11-09 22:56:49 +10:00
parent dbc22fe841
commit c0208b6e78

View file

@ -110,6 +110,8 @@ bool GPU::HandleSetDrawingAreaTopLeftCommand(const u32*& command_ptr, u32 comman
Log_DebugPrintf("Set drawing area top-left: (%u, %u)", left, top); Log_DebugPrintf("Set drawing area top-left: (%u, %u)", left, top);
if (m_drawing_area.left != left || m_drawing_area.top != top) if (m_drawing_area.left != left || m_drawing_area.top != top)
{ {
FlushRender();
m_drawing_area.left = left; m_drawing_area.left = left;
m_drawing_area.top = top; m_drawing_area.top = top;
m_drawing_area_changed = true; m_drawing_area_changed = true;
@ -127,6 +129,8 @@ bool GPU::HandleSetDrawingAreaBottomRightCommand(const u32*& command_ptr, u32 co
Log_DebugPrintf("Set drawing area bottom-right: (%u, %u)", m_drawing_area.right, m_drawing_area.bottom); Log_DebugPrintf("Set drawing area bottom-right: (%u, %u)", m_drawing_area.right, m_drawing_area.bottom);
if (m_drawing_area.right != right || m_drawing_area.bottom != bottom) if (m_drawing_area.right != right || m_drawing_area.bottom != bottom)
{ {
FlushRender();
m_drawing_area.right = right; m_drawing_area.right = right;
m_drawing_area.bottom = bottom; m_drawing_area.bottom = bottom;
m_drawing_area_changed = true; m_drawing_area_changed = true;
@ -143,6 +147,8 @@ bool GPU::HandleSetDrawingOffsetCommand(const u32*& command_ptr, u32 command_siz
Log_DebugPrintf("Set drawing offset (%d, %d)", m_drawing_offset.x, m_drawing_offset.y); Log_DebugPrintf("Set drawing offset (%d, %d)", m_drawing_offset.x, m_drawing_offset.y);
if (m_drawing_offset.x != x || m_drawing_offset.y != y) if (m_drawing_offset.x != x || m_drawing_offset.y != y)
{ {
FlushRender();
m_drawing_offset.x = x; m_drawing_offset.x = x;
m_drawing_offset.y = y; m_drawing_offset.y = y;
m_drawing_offset_changed = true; m_drawing_offset_changed = true;