Skip to content

Commit

Permalink
Merge pull request #26932 from akien-mga/gles2-fix-extensions-check
Browse files Browse the repository at this point in the history
GLES2: Fix regression on texture2DLod extension checks
  • Loading branch information
akien-mga authored Mar 11, 2019
2 parents bc3c633 + 8c2d381 commit 546cab6
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 16 deletions.
17 changes: 17 additions & 0 deletions drivers/gles2/shaders/canvas.glsl
Original file line number Diff line number Diff line change
@@ -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
Expand Down
17 changes: 17 additions & 0 deletions drivers/gles2/shaders/scene.glsl
Original file line number Diff line number Diff line change
@@ -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
Expand Down
19 changes: 3 additions & 16 deletions drivers/gles2/shaders/stdlib.glsl
Original file line number Diff line number Diff line change
@@ -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;
Expand Down

0 comments on commit 546cab6

Please sign in to comment.