OpCapability in GLSL

Hello,

I’m writing my shaders with GLSL and translate them to SPIR-V using glslangValidator. Now I’m trying to write a fragment shader that needs gl_PrimitiveID and to use it I need to either set the Tessellation or Geometry OpCapability in the shader, which glslangValidator doesn’t do automatically. Is there a way to enable this somehow in GLSL/glslangValidator or do I have to translate to human readable SPIR-V, add the OpCapability and then compile to binary SPIR-V?

Thanks for any help! Cheers

Finally, I found a solution: I was using a very outdated version of glslang and the issue has already been solved actually: SPV: PrimitiveId in frag shader will emit OpCapability by yavn · Pull Request #521 · KhronosGroup/glslang · GitHub

Sorry for the noise.