Open SuikaSibyl opened 7 months ago
Resources types in a shader target (hlsl/glsl) has a lot of restrictions in that they are not true data types and cannot used without restrictions when placed in arrays or structs. If the compiler can't legalize them out of existence from those array/struct types, it can't generate valid hlsl/glsl code.
A way around this is to define a global array of buffers and store indices in the user defined struct/array types.
However if the compiler crashes without diagnostics, it is something we should fix.
Thanks for the bug report! Putting some labels on this so we can figure out when to get to it :)
When compiling a Slang shader with an array of the structure (e.g. TensorView below), where the structure contains a buffer resource type (e.g. RWByteAddressBuffer), into the GLSL target, the compiler will crash without any diagnosis information.
A simpler one might be successfully compiled, as everything is somehow inlined.
An example minimum code snippet: (Target: GLSL, slang version: newest Release now)