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 */
[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
@ -237,6 +220,25 @@ VERTEX_SHADER_CODE
/* clang-format off */
[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
#define lowp
#define mediump

View File

@ -25,6 +25,8 @@ void main() {
/* clang-format off */
[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
@ -54,7 +56,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

View File

@ -1,23 +1,6 @@
/* 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
@ -33,6 +16,7 @@ precision highp int;
#define M_PI 3.14159265359
//
// attributes
//
@ -691,6 +675,8 @@ VERTEX_SHADER_CODE
/* clang-format off */
[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
@ -720,7 +706,7 @@ precision highp int;
precision mediump float;
precision mediump int;
#endif
#endif // USE_GLES_OVER_GL
#endif
#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 ret;