From c4ca8f4bf891d18d8e180488feb6d012b24ccf2a Mon Sep 17 00:00:00 2001 From: Stefanos Costa Date: Tue, 18 Aug 2026 15:41:48 +0300 Subject: [PATCH] shader: fix the Linux and macOS build (#285) * fixed linux build - added correct uint long translation - replaced throw with non-constexpr function so that it fails in case of malformed table * shader: remove redundant opcode table comment * shader: use EXIT for invalid opcode tables --------- Co-authored-by: nmzik --- src/graphics/shader/recompiler/frontend/decode/OpcodeTable.h | 3 ++- .../shader/recompiler/frontend/translate/Translate.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/graphics/shader/recompiler/frontend/decode/OpcodeTable.h b/src/graphics/shader/recompiler/frontend/decode/OpcodeTable.h index 371fc86..b1c9bdb 100644 --- a/src/graphics/shader/recompiler/frontend/decode/OpcodeTable.h +++ b/src/graphics/shader/recompiler/frontend/decode/OpcodeTable.h @@ -1,6 +1,7 @@ #ifndef EMULATOR_INCLUDE_EMULATOR_GRAPHICS_SHADER_RECOMPILER_DECOMPILER_OPCODETABLE_H_ #define EMULATOR_INCLUDE_EMULATOR_GRAPHICS_SHADER_RECOMPILER_DECOMPILER_OPCODETABLE_H_ +#include "common/assert.h" #include "graphics/shader/recompiler/frontend/decode/ShaderDecoder.h" #include @@ -27,7 +28,7 @@ consteval auto MakeOpcodeTable(const Entry (&entries)[EntryCount]) { for (size_t i = 0; i < EntryCount; i++) { const auto encoding = entries[i].encoding; if (encoding >= EncodingCount || table.indices[encoding] != 0) { - throw "invalid opcode table"; + EXIT("invalid opcode table\n"); } table.entries[i] = entries[i]; table.indices[encoding] = static_cast(i + 1); diff --git a/src/graphics/shader/recompiler/frontend/translate/Translate.cpp b/src/graphics/shader/recompiler/frontend/translate/Translate.cpp index 635c1d8..cb17d54 100644 --- a/src/graphics/shader/recompiler/frontend/translate/Translate.cpp +++ b/src/graphics/shader/recompiler/frontend/translate/Translate.cpp @@ -321,7 +321,7 @@ IR::U64 Translator::ExpandWholeQuadMask(IR::U64 value) { const auto merged2 = ir.Emit(IR::ValueOpcode::BitwiseOr64, {merged1, shifted2}); const auto merged3 = ir.Emit(IR::ValueOpcode::BitwiseOr64, {merged2, shifted3}); const auto low_bits = - ir.Emit(IR::ValueOpcode::BitwiseAnd64, {merged3, IR::Value(0x1111111111111111ull)}); + ir.Emit(IR::ValueOpcode::BitwiseAnd64, {merged3, IR::Value(uint64_t {0x1111111111111111})}); return IR::U64(ir.Emit(IR::ValueOpcode::IMul64, {low_bits, IR::Value(uint64_t {0xfull})})); }