From 9367ce82ac3f0e08c55b086459c831f2ce53b740 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 8 May 2022 14:24:21 -0700 Subject: [PATCH 1/2] softgpu: Fix viewport flag clean/dirty. Fixes Split/Second effects, see #15501. --- GPU/Software/SoftGpu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GPU/Software/SoftGpu.h b/GPU/Software/SoftGpu.h index e4617cd3e6..b45e6f95fa 100644 --- a/GPU/Software/SoftGpu.h +++ b/GPU/Software/SoftGpu.h @@ -86,7 +86,7 @@ enum class SoftDirty : uint64_t { TRANSFORM_BASIC = 1ULL << 18, TRANSFORM_MATRIX = 1ULL << 19, - TRANSFORM_VIEWPORT = 1ULL << 10, + TRANSFORM_VIEWPORT = 1ULL << 20, TRANSFORM_FOG = 1ULL << 21, TRANSFORM_ALL = 31ULL << 18, From b60b1e84b2b79f136ddd3971afe2ce9bb29e692e Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 8 May 2022 14:26:25 -0700 Subject: [PATCH 2/2] softgpu: Correct stencil debugging. Fixes crashes in GE debugger when viewing stencil. --- GPU/Software/SoftGpu.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GPU/Software/SoftGpu.cpp b/GPU/Software/SoftGpu.cpp index 4ddb947c04..16ebc29940 100644 --- a/GPU/Software/SoftGpu.cpp +++ b/GPU/Software/SoftGpu.cpp @@ -1256,8 +1256,8 @@ bool SoftGPU::GetCurrentStencilbuffer(GPUDebugBuffer &buffer) { buffer.Allocate(size.x, size.y, GPU_DBG_FORMAT_8BIT); u8 *row = buffer.GetData(); - for (int16_t y = 0; y < size.x; ++y) { - for (int16_t x = 0; x < size.y; ++x) { + for (int16_t y = 0; y < size.y; ++y) { + for (int16_t x = 0; x < size.x; ++x) { row[x] = GetPixelStencil(gstate.FrameBufFormat(), gstate.FrameBufStride(), x, y); } row += size.x;