summaryrefslogtreecommitdiff
path: root/drivers/gles3
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2018-09-27 12:07:59 +0200
committerRémi Verschelde <rverschelde@gmail.com>2018-09-27 16:25:24 +0200
commitd95bbb89227cab293f17f325040084ea780652ab (patch)
tree9b45824fdb2ee7a3d2047e1b93d11861f170a3af /drivers/gles3
parentcda5b0bfe17203b5da261f23bd31f0967522a147 (diff)
Fix warnings about set but unused variables [-Wunused-but-set-variable]
Fixes the following GCC 5 warnings: ``` drivers/gles2/rasterizer_canvas_gles2.cpp:814:8: warning: variable 'rt_size' set but not used [-Wunused-but-set-variable] drivers/gles2/rasterizer_scene_gles2.cpp:2270:11: warning: variable 'vp_height' set but not used [-Wunused-but-set-variable] drivers/gles2/rasterizer_scene_gles2.cpp:2673:22: warning: variable 'e' set but not used [-Wunused-but-set-variable] drivers/gles2/rasterizer_scene_gles2.cpp:715:7: warning: variable 'no_cull' set but not used [-Wunused-but-set-variable] drivers/gles2/shader_gles2.cpp:693:14: warning: variable 'cc' set but not used [-Wunused-but-set-variable] drivers/gles3/rasterizer_canvas_gles3.cpp:1226:8: warning: variable 'rt_size' set but not used [-Wunused-but-set-variable] drivers/gles3/rasterizer_scene_gles3.cpp:3039:10: warning: variable 'contrib' set but not used [-Wunused-but-set-variable] drivers/gles3/rasterizer_scene_gles3.cpp:4504:32: warning: variable 'vp_height' set but not used [-Wunused-but-set-variable] editor/editor_inspector.cpp:272:9: warning: variable 'guide_color' set but not used [-Wunused-but-set-variable] editor/editor_themes.cpp:1067:14: warning: variable 'alpha3' set but not used [-Wunused-but-set-variable] editor/editor_themes.cpp:263:8: warning: variable 'script_bg_color' set but not used [-Wunused-but-set-variable] editor/plugins/collision_shape_2d_editor_plugin.cpp:326:11: warning: variable 'cpoint' set but not used [-Wunused-but-set-variable] editor/plugins/mesh_editor_plugin.cpp:72:9: warning: variable 'size' set but not used [-Wunused-but-set-variable] editor/plugins/shader_editor_plugin.cpp:471:12: warning: variable 'mpos' set but not used [-Wunused-but-set-variable] editor/plugins/shader_editor_plugin.cpp:89:8: warning: variable 'basetype_color' set but not used [-Wunused-but-set-variable] editor/plugins/shader_editor_plugin.cpp:90:8: warning: variable 'type_color' set but not used [-Wunused-but-set-variable] editor/plugins/shader_editor_plugin.cpp:92:8: warning: variable 'string_color' set but not used [-Wunused-but-set-variable] modules/visual_script/visual_script_editor.cpp:2521:7: warning: variable 'seq_connect' set but not used [-Wunused-but-set-variable] platform/android/export/export.cpp:580:12: warning: variable 'styles_count' set but not used [-Wunused-but-set-variable] platform/android/export/export.cpp:584:12: warning: variable 'styles_offset' set but not used [-Wunused-but-set-variable] platform/osx/export/export.cpp:464:9: warning: variable 'zerr' set but not used [-Wunused-but-set-variable] scene/2d/tile_map.cpp:260:10: warning: variable 'tcenter' set but not used [-Wunused-but-set-variable] scene/3d/light.cpp:166:7: warning: variable 'editor_ok' set but not used [-Wunused-but-set-variable] scene/3d/navigation.cpp:566:11: warning: variable 'closest_navmesh' set but not used [-Wunused-but-set-variable] scene/gui/rich_text_label.cpp:869:8: warning: variable 'size' set but not used [-Wunused-but-set-variable] scene/main/viewport.cpp:705:14: warning: variable 'xform' set but not used [-Wunused-but-set-variable] scene/main/viewport.cpp:706:8: warning: variable 'ss' set but not used [-Wunused-but-set-variable] scene/main/viewport.cpp:726:14: warning: variable 'xform' set but not used [-Wunused-but-set-variable] scene/main/viewport.cpp:727:8: warning: variable 'ss' set but not used [-Wunused-but-set-variable] scene/resources/material.cpp:430:7: warning: variable 'using_world' set but not used [-Wunused-but-set-variable] servers/visual/shader_language.cpp:2026:7: warning: variable 'all_const' set but not used [-Wunused-but-set-variable] servers/visual/visual_server_scene.cpp:1383:28: warning: variable 'z_max_cam' set but not used [-Wunused-but-set-variable] ``` Also fixes two [-Wunused-value] warnings: ``` scene/gui/text_edit.cpp:4405:20: warning: statement has no effect [-Wunused-value] servers/visual/visual_server_scene.cpp:905:48: warning: value computed is not used [-Wunused-value] ``` Some of those are bugs and need further work, they are identified with `// FIXME` comments.
Diffstat (limited to 'drivers/gles3')
-rw-r--r--drivers/gles3/rasterizer_canvas_gles3.cpp2
-rw-r--r--drivers/gles3/rasterizer_scene_gles3.cpp9
2 files changed, 4 insertions, 7 deletions
diff --git a/drivers/gles3/rasterizer_canvas_gles3.cpp b/drivers/gles3/rasterizer_canvas_gles3.cpp
index c9bdc6f5c3..856c83e297 100644
--- a/drivers/gles3/rasterizer_canvas_gles3.cpp
+++ b/drivers/gles3/rasterizer_canvas_gles3.cpp
@@ -1223,8 +1223,6 @@ void RasterizerCanvasGLES3::canvas_render_items(Item *p_item_list, int p_z, cons
bool rebind_shader = true;
- Size2 rt_size = Size2(storage->frame.current_rt->width, storage->frame.current_rt->height);
-
state.canvas_shader.set_conditional(CanvasShaderGLES3::USE_DISTANCE_FIELD, false);
glBindBuffer(GL_UNIFORM_BUFFER, state.canvas_item_ubo);
diff --git a/drivers/gles3/rasterizer_scene_gles3.cpp b/drivers/gles3/rasterizer_scene_gles3.cpp
index 086829f9ba..e74fe113c0 100644
--- a/drivers/gles3/rasterizer_scene_gles3.cpp
+++ b/drivers/gles3/rasterizer_scene_gles3.cpp
@@ -3036,13 +3036,14 @@ void RasterizerSceneGLES3::_setup_reflections(RID *p_reflection_probe_cull_resul
reflection_ubo.ambient[3] = rpi->probe_ptr->interior_ambient_probe_contrib;
} else {
Color ambient_linear;
- float contrib = 0;
+ // FIXME: contrib was retrieved but never used, is it meant to be set as ambient[3]? (GH-20361)
+ //float contrib = 0;
if (p_env) {
ambient_linear = p_env->ambient_color.to_linear();
ambient_linear.r *= p_env->ambient_energy;
ambient_linear.g *= p_env->ambient_energy;
ambient_linear.b *= p_env->ambient_energy;
- contrib = p_env->ambient_sky_contribution;
+ //contrib = p_env->ambient_sky_contribution;
}
reflection_ubo.ambient[0] = ambient_linear.r;
@@ -4501,7 +4502,7 @@ void RasterizerSceneGLES3::render_shadow(RID p_light, RID p_shadow_atlas, int p_
RasterizerStorageGLES3::Light *light = storage->light_owner.getornull(light_instance->light);
ERR_FAIL_COND(!light);
- uint32_t x, y, width, height, vp_height;
+ uint32_t x, y, width, height;
float dp_direction = 0.0;
float zfar = 0;
@@ -4583,7 +4584,6 @@ void RasterizerSceneGLES3::render_shadow(RID p_light, RID p_shadow_atlas, int p_
bias = light->param[VS::LIGHT_PARAM_SHADOW_BIAS] * bias_mult;
normal_bias = light->param[VS::LIGHT_PARAM_SHADOW_NORMAL_BIAS] * bias_mult;
fbo = directional_shadow.fbo;
- vp_height = directional_shadow.size;
} else {
//set from shadow atlas
@@ -4593,7 +4593,6 @@ void RasterizerSceneGLES3::render_shadow(RID p_light, RID p_shadow_atlas, int p_
ERR_FAIL_COND(!shadow_atlas->shadow_owners.has(p_light));
fbo = shadow_atlas->fbo;
- vp_height = shadow_atlas->size;
uint32_t key = shadow_atlas->shadow_owners[p_light];