summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrdb <rdb@users.noreply.github.com>2023-01-16 20:02:13 +0100
committerGitHub <noreply@github.com>2023-01-16 20:02:13 +0100
commit09dd11be964d44235b1190bf36be6655eb59b902 (patch)
treee6d1b42163078bebf9a5563edda7b8bc2ef807a5
parent6bba45d2a30aeb97f76603ea22dc008411b17cfb (diff)
downloadSPIRV-Cross-09dd11be964d44235b1190bf36be6655eb59b902.tar.gz
SPIRV-Cross-09dd11be964d44235b1190bf36be6655eb59b902.tar.bz2
SPIRV-Cross-09dd11be964d44235b1190bf36be6655eb59b902.zip
GLSL: Support GL_NV_shader_noperspective_interpolation in GLES
-rw-r--r--spirv_glsl.cpp8
1 files changed, 8 insertions, 0 deletions
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))