Skip to content

Commit

Permalink
Merge pull request #2185 from KhronosGroup/perprimitive-fix
Browse files Browse the repository at this point in the history
GLSL: Require mesh shader when using perprimitiveEXT in frag shader.
  • Loading branch information
HansKristian-Work authored Aug 17, 2023
2 parents 62664e4 + 5ffc813 commit e7e2e8c
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -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);
}

Original file line number Diff line number Diff line change
@@ -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);
}
5 changes: 4 additions & 1 deletion spirv_glsl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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))
{
Expand Down

0 comments on commit e7e2e8c

Please sign in to comment.