Ensure WebGL uses highp by default, and fix some wrong mediump usages. Fixes #22962.
This commit is contained in:
parent
a280bd0c85
commit
b32298a660
5 changed files with 33 additions and 7 deletions
|
@ -242,6 +242,11 @@ ShaderGLES2::Version *ShaderGLES2::get_current_version() {
|
|||
strings.push_back("#define USE_GLES_OVER_GL\n");
|
||||
#else
|
||||
strings.push_back("#version 100\n");
|
||||
//angle does not like
|
||||
#ifdef JAVASCRIPT_ENABLED
|
||||
strings.push_back("#define USE_HIGHP_PRECISION\n");
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
int define_line_ofs = 1;
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
#define mediump
|
||||
#define highp
|
||||
#else
|
||||
precision mediump float;
|
||||
precision mediump int;
|
||||
precision highp float;
|
||||
precision highp int;
|
||||
#endif
|
||||
|
||||
uniform highp mat4 projection_matrix;
|
||||
|
@ -243,9 +243,14 @@ VERTEX_SHADER_CODE
|
|||
#define mediump
|
||||
#define highp
|
||||
#else
|
||||
#if defined(USE_HIGHP_PRECISION)
|
||||
precision highp float;
|
||||
precision highp int;
|
||||
#else
|
||||
precision mediump float;
|
||||
precision mediump int;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
uniform sampler2D color_texture; // texunit:-1
|
||||
/* clang-format on */
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
#define mediump
|
||||
#define highp
|
||||
#else
|
||||
precision mediump float;
|
||||
precision mediump int;
|
||||
precision highp float;
|
||||
precision highp int;
|
||||
#endif
|
||||
|
||||
attribute highp vec4 vertex_attrib; // attrib:0
|
||||
|
@ -61,9 +61,14 @@ void main() {
|
|||
#define mediump
|
||||
#define highp
|
||||
#else
|
||||
#if defined(USE_HIGHP_PRECISION)
|
||||
precision highp float;
|
||||
precision highp int;
|
||||
#else
|
||||
precision mediump float;
|
||||
precision mediump int;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(USE_CUBEMAP) || defined(USE_PANORAMA)
|
||||
varying vec3 cube_interp;
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
#define mediump
|
||||
#define highp
|
||||
#else
|
||||
precision mediump float;
|
||||
precision mediump int;
|
||||
precision highp float;
|
||||
precision highp int;
|
||||
#endif
|
||||
|
||||
attribute highp vec2 vertex; // attrib:0
|
||||
|
@ -51,10 +51,16 @@ void main() {
|
|||
#define mediump
|
||||
#define highp
|
||||
#else
|
||||
#if defined(USE_HIGHP_PRECISION)
|
||||
precision highp float;
|
||||
precision highp int;
|
||||
#else
|
||||
precision mediump float;
|
||||
precision mediump int;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef USE_SOURCE_PANORAMA
|
||||
uniform sampler2D source_panorama; //texunit:0
|
||||
#else
|
||||
|
|
|
@ -683,8 +683,13 @@ VERTEX_SHADER_CODE
|
|||
#define mediump
|
||||
#define highp
|
||||
#else
|
||||
precision mediump float;
|
||||
#if defined(USE_HIGHP_PRECISION)
|
||||
precision highp float;
|
||||
precision highp int;
|
||||
#else
|
||||
precision mediump float;
|
||||
precision mediump int;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "stdlib.glsl"
|
||||
|
|
Loading…
Reference in a new issue