diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2019-03-11 21:59:20 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2019-03-11 21:59:20 +0100 |
commit | 8c2d38152fbf41ca9c8a8f9b381b8d271f7f54d3 (patch) | |
tree | d0518357c261741ccfbbd04708db11db1415c97c /drivers/gles2/shaders | |
parent | bc3c6338cfdb3e67dd4a97006e4e06d4ba6e02dd (diff) |
GLES2: Fix regression on texture2DLod extension checks
These can't be done after any non-preprocessor token.
Diffstat (limited to 'drivers/gles2/shaders')
-rw-r--r-- | drivers/gles2/shaders/canvas.glsl | 17 | ||||
-rw-r--r-- | drivers/gles2/shaders/scene.glsl | 17 | ||||
-rw-r--r-- | drivers/gles2/shaders/stdlib.glsl | 19 |
3 files changed, 37 insertions, 16 deletions
diff --git a/drivers/gles2/shaders/canvas.glsl b/drivers/gles2/shaders/canvas.glsl index 2d9761bf49..e5a78bb90f 100644 --- a/drivers/gles2/shaders/canvas.glsl +++ b/drivers/gles2/shaders/canvas.glsl @@ -1,6 +1,23 @@ /* clang-format off */ [vertex] +#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 + #ifdef USE_GLES_OVER_GL #define lowp #define mediump diff --git a/drivers/gles2/shaders/scene.glsl b/drivers/gles2/shaders/scene.glsl index 9c235854a3..95856f9c22 100644 --- a/drivers/gles2/shaders/scene.glsl +++ b/drivers/gles2/shaders/scene.glsl @@ -1,6 +1,23 @@ /* clang-format off */ [vertex] +#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 + #ifdef USE_GLES_OVER_GL #define lowp #define mediump diff --git a/drivers/gles2/shaders/stdlib.glsl b/drivers/gles2/shaders/stdlib.glsl index 3cc65bc509..d853907ff9 100644 --- a/drivers/gles2/shaders/stdlib.glsl +++ b/drivers/gles2/shaders/stdlib.glsl @@ -1,19 +1,6 @@ -#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 +// Our GLSL "stdlib" +// texture2DLod defines *must* be done before including this, +// but before any non-preprocessor statement. vec2 select2(vec2 a, vec2 b, bvec2 c) { vec2 ret; |