summaryrefslogtreecommitdiff
path: root/drivers/gles2
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gles2')
-rw-r--r--drivers/gles2/rasterizer_canvas_gles2.cpp2
-rw-r--r--drivers/gles2/rasterizer_scene_gles2.cpp6
-rw-r--r--drivers/gles2/rasterizer_storage_gles2.cpp2
-rw-r--r--drivers/gles2/shaders/canvas.glsl2
-rw-r--r--drivers/gles2/shaders/cubemap_filter.glsl2
-rw-r--r--drivers/gles2/shaders/scene.glsl4
6 files changed, 5 insertions, 13 deletions
diff --git a/drivers/gles2/rasterizer_canvas_gles2.cpp b/drivers/gles2/rasterizer_canvas_gles2.cpp
index e922320e08..5d336d2a25 100644
--- a/drivers/gles2/rasterizer_canvas_gles2.cpp
+++ b/drivers/gles2/rasterizer_canvas_gles2.cpp
@@ -509,7 +509,7 @@ void RasterizerCanvasGLES2::_canvas_item_render_commands(Item *p_item, Item *cur
texture = texture->get_ptr();
- if (next_power_of_2(texture->alloc_width) != texture->alloc_width && next_power_of_2(texture->alloc_height) != texture->alloc_height) {
+ if (next_power_of_2(texture->alloc_width) != (unsigned int)texture->alloc_width && next_power_of_2(texture->alloc_height) != (unsigned int)texture->alloc_height) {
state.canvas_shader.set_conditional(CanvasShaderGLES2::USE_FORCE_REPEAT, true);
can_tile = false;
}
diff --git a/drivers/gles2/rasterizer_scene_gles2.cpp b/drivers/gles2/rasterizer_scene_gles2.cpp
index de77c2c63e..0fd36cfb9c 100644
--- a/drivers/gles2/rasterizer_scene_gles2.cpp
+++ b/drivers/gles2/rasterizer_scene_gles2.cpp
@@ -42,8 +42,6 @@
#define glClearDepth glClearDepthf
#endif
-#define _DEPTH_COMPONENT24_OES 0x81A6
-
static const GLenum _cube_side_enum[6] = {
GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
@@ -158,7 +156,7 @@ void RasterizerSceneGLES2::shadow_atlas_set_quadrant_subdivision(RID p_atlas, in
subdiv = int(Math::sqrt((float)subdiv));
- if (shadow_atlas->quadrants[p_quadrant].shadows.size() == subdiv)
+ if (shadow_atlas->quadrants[p_quadrant].shadows.size() == (int)subdiv)
return;
// erase all data from the quadrant
@@ -569,7 +567,7 @@ bool RasterizerSceneGLES2::reflection_probe_instance_begin_render(RID p_instance
glBindFramebuffer(GL_FRAMEBUFFER, rpi->fbo[i]);
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, _cube_side_enum[i], rpi->cubemap, 0);
glBindRenderbuffer(GL_RENDERBUFFER, rpi->depth);
- glRenderbufferStorage(GL_RENDERBUFFER, _DEPTH_COMPONENT24_OES, size, size);
+ glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT, size, size); // Note: used to be _DEPTH_COMPONENT24_OES. GL_DEPTH_COMPONENT untested.
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, rpi->depth);
#ifdef DEBUG_ENABLED
diff --git a/drivers/gles2/rasterizer_storage_gles2.cpp b/drivers/gles2/rasterizer_storage_gles2.cpp
index a877c1d03f..9d2e609e5e 100644
--- a/drivers/gles2/rasterizer_storage_gles2.cpp
+++ b/drivers/gles2/rasterizer_storage_gles2.cpp
@@ -54,8 +54,6 @@ GLuint RasterizerStorageGLES2::system_fbo = 0;
#define _EXT_TEXTURE_CUBE_MAP_SEAMLESS 0x884F
-#define _DEPTH_COMPONENT24_OES 0x81A6
-
#define _RED_OES 0x1903
void RasterizerStorageGLES2::bind_quad_array() const {
diff --git a/drivers/gles2/shaders/canvas.glsl b/drivers/gles2/shaders/canvas.glsl
index c292897ad0..b13801946f 100644
--- a/drivers/gles2/shaders/canvas.glsl
+++ b/drivers/gles2/shaders/canvas.glsl
@@ -349,7 +349,7 @@ void main() {
vec2 uv = uv_interp;
#ifdef USE_FORCE_REPEAT
//needs to use this to workaround GLES2/WebGL1 forcing tiling that textures that dont support it
- uv = mod(uv,vec2(1.0,1.0));
+ uv = mod(uv, vec2(1.0, 1.0));
#endif
#if !defined(COLOR_USED)
diff --git a/drivers/gles2/shaders/cubemap_filter.glsl b/drivers/gles2/shaders/cubemap_filter.glsl
index c32aabc4bf..a6902836ed 100644
--- a/drivers/gles2/shaders/cubemap_filter.glsl
+++ b/drivers/gles2/shaders/cubemap_filter.glsl
@@ -194,7 +194,7 @@ void main() {
gl_FragColor = vec4(texturePanorama(source_panorama, N).rgb, 1.0);
#else
- gl_FragColor = vec4(textureCube(source_cube,N).rgb, 1.0);
+ gl_FragColor = vec4(textureCube(source_cube, N).rgb, 1.0);
#endif //USE_SOURCE_PANORAMA
#else
diff --git a/drivers/gles2/shaders/scene.glsl b/drivers/gles2/shaders/scene.glsl
index fa359125b2..371ea8498a 100644
--- a/drivers/gles2/shaders/scene.glsl
+++ b/drivers/gles2/shaders/scene.glsl
@@ -660,7 +660,6 @@ VERTEX_SHADER_CODE
#if defined(RENDER_DEPTH) && defined(USE_RGBA_SHADOWS)
position_interp = gl_Position;
#endif
-
}
/* clang-format off */
@@ -1358,12 +1357,9 @@ LIGHT_SHADER_CODE
#endif
-
#define SAMPLE_SHADOW_TEXEL(p_shadow, p_pos, p_depth) step(p_depth, SHADOW_DEPTH(texture2D(p_shadow, p_pos)))
#define SAMPLE_SHADOW_TEXEL_PROJ(p_shadow, p_pos) step(p_pos.z, SHADOW_DEPTH(texture2DProj(p_shadow, p_pos)))
-
-
float sample_shadow(highp sampler2D shadow, highp vec4 spos) {
#ifdef SHADOW_MODE_PCF_13