GLES2: Define 'lowp' for OpenGL 2.1

Precision qualifiers are only used on OpenGL ES 2.0 and 3.0,
and while OpenGL 3.3 defines them for compatibility (but without
practical effect), they're missing from OpenGL 2.1, so we define
them to prevent compilation errors.

Fixes #24521.
This commit is contained in:
Rémi Verschelde 2018-12-21 15:14:55 +01:00
parent 762b9b6bdb
commit 57416bfbce
7 changed files with 14 additions and 7 deletions

View file

@ -2,6 +2,7 @@
[vertex] [vertex]
#ifdef USE_GLES_OVER_GL #ifdef USE_GLES_OVER_GL
#define lowp
#define mediump #define mediump
#define highp #define highp
#else #else
@ -31,8 +32,6 @@ uniform vec4 src_rect;
uniform highp float time; uniform highp float time;
#ifdef USE_LIGHTING #ifdef USE_LIGHTING
// light matrices // light matrices
@ -62,7 +61,6 @@ const bool at_light_pass = true;
const bool at_light_pass = false; const bool at_light_pass = false;
#endif #endif
/* clang-format off */ /* clang-format off */
VERTEX_SHADER_GLOBALS VERTEX_SHADER_GLOBALS
@ -80,7 +78,6 @@ vec2 select(vec2 a, vec2 b, bvec2 c) {
void main() { void main() {
vec4 color = color_attrib; vec4 color = color_attrib;
#ifdef USE_INSTANCING #ifdef USE_INSTANCING
@ -159,13 +156,13 @@ VERTEX_SHADER_CODE
#endif #endif
#endif #endif
} }
/* clang-format off */ /* clang-format off */
[fragment] [fragment]
#ifdef USE_GLES_OVER_GL #ifdef USE_GLES_OVER_GL
#define lowp
#define mediump #define mediump
#define highp #define highp
#else #else
@ -231,7 +228,6 @@ const bool at_light_pass = false;
uniform bool use_default_normal; uniform bool use_default_normal;
/* clang-format off */ /* clang-format off */
FRAGMENT_SHADER_GLOBALS FRAGMENT_SHADER_GLOBALS

View file

@ -2,6 +2,7 @@
[vertex] [vertex]
#ifdef USE_GLES_OVER_GL #ifdef USE_GLES_OVER_GL
#define lowp
#define mediump #define mediump
#define highp #define highp
#else #else
@ -29,6 +30,7 @@ void main() {
[fragment] [fragment]
#ifdef USE_GLES_OVER_GL #ifdef USE_GLES_OVER_GL
#define lowp
#define mediump #define mediump
#define highp #define highp
#else #else
@ -39,7 +41,6 @@ precision mediump int;
varying highp vec4 position_interp; varying highp vec4 position_interp;
/* clang-format on */ /* clang-format on */
void main() { void main() {
highp float depth = ((position_interp.z / position_interp.w) + 1.0) * 0.5 + 0.0; // bias highp float depth = ((position_interp.z / position_interp.w) + 1.0) * 0.5 + 0.0; // bias

View file

@ -2,6 +2,7 @@
[vertex] [vertex]
#ifdef USE_GLES_OVER_GL #ifdef USE_GLES_OVER_GL
#define lowp
#define mediump #define mediump
#define highp #define highp
#else #else
@ -56,6 +57,7 @@ void main() {
#define M_PI 3.14159265359 #define M_PI 3.14159265359
#ifdef USE_GLES_OVER_GL #ifdef USE_GLES_OVER_GL
#define lowp
#define mediump #define mediump
#define highp #define highp
#else #else

View file

@ -2,6 +2,7 @@
[vertex] [vertex]
#ifdef USE_GLES_OVER_GL #ifdef USE_GLES_OVER_GL
#define lowp
#define mediump #define mediump
#define highp #define highp
#else #else
@ -25,6 +26,7 @@ void main() {
[fragment] [fragment]
#ifdef USE_GLES_OVER_GL #ifdef USE_GLES_OVER_GL
#define lowp
#define mediump #define mediump
#define highp #define highp
#else #else

View file

@ -2,6 +2,7 @@
[vertex] [vertex]
#ifdef USE_GLES_OVER_GL #ifdef USE_GLES_OVER_GL
#define lowp
#define mediump #define mediump
#define highp #define highp
#else #else
@ -32,6 +33,7 @@ void main() {
#endif #endif
#ifdef USE_GLES_OVER_GL #ifdef USE_GLES_OVER_GL
#define lowp
#define mediump #define mediump
#define highp #define highp
#else #else

View file

@ -2,6 +2,7 @@
[vertex] [vertex]
#ifdef USE_GLES_OVER_GL #ifdef USE_GLES_OVER_GL
#define lowp
#define mediump #define mediump
#define highp #define highp
#else #else
@ -29,6 +30,7 @@ void main() {
[fragment] [fragment]
#ifdef USE_GLES_OVER_GL #ifdef USE_GLES_OVER_GL
#define lowp
#define mediump #define mediump
#define highp #define highp
#else #else

View file

@ -2,6 +2,7 @@
[vertex] [vertex]
#ifdef USE_GLES_OVER_GL #ifdef USE_GLES_OVER_GL
#define lowp
#define mediump #define mediump
#define highp #define highp
#else #else
@ -653,6 +654,7 @@ VERTEX_SHADER_CODE
#endif #endif
#ifdef USE_GLES_OVER_GL #ifdef USE_GLES_OVER_GL
#define lowp
#define mediump #define mediump
#define highp #define highp
#else #else