Merge pull request #2087 from rdb/patch-1

GLSL: Support GL_NV_shader_noperspective_interpolation in GLES
This commit is contained in:
Hans-Kristian Arntzen 2023-01-17 12:02:22 +01:00 committed by GitHub
commit 4212eef67e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1249,7 +1249,15 @@ string CompilerGLSL::to_interpolation_qualifiers(const Bitset &flags)
if (flags.get(DecorationFlat)) if (flags.get(DecorationFlat))
res += "flat "; res += "flat ";
if (flags.get(DecorationNoPerspective)) if (flags.get(DecorationNoPerspective))
{
if (options.es)
{
if (options.version < 300)
SPIRV_CROSS_THROW("noperspective requires ESSL 300.");
require_extension_internal("GL_NV_shader_noperspective_interpolation");
}
res += "noperspective "; res += "noperspective ";
}
if (flags.get(DecorationCentroid)) if (flags.get(DecorationCentroid))
res += "centroid "; res += "centroid ";
if (flags.get(DecorationPatch)) if (flags.get(DecorationPatch))