when using buffer reference types that contain structs, while also using the same structs directly, spirv-cross seems to get confused and emits multiple conflicting type declarations. As a result, glslang fails to compile the returned code with error messages like:
ERROR: a.mesh:295: '' : syntax error, unexpected LEFT_BRACE, expecting COMMA or SEMICOLON
ERROR: 1 compilation errors. No code generated.
As an example, one of my GLSL shaders contains the following declaration:
Hello,
when using buffer reference types that contain structs, while also using the same structs directly, spirv-cross seems to get confused and emits multiple conflicting type declarations. As a result, glslang fails to compile the returned code with error messages like:
As an example, one of my GLSL shaders contains the following declaration:
From the compiled SPIR-V binary (attached below), spirv-cross turns that into this:
Note that
InstanceNodeBufferIn
is supposed to contain an array of plain structs, rather than an array of buffer references.Here's a mesh shader that reproduces the issue (zipped, because github restricts file extensions): ms_material.zip