Closed EllarBooher closed 5 months ago
Thanks for raising this, can confirm this is just an issue of not checking for the struct index and relying the offset were in the same order
The simple example you gave shows this error
OpMemberDecorate %struct 0 Offset 4
OpMemberDecorate %struct 1 Offset 0
about to try and get a fix now
Hello, thanks a lot for this tool, it's helping me a lot with learning SPIR-V and Vulkan. With this GLSL:
Compiled and reflected:
I get the following output from
spirv-reflect
:I expect both to produce the same result- padded sizes of
4
fora
and12
forb
since that is how the structure will be laid out in memory. I have tracked the issue to the following lines, which processes the offsets with no consideration for if the members are out of order. https://github.com/KhronosGroup/SPIRV-Reflect/blob/b50ffbda954270ddf29a355cb727f958825bcf98/spirv_reflect.c#L2714-L2725