From 39b8dcda6efbff74dcfe7951d98e283c1b75b258 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Sun, 27 Aug 2023 16:19:49 +1000 Subject: [PATCH] GPU/HW: Fix wrapped image writes --- src/core/gpu_hw.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/core/gpu_hw.cpp b/src/core/gpu_hw.cpp index ec479c217..4c79841a8 100644 --- a/src/core/gpu_hw.cpp +++ b/src/core/gpu_hw.cpp @@ -2081,9 +2081,8 @@ void GPU_HW::UpdateVRAM(u32 x, u32 y, u32 width, u32 height, const void* data, b } const Common::Rectangle bounds = GetVRAMTransferBounds(x, y, width, height); - - DebugAssert((x + width) <= VRAM_WIDTH && (y + height) <= VRAM_HEIGHT); - IncludeVRAMDirtyRectangle(Common::Rectangle::FromExtents(x, y, width, height)); + DebugAssert(bounds.right <= VRAM_WIDTH && bounds.bottom <= VRAM_HEIGHT); + IncludeVRAMDirtyRectangle(bounds); if (check_mask) {