KhronosGroup/SPIRV-Tools

Invalid decoration operand for the PassthroughNV decoration when using the GL_NV_geometry_shader_passthrough extension

neXyon opened this issue · 5 comments

Original/related bug report for reference: KhronosGroup/Vulkan-LoaderAndValidationLayers#2661

I get the error

Invalid decoration operand: 5250

in a geometry shader with

#extension GL_NV_geometry_shader_passthrough : enable

using the extension VK_NV_geometry_shader_passthrough. The compiled shader contains the PassthroughNV (5250) decoration in accordance with https://www.khronos.org/registry/spir-v/specs/1.0/SPIRV.pdf which is seen as invalid.

The validation layers use the spvValidate function that produces the error message.

Is it possible for you to provide the SPIR-V or a reduced case that exposes this issue?

I think the reason is missing extensions field for PassthroughNV in the grammar file:

https://github.com/KhronosGroup/SPIRV-Headers/blob/8ae030235edffd199094fcbfb6d9eb02179685f7/include/spirv/unified1/spirv.core.grammar.json#L5555-L5560

SPIRV-Tools needs a proper version or extensions field to consider the symbol as visible in the current target environment.

I've created KhronosGroup/SPIRV-Headers#73 for addressing this issue.

Hey @neXyon, KhronosGroup/SPIRV-Headers#73 is merged now. The work on SPIRV-Tools side is done. I'll close this. Feel free to reopen if it turns out not solving the problem.

Thanks, that was fast!