GLES2: Add comments around EXT_shader_texture_lod check
To avoid reintroducing bugs as I did in #26928 and #26932. texture2DLodEXT and textureCubeLodEXT are only for the fragment shader with https://www.khronos.org/registry/OpenGL/extensions/EXT/EXT_shader_texture_lod.txt In the vertex shader, texture2DLod and textureCubeLod are built-in.
This commit is contained in:
parent
764671d2d0
commit
74e224f2c7
3 changed files with 9 additions and 18 deletions
|
@ -220,29 +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
|
||||
#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
|
||||
|
|
|
@ -25,15 +25,15 @@ 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
|
||||
#define texture2DLod(img, coord, lod) texture2DLodEXT(img, coord, lod)
|
||||
#define textureCubeLod(img, coord, lod) textureCubeLodEXT(img, coord, lod)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif // !USE_GLES_OVER_GL
|
||||
|
||||
#ifdef GL_ARB_shader_texture_lod
|
||||
#extension GL_ARB_shader_texture_lod : enable
|
||||
|
@ -44,8 +44,6 @@ void main() {
|
|||
#define textureCubeLod(img, coord, lod) textureCube(img, coord, lod)
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#ifdef USE_GLES_OVER_GL
|
||||
#define lowp
|
||||
#define mediump
|
||||
|
|
|
@ -675,15 +675,15 @@ 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
|
||||
#endif // !USE_GLES_OVER_GL
|
||||
|
||||
#ifdef GL_ARB_shader_texture_lod
|
||||
#extension GL_ARB_shader_texture_lod : enable
|
||||
|
@ -694,9 +694,6 @@ VERTEX_SHADER_CODE
|
|||
#define textureCubeLod(img, coord, lod) textureCube(img, coord, lod)
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
#ifdef USE_GLES_OVER_GL
|
||||
#define lowp
|
||||
#define mediump
|
||||
|
|
Loading…
Reference in a new issue