Closed farnoy closed 6 months ago
@farnoy can you attach a shader that I use to reproduce the bug?
@farnoy can you attach a shader that I use to reproduce the bug?
Gentle reminder. If I can't replicate the bug, I would be closing this. If you have a reference shader kindly share.
You need to use -emit-spirv-directly
for -g
to work properly.
Closing this issue since this is a GLSLang bug.
Sorry about the delay. Switching to direct SPIRV sounds like the way forward so I'll try that. IIRC, I was primarily blocked on the scalar block layout being unavailable with -emit-spirv-directly
, but it looks like it was fixed very recently:
StructuredBuffer<float3, ScalarDataLayout> scalarBuffer;
You are right. The recent fix allows you to control layout per buffer. There is also a global -force-glsl-scalar-layout that applies to all buffers.
When invoking
$ slangc -I src/shaders -g -entry main -target spirv -o shader.spv -- shader.slang
, the produced shader is invalid because of this:Dissassembling the segment reveals:
It seems that
OpExtInst
cannot go in the middle ofOpVariable
declarations at the start of each function. The workaround is to remove-g
.I'm trying to change my pipeline to compile directly from slang to spv in order to get slang source lines displayed in nsight, so the workaround is not satisfactory.