summaryrefslogtreecommitdiffstats
path: root/Graphics/GLSLTools
diff options
context:
space:
mode:
Diffstat (limited to 'Graphics/GLSLTools')
-rw-r--r--Graphics/GLSLTools/include/SPIRVShaderResources.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/Graphics/GLSLTools/include/SPIRVShaderResources.h b/Graphics/GLSLTools/include/SPIRVShaderResources.h
index 58e003e2..d87f1f39 100644
--- a/Graphics/GLSLTools/include/SPIRVShaderResources.h
+++ b/Graphics/GLSLTools/include/SPIRVShaderResources.h
@@ -86,10 +86,15 @@ struct SPIRVShaderResourceAttribs
NumResourceTypes
};
+ static constexpr const Uint32 ResourceTypeBits = 4;
+ static constexpr const Uint32 VarTypeBits = 4;
+ static_assert(SHADER_VARIABLE_TYPE_NUM_TYPES < (1 << VarTypeBits), "Not enough bits to represent SHADER_VARIABLE_TYPE");
+ static_assert(NumResourceTypes < (1 << ResourceTypeBits), "Not enough bits to represent ResourceType");
+
const char *Name;
const Uint16 ArraySize;
- const ResourceType Type : 4;
- const SHADER_VARIABLE_TYPE VarType : 4;
+ const ResourceType Type : ResourceTypeBits;
+ const SHADER_VARIABLE_TYPE VarType : VarTypeBits;
const Int8 StaticSamplerInd;
// Offset in SPIRV words (uint32_t) of binding & descriptor set decorations in SPIRV binary