Open chaoticbob opened 4 days ago
The shader below is hitting an assert in slang-emit-spirv::emitGlobalInst() at due to ConstantBuffer<Foo> myCB2[2][2]:
slang-emit-spirv::emitGlobalInst()
ConstantBuffer<Foo> myCB2[2][2]
case kIROp_ConstantBufferType: SLANG_UNEXPECTED("Constant buffer type remaining in spirv emit");
Multidimensional Texture2D and SamplerState work fine.
Texture2D
SamplerState
CMD
slangc.exe -target spirv -lang slang -D__spirv__ -emit-spirv-directly -profile ps_6_0 -entry main shader.hlsl
Shader
struct Foo { float4 a; int2 b; }; ConstantBuffer<Foo> myCB2[2][2] : register(b0, space1); Texture2D myTex[2][3] : register(t1, space1); SamplerState mySampler[3][2] : register(s2, space1); struct VSOutput { float2 TexCoord : TEXCOORD; }; float4 main(VSOutput input) : SV_TARGET { float4 color = (float4)0; color = myTex[1][2].Sample(mySampler[1][0], input.TexCoord); return float4(1.0, 1.0, 1.0, 1.0) * myCB2[1][0].a + color; }
The shader below is hitting an assert in
slang-emit-spirv::emitGlobalInst()
at due toConstantBuffer<Foo> myCB2[2][2]
:Multidimensional
Texture2D
andSamplerState
work fine.CMD
Shader