diff --git a/reference/shaders-no-opt/frag/mesh-shader-perprimitive.spv14.nocompat.vk.frag.vk b/reference/shaders-no-opt/frag/mesh-shader-perprimitive.spv14.nocompat.vk.frag.vk new file mode 100644 index 000000000..7ab0e9506 --- /dev/null +++ b/reference/shaders-no-opt/frag/mesh-shader-perprimitive.spv14.nocompat.vk.frag.vk @@ -0,0 +1,11 @@ +#version 450 +#extension GL_EXT_mesh_shader : require + +layout(location = 0) out vec4 FragColor; +layout(location = 0) flat perprimitiveEXT in uvec4 v; + +void main() +{ + FragColor = vec4(v); +} + diff --git a/shaders-no-opt/frag/mesh-shader-perprimitive.spv14.nocompat.vk.frag b/shaders-no-opt/frag/mesh-shader-perprimitive.spv14.nocompat.vk.frag new file mode 100644 index 000000000..8dffccc28 --- /dev/null +++ b/shaders-no-opt/frag/mesh-shader-perprimitive.spv14.nocompat.vk.frag @@ -0,0 +1,10 @@ +#version 450 +#extension GL_EXT_mesh_shader : require + +layout(location = 0) perprimitiveEXT flat in uvec4 v; +layout(location = 0) out vec4 FragColor; + +void main() +{ + FragColor = vec4(v); +} diff --git a/spirv_glsl.cpp b/spirv_glsl.cpp index 690bc9d35..09d019bd9 100644 --- a/spirv_glsl.cpp +++ b/spirv_glsl.cpp @@ -1295,7 +1295,10 @@ string CompilerGLSL::to_interpolation_qualifiers(const Bitset &flags) if (flags.get(DecorationInvariant) && (options.es || options.version >= 120)) res += "invariant "; if (flags.get(DecorationPerPrimitiveEXT)) - res += "perprimitiveEXT "; + { + res += "perprimitiveEXT "; + require_extension_internal("GL_EXT_mesh_shader"); + } if (flags.get(DecorationExplicitInterpAMD)) {