From 753e1b934723ad11028a328eed903595bf6d1968 Mon Sep 17 00:00:00 2001 From: Slick Daddy <129640104+slick-daddy@users.noreply.github.com> Date: Sun, 4 Oct 2026 15:58:23 +0300 Subject: [PATCH] fix(shader): declare the word-size constraint before the overloads that use it --- .../include/SpirvBackend/SpirvModule.hpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/core/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvModule.hpp b/core/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvModule.hpp index 6dd990266..430a6bd93 100644 --- a/core/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvModule.hpp +++ b/core/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvModule.hpp @@ -27,6 +27,15 @@ struct SpirvDeferredPhi { }; class SpirvModule { +private: + template + static constexpr bool wordSized = (std::is_integral_v || std::is_enum_v) && sizeof(TOperand) <= sizeof(std::uint32_t); + + template + static std::uint32_t narrowWord(TOperand operand) { + return static_cast(operand); + } + public: explicit SpirvModule(std::uint32_t version = 0x00010300u); [[nodiscard]] std::uint32_t AllocateId(); @@ -130,14 +139,6 @@ private: static constexpr std::size_t DeclarationCacheSize = 512; static constexpr std::size_t MaxCachedDeclarationWords = 4; - template - static constexpr bool wordSized = (std::is_integral_v || std::is_enum_v) && sizeof(TOperand) <= sizeof(std::uint32_t); - - template - static std::uint32_t narrowWord(TOperand operand) { - return static_cast(operand); - } - struct DeclarationSlot { std::array words = {}; std::uint32_t length = 0;