From cf8d1ceffcfbbb64734e6180a2c0cebd033f5b2e Mon Sep 17 00:00:00 2001 From: ArielG-NV <159081215+ArielG-NV@users.noreply.github.com> Date: Mon, 24 Jun 2024 09:16:28 -0400 Subject: Implementing `tbuffer` layout(s) (#4436) * Implementing `tbuffer` layouts. 1. Add to layout options 'TextureBuffer' layouts. 2. Add on to existing logic a way to allocate appropriate registers for TextureBufferType (this was made to work with parameter block logic). 3. Added asserts so objects missing a layout will gracefully crash This means `tbuffer` now works for hlsl,glsl,metal targets, spirv has yet to implement logic for `TextureBufferType`. * disable metal tests and fix emitting code a bit fixing the emitting code means metal compilation emits a useful error (help point users/developers to #4435) * fix warning --- source/slang/slang-type-layout.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source/slang/slang-type-layout.h') diff --git a/source/slang/slang-type-layout.h b/source/slang/slang-type-layout.h index 6ca756e8c..f29a38435 100644 --- a/source/slang/slang-type-layout.h +++ b/source/slang/slang-type-layout.h @@ -1043,16 +1043,19 @@ struct LayoutRulesImpl UniformLayoutInfo BeginStructLayout() { + SLANG_ASSERT(simpleRules); return simpleRules->BeginStructLayout(); } LayoutSize AddStructField(UniformLayoutInfo* ioStructInfo, UniformLayoutInfo fieldInfo) { + SLANG_ASSERT(simpleRules); return simpleRules->AddStructField(ioStructInfo, fieldInfo); } void EndStructLayout(UniformLayoutInfo* ioStructInfo) { + SLANG_ASSERT(simpleRules); return simpleRules->EndStructLayout(ioStructInfo); } @@ -1080,7 +1083,7 @@ struct LayoutRulesFamilyImpl virtual LayoutRulesImpl* getAnyValueRules() = 0; virtual LayoutRulesImpl* getConstantBufferRules(CompilerOptionSet& compilerOptions) = 0; virtual LayoutRulesImpl* getPushConstantBufferRules() = 0; - virtual LayoutRulesImpl* getTextureBufferRules() = 0; + virtual LayoutRulesImpl* getTextureBufferRules(CompilerOptionSet& compilerOptions) = 0; virtual LayoutRulesImpl* getVaryingInputRules() = 0; virtual LayoutRulesImpl* getVaryingOutputRules() = 0; virtual LayoutRulesImpl* getSpecializationConstantRules()= 0; -- cgit v1.2.3