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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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