summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2019-03-11 23:12:49 +0100
committerRémi Verschelde <rverschelde@gmail.com>2019-03-11 23:12:49 +0100
commit764671d2d089b27dfe03d26919dbc4b41e3b28ba (patch)
treec305b1f4109c252f0bbb1dd4a82670c4705f9497
parent4cdb2d05023252829300f098d0bc144ad588a00b (diff)
Revert "GLES2: Ensure extension checks for texture2DLod"
This reverts commit f5f565e3e49eecde9ed3b05913747a50d54b7357.
-rw-r--r--drivers/gles2/shaders/canvas.glsl23
-rw-r--r--drivers/gles2/shaders/cubemap_filter.glsl9
-rw-r--r--drivers/gles2/shaders/scene.glsl10
-rw-r--r--drivers/gles2/shaders/stdlib.glsl16
4 files changed, 38 insertions, 20 deletions
diff --git a/drivers/gles2/shaders/canvas.glsl b/drivers/gles2/shaders/canvas.glsl
index 2d9761bf49..f72a0d288b 100644
--- a/drivers/gles2/shaders/canvas.glsl
+++ b/drivers/gles2/shaders/canvas.glsl
@@ -220,6 +220,29 @@ VERTEX_SHADER_CODE
/* clang-format off */
[fragment]
+#ifndef USE_GLES_OVER_GL
+
+#ifdef GL_EXT_shader_texture_lod
+#extension GL_EXT_shader_texture_lod : enable
+#define texture2DLod(img, coord, lod) texture2DLodEXT(img, coord, lod)
+#define textureCubeLod(img, coord, lod) textureCubeLodEXT(img, coord, lod)
+#endif
+
+#endif
+
+#ifdef GL_ARB_shader_texture_lod
+#extension GL_ARB_shader_texture_lod : enable
+#endif
+
+
+#if !defined(GL_EXT_shader_texture_lod) && !defined(GL_ARB_shader_texture_lod)
+#define texture2DLod(img, coord, lod) texture2D(img, coord, lod)
+#define textureCubeLod(img, coord, lod) textureCube(img, coord, lod)
+#endif
+
+
+
+
#ifdef USE_GLES_OVER_GL
#define lowp
#define mediump
diff --git a/drivers/gles2/shaders/cubemap_filter.glsl b/drivers/gles2/shaders/cubemap_filter.glsl
index 128da15b39..a6902836ed 100644
--- a/drivers/gles2/shaders/cubemap_filter.glsl
+++ b/drivers/gles2/shaders/cubemap_filter.glsl
@@ -26,12 +26,14 @@ void main() {
[fragment]
#ifndef USE_GLES_OVER_GL
+
#ifdef GL_EXT_shader_texture_lod
#extension GL_EXT_shader_texture_lod : enable
#define texture2DLod(img, coord, lod) texture2DLodEXT(img, coord, lod)
#define textureCubeLod(img, coord, lod) textureCubeLodEXT(img, coord, lod)
#endif
-#endif // !USE_GLES_OVER_GL
+
+#endif
#ifdef GL_ARB_shader_texture_lod
#extension GL_ARB_shader_texture_lod : enable
@@ -42,6 +44,8 @@ void main() {
#define textureCubeLod(img, coord, lod) textureCube(img, coord, lod)
#endif
+
+
#ifdef USE_GLES_OVER_GL
#define lowp
#define mediump
@@ -54,7 +58,8 @@ precision highp int;
precision mediump float;
precision mediump int;
#endif
-#endif // USE_GLES_OVER_GL
+
+#endif
#ifdef USE_SOURCE_PANORAMA
uniform sampler2D source_panorama; //texunit:0
diff --git a/drivers/gles2/shaders/scene.glsl b/drivers/gles2/shaders/scene.glsl
index 9c235854a3..3b0bca982d 100644
--- a/drivers/gles2/shaders/scene.glsl
+++ b/drivers/gles2/shaders/scene.glsl
@@ -16,6 +16,7 @@ precision highp int;
#define M_PI 3.14159265359
+
//
// attributes
//
@@ -675,12 +676,14 @@ VERTEX_SHADER_CODE
[fragment]
#ifndef USE_GLES_OVER_GL
+
#ifdef GL_EXT_shader_texture_lod
#extension GL_EXT_shader_texture_lod : enable
#define texture2DLod(img, coord, lod) texture2DLodEXT(img, coord, lod)
#define textureCubeLod(img, coord, lod) textureCubeLodEXT(img, coord, lod)
#endif
-#endif // !USE_GLES_OVER_GL
+
+#endif
#ifdef GL_ARB_shader_texture_lod
#extension GL_ARB_shader_texture_lod : enable
@@ -691,6 +694,9 @@ VERTEX_SHADER_CODE
#define textureCubeLod(img, coord, lod) textureCube(img, coord, lod)
#endif
+
+
+
#ifdef USE_GLES_OVER_GL
#define lowp
#define mediump
@@ -703,7 +709,7 @@ precision highp int;
precision mediump float;
precision mediump int;
#endif
-#endif // USE_GLES_OVER_GL
+#endif
#include "stdlib.glsl"
diff --git a/drivers/gles2/shaders/stdlib.glsl b/drivers/gles2/shaders/stdlib.glsl
index 3cc65bc509..3674d70c9f 100644
--- a/drivers/gles2/shaders/stdlib.glsl
+++ b/drivers/gles2/shaders/stdlib.glsl
@@ -1,19 +1,3 @@
-#ifndef USE_GLES_OVER_GL
-#ifdef GL_EXT_shader_texture_lod
-#extension GL_EXT_shader_texture_lod : enable
-#define texture2DLod(img, coord, lod) texture2DLodEXT(img, coord, lod)
-#define textureCubeLod(img, coord, lod) textureCubeLodEXT(img, coord, lod)
-#endif
-#endif // !USE_GLES_OVER_GL
-
-#ifdef GL_ARB_shader_texture_lod
-#extension GL_ARB_shader_texture_lod : enable
-#endif
-
-#if !defined(GL_EXT_shader_texture_lod) && !defined(GL_ARB_shader_texture_lod)
-#define texture2DLod(img, coord, lod) texture2D(img, coord, lod)
-#define textureCubeLod(img, coord, lod) textureCube(img, coord, lod)
-#endif
vec2 select2(vec2 a, vec2 b, bvec2 c) {
vec2 ret;