From 09dd11be964d44235b1190bf36be6655eb59b902 Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 16 Jan 2023 20:02:13 +0100 Subject: [PATCH] GLSL: Support GL_NV_shader_noperspective_interpolation in GLES --- spirv_glsl.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/spirv_glsl.cpp b/spirv_glsl.cpp index 4b22d47e..de6cc0a0 100644 --- a/spirv_glsl.cpp +++ b/spirv_glsl.cpp @@ -1249,7 +1249,15 @@ string CompilerGLSL::to_interpolation_qualifiers(const Bitset &flags) if (flags.get(DecorationFlat)) res += "flat "; 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 "; + } if (flags.get(DecorationCentroid)) res += "centroid "; if (flags.get(DecorationPatch))