From 91625924938c0caeeef348ea1b5b0bb22a18d4d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Wed, 30 Sep 2026 13:22:05 -0600 Subject: [PATCH] SoftGPU: Add the secondary color on the portable triangle path Without SSE or NEON, triangle pixels got the secondary color in place of the primary one plus it, so lit triangles came out black. It showed as the "unexplained" known failures on riscv64 and loongarch64, and broke the new gpu/lighting/shademap there. Reproduced on arm64 by building without NEON. Co-Authored-By: Claude Opus 5.5 (1M context) --- GPU/Software/Rasterizer.cpp | 2 +- test.py | 8 -------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/GPU/Software/Rasterizer.cpp b/GPU/Software/Rasterizer.cpp index b760364994..56abea7897 100644 --- a/GPU/Software/Rasterizer.cpp +++ b/GPU/Software/Rasterizer.cpp @@ -1159,7 +1159,7 @@ void DrawTriangleSlice( int32x4_t sec = vsetq_lane_s32(0, sec_color[i].ivec, 3); prim_color[i].ivec = vaddq_s32(prim_color[i].ivec, sec); #else - prim_color[i] = Vec4(sec_color[i], 0); + prim_color[i] += Vec4(sec_color[i], 0); #endif } } diff --git a/test.py b/test.py index c455d97224..ef639a0ebd 100755 --- a/test.py +++ b/test.py @@ -512,17 +512,9 @@ known_failures = { # The ISA returns the canonical NaN (0x7fc00000) from every operation, never the operand's # NaN, so a negative or signaling NaN input loses its sign and payload. Everything else passes. "cpu/fpu/roundmode", - # The software renderer's output differs from the reference by the same amount on both of - # these architectures, despite them using completely different SIMD paths. Unexplained. - "gpu/clipping/homogeneous", - "gpu/commands/cull", - "gpu/primitives/triangles", ], "loongarch64": [ "cpu/fpu/fpu", - "gpu/clipping/homogeneous", - "gpu/commands/cull", - "gpu/primitives/triangles", ], }