summaryrefslogtreecommitdiff
path: root/drivers/gles2
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gles2')
-rw-r--r--drivers/gles2/rasterizer_scene_gles2.cpp2
-rw-r--r--drivers/gles2/shader_gles2.cpp5
-rw-r--r--drivers/gles2/shaders/canvas.glsl9
-rw-r--r--drivers/gles2/shaders/copy.glsl9
-rw-r--r--drivers/gles2/shaders/cubemap_filter.glsl10
-rw-r--r--drivers/gles2/shaders/scene.glsl7
6 files changed, 34 insertions, 8 deletions
diff --git a/drivers/gles2/rasterizer_scene_gles2.cpp b/drivers/gles2/rasterizer_scene_gles2.cpp
index ce2961170a..47a4f8bc27 100644
--- a/drivers/gles2/rasterizer_scene_gles2.cpp
+++ b/drivers/gles2/rasterizer_scene_gles2.cpp
@@ -3135,7 +3135,7 @@ void RasterizerSceneGLES2::initialize() {
}
// cubemaps for shadows
- if (!storage->config.support_write_depth) { //not going to be used
+ if (storage->config.support_write_depth) { //not going to be used
int max_shadow_cubemap_sampler_size = 512;
int cube_size = max_shadow_cubemap_sampler_size;
diff --git a/drivers/gles2/shader_gles2.cpp b/drivers/gles2/shader_gles2.cpp
index 65d4b63bb9..b50da3e9fe 100644
--- a/drivers/gles2/shader_gles2.cpp
+++ b/drivers/gles2/shader_gles2.cpp
@@ -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;
diff --git a/drivers/gles2/shaders/canvas.glsl b/drivers/gles2/shaders/canvas.glsl
index bc734a6597..c4a8c8b990 100644
--- a/drivers/gles2/shaders/canvas.glsl
+++ b/drivers/gles2/shaders/canvas.glsl
@@ -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 */
diff --git a/drivers/gles2/shaders/copy.glsl b/drivers/gles2/shaders/copy.glsl
index 286ba6b8c0..931b3f3708 100644
--- a/drivers/gles2/shaders/copy.glsl
+++ b/drivers/gles2/shaders/copy.glsl
@@ -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;
diff --git a/drivers/gles2/shaders/cubemap_filter.glsl b/drivers/gles2/shaders/cubemap_filter.glsl
index 558c83960e..7643297a14 100644
--- a/drivers/gles2/shaders/cubemap_filter.glsl
+++ b/drivers/gles2/shaders/cubemap_filter.glsl
@@ -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
diff --git a/drivers/gles2/shaders/scene.glsl b/drivers/gles2/shaders/scene.glsl
index 6aa91df20f..c7f5c97133 100644
--- a/drivers/gles2/shaders/scene.glsl
+++ b/drivers/gles2/shaders/scene.glsl
@@ -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"