Merge pull request #26936 from akien-mga/gles2-revert-texture2DLodEXT

GLES2: Revert wrong extension checks from #26928 and #26932
This commit is contained in:
Rémi Verschelde 2019-03-11 23:35:47 +01:00 committed by GitHub
commit 7452f5c619
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 27 additions and 39 deletions

View file

@ -1,23 +1,6 @@
/* clang-format off */ /* clang-format off */
[vertex] [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 #ifdef USE_GLES_OVER_GL
#define lowp #define lowp
#define mediump #define mediump
@ -237,6 +220,25 @@ VERTEX_SHADER_CODE
/* clang-format off */ /* clang-format off */
[fragment] [fragment]
// texture2DLodEXT and textureCubeLodEXT are fragment shader specific.
// Do not copy these defines in the [vertex] section.
#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 #ifdef USE_GLES_OVER_GL
#define lowp #define lowp
#define mediump #define mediump

View file

@ -25,6 +25,8 @@ void main() {
/* clang-format off */ /* clang-format off */
[fragment] [fragment]
// texture2DLodEXT and textureCubeLodEXT are fragment shader specific.
// Do not copy these defines in the [vertex] section.
#ifndef USE_GLES_OVER_GL #ifndef USE_GLES_OVER_GL
#ifdef GL_EXT_shader_texture_lod #ifdef GL_EXT_shader_texture_lod
#extension GL_EXT_shader_texture_lod : enable #extension GL_EXT_shader_texture_lod : enable
@ -54,7 +56,8 @@ precision highp int;
precision mediump float; precision mediump float;
precision mediump int; precision mediump int;
#endif #endif
#endif // USE_GLES_OVER_GL
#endif
#ifdef USE_SOURCE_PANORAMA #ifdef USE_SOURCE_PANORAMA
uniform sampler2D source_panorama; //texunit:0 uniform sampler2D source_panorama; //texunit:0

View file

@ -1,23 +1,6 @@
/* clang-format off */ /* clang-format off */
[vertex] [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 #ifdef USE_GLES_OVER_GL
#define lowp #define lowp
#define mediump #define mediump
@ -33,6 +16,7 @@ precision highp int;
#define M_PI 3.14159265359 #define M_PI 3.14159265359
// //
// attributes // attributes
// //
@ -691,6 +675,8 @@ VERTEX_SHADER_CODE
/* clang-format off */ /* clang-format off */
[fragment] [fragment]
// texture2DLodEXT and textureCubeLodEXT are fragment shader specific.
// Do not copy these defines in the [vertex] section.
#ifndef USE_GLES_OVER_GL #ifndef USE_GLES_OVER_GL
#ifdef GL_EXT_shader_texture_lod #ifdef GL_EXT_shader_texture_lod
#extension GL_EXT_shader_texture_lod : enable #extension GL_EXT_shader_texture_lod : enable
@ -720,7 +706,7 @@ precision highp int;
precision mediump float; precision mediump float;
precision mediump int; precision mediump int;
#endif #endif
#endif // USE_GLES_OVER_GL #endif
#include "stdlib.glsl" #include "stdlib.glsl"

View file

@ -1,6 +1,3 @@
// 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 select2(vec2 a, vec2 b, bvec2 c) {
vec2 ret; vec2 ret;