From 68df52d04d4192d6f04ef11de74a47264e58a555 Mon Sep 17 00:00:00 2001 From: CloudP4bbs Date: Thu, 5 Nov 2026 00:08:26 -0400 Subject: [PATCH] shader: lower Ampere UIMAD (0x4a4) through the uniform register path 0x4a4 is uniform arithmetic and was the only opcode missing from the list that already rewrites 0x2a4, 0x8a4, 0x890, 0x290, 0x291, 0x292, 0x896 and 0x8a5 onto the Maxwell uniform forms. Add it and map it to 0x424, the same way 0x2a4 maps to 0x224. Zelda Ocarina of Time hits four of these at boot and each one rejects the whole compute program. --- src/shader_recompiler/frontend/ampere/lower_to_maxwell.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/shader_recompiler/frontend/ampere/lower_to_maxwell.h b/src/shader_recompiler/frontend/ampere/lower_to_maxwell.h index 66748f2bcd..539e7b711b 100644 --- a/src/shader_recompiler/frontend/ampere/lower_to_maxwell.h +++ b/src/shader_recompiler/frontend/ampere/lower_to_maxwell.h @@ -277,7 +277,7 @@ inline LoweredProgram LowerToMaxwellWith(std::span code, u32 bool rewritten_uniform = false; bool uniform_guard = false; u32 uniform_output = 7; // ULOP3's UPn output: computed in P(6-n), then merged into R239 - if (opcode == 0x2a4 || opcode == 0x8a4 || opcode == 0x891 || opcode == 0x890 || opcode == 0x290 || + if (opcode == 0x2a4 || opcode == 0x4a4 || opcode == 0x8a4 || opcode == 0x891 || opcode == 0x890 || opcode == 0x290 || opcode == 0x292 || opcode == 0x892 || opcode == 0x291 || opcode == 0x896 || opcode == 0x8a5) { // A guarded ULEA without .HI or a carry out lowers to one guarded ISCADD, which // leaves R253 to hold the guest predicate (Pokemon Pokopia's fullscreen passes). @@ -313,7 +313,7 @@ inline LoweredProgram LowerToMaxwellWith(std::span code, u32 uniform_output = insn.Bits(81, 3); insn.words[2] = (insn.words[2] & ~(7U << 17)) | ((6 - uniform_output) << 17); } - opcode = opcode == 0x2a4 ? 0x224 : opcode == 0x8a4 ? 0x824 : opcode == 0x891 ? 0x811 : opcode == 0x890 ? 0x810 + opcode = opcode == 0x2a4 ? 0x224 : opcode == 0x4a4 ? 0x424 : opcode == 0x8a4 ? 0x824 : opcode == 0x891 ? 0x811 : opcode == 0x890 ? 0x810 : opcode == 0x292 ? 0x212 : opcode == 0x892 ? 0x812 : opcode == 0x291 ? 0x211 : opcode == 0x896 ? 0x816 : opcode == 0x8a5 ? 0x825 : 0x210; }