GLSL: Drop invariant keyword in GLSL 110

This commit is contained in:
rdb 2023-01-27 11:10:47 +01:00 committed by GitHub
parent ff7a11dbcb
commit f8cc03fd1e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1275,7 +1275,7 @@ string CompilerGLSL::to_interpolation_qualifiers(const Bitset &flags)
} }
res += "sample "; res += "sample ";
} }
if (flags.get(DecorationInvariant)) if (flags.get(DecorationInvariant) && (options.es || options.version >= 120))
res += "invariant "; res += "invariant ";
if (flags.get(DecorationPerPrimitiveEXT)) if (flags.get(DecorationPerPrimitiveEXT))
res += "perprimitiveEXT "; res += "perprimitiveEXT ";
@ -3526,7 +3526,7 @@ void CompilerGLSL::emit_resources()
statement(""); statement("");
} }
if (position_invariant) if (position_invariant && (options.es || options.version >= 120))
{ {
statement("invariant gl_Position;"); statement("invariant gl_Position;");
statement(""); statement("");