From dcee40388ddbb7ad0bcea4dafb5948f4f98ac093 Mon Sep 17 00:00:00 2001 From: Phil Coulson Date: Mon, 11 May 2026 15:17:56 +0800 Subject: [PATCH] rsx: Fix swapped width/height in NV309E_SET_FORMAT decoder The bit field decoders for sw_width_log2 and sw_height_log2 were swapped. According to the NV04_SURFACE_SWZ_FORMAT specification (rnndb/Mesa): - BASE_SIZE_U (width) is at bits [23:16] (shift 16) - BASE_SIZE_V (height) is at bits [31:24] (shift 24) The existing code had these reversed. While these fields are currently unused in practice (the hardware appears to bypass them), this fix ensures the decode matches hardware documentation. Fixes #17510 --- rpcs3/Emu/RSX/rsx_decode.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rpcs3/Emu/RSX/rsx_decode.h b/rpcs3/Emu/RSX/rsx_decode.h index bdb99f199f..cbd36f73d3 100644 --- a/rpcs3/Emu/RSX/rsx_decode.h +++ b/rpcs3/Emu/RSX/rsx_decode.h @@ -3775,12 +3775,12 @@ struct registers_decoder u8 sw_height_log2() const { - return bf_decoder<16, 8>(value); + return bf_decoder<24, 8>(value); } u8 sw_width_log2() const { - return bf_decoder<24, 8>(value); + return bf_decoder<16, 8>(value); } };