fix(shader): declare the word-size constraint before the overloads that use it

This commit is contained in:
Slick Daddy
2026-10-04 15:58:23 +03:00
parent 4dd9d45be8
commit 753e1b9347
@@ -27,6 +27,15 @@ struct SpirvDeferredPhi {
};
class SpirvModule {
private:
template<typename TOperand>
static constexpr bool wordSized = (std::is_integral_v<TOperand> || std::is_enum_v<TOperand>) && sizeof(TOperand) <= sizeof(std::uint32_t);
template<typename TOperand>
static std::uint32_t narrowWord(TOperand operand) {
return static_cast<std::uint32_t>(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<typename TOperand>
static constexpr bool wordSized = (std::is_integral_v<TOperand> || std::is_enum_v<TOperand>) && sizeof(TOperand) <= sizeof(std::uint32_t);
template<typename TOperand>
static std::uint32_t narrowWord(TOperand operand) {
return static_cast<std::uint32_t>(operand);
}
struct DeclarationSlot {
std::array<std::uint32_t, MaxCachedDeclarationWords> words = {};
std::uint32_t length = 0;