From f4de432ac4b2ee3b3f5b56224907f1f9c6bc9db0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 18 Sep 2013 22:59:14 +0200 Subject: [PATCH] Shaders: `const` for readonly vars is in ARB_shading_language_420pack. In the end it wasn't my NVidia shader compiler being too forgiving. --- src/Shaders/compatibility.glsl | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/Shaders/compatibility.glsl b/src/Shaders/compatibility.glsl index 50e527d10..2d907ee33 100644 --- a/src/Shaders/compatibility.glsl +++ b/src/Shaders/compatibility.glsl @@ -37,6 +37,7 @@ #if defined(GL_ARB_shading_language_420pack) #extension GL_ARB_shading_language_420pack: enable #define EXPLICIT_TEXTURE_LAYER + #define RUNTIME_CONST #endif #ifdef GL_ARB_explicit_uniform_location #extension GL_ARB_explicit_uniform_location: enable @@ -47,7 +48,8 @@ #if defined(GL_ES) && __VERSION__ >= 300 #define EXPLICIT_ATTRIB_LOCATION -/* EXPLICIT_TEXTURE_LAYER & EXPLICIT_UNIFORM_LOCATION is not available in OpenGL ES */ +/* EXPLICIT_TEXTURE_LAYER, EXPLICIT_UNIFORM_LOCATION and RUNTIME_CONST is not + available in OpenGL ES */ #endif /* Precision qualifiers are not supported in GLSL 1.20 */ @@ -56,9 +58,3 @@ #define mediump #define lowp #endif - -/* const qualifier can be used for readonly variables since GLSL 4.20, however - it's not supported even in ES 3.0 */ -#if !defined(GL_ES) && __VERSION__ >= 420 -#define RUNTIME_CONST -#endif