GLSL: Require mesh shader when using perprimitiveEXT in frag shader.

This commit is contained in:
Hans-Kristian Arntzen 2023-08-17 12:07:11 +02:00
parent 637c211c6f
commit 5ffc813dc4
3 changed files with 25 additions and 1 deletions

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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))
{