summaryrefslogtreecommitdiff
path: root/servers/visual/rasterizer_rd
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2020-02-18 14:57:11 +0100
committerRémi Verschelde <rverschelde@gmail.com>2020-02-18 20:51:25 +0100
commit49fec646cbf3afdf5e7d55589ab359a5ebcdb897 (patch)
treef5e52fb159af51e1e3f4872415fc201c345fbad5 /servers/visual/rasterizer_rd
parente866b4043c0fc14700672713a91ec4a86c667607 (diff)
Fix compilation warnings and re-enable werror=yes on Travis
Fix -Wunused-variable, -Wunused-but-set-variable and -Wswitch warnings raised by GCC 8 and 9. Fix -Wunused-function, -Wunused-private-field and -Wtautological-constant-out-of-range-compare raised by Clang. Fix MSVC 2019 warning C4804 (unsafe use of type 'bool' in comparison operation). GCC -Wcpp warnings/Clang -W#warnings (`#warning`) are no longer raising errors and will thus not abort compilation with `werror=yes`. Treat glslang headers are system headers to avoid raising warnings. Re-enables us to build with `werror=yes` on Linux and macOS, thus catching warnings that would be introduced by new code. Fixes #36132.
Diffstat (limited to 'servers/visual/rasterizer_rd')
-rw-r--r--servers/visual/rasterizer_rd/rasterizer_canvas_rd.cpp9
-rw-r--r--servers/visual/rasterizer_rd/rasterizer_scene_high_end_rd.cpp12
-rw-r--r--servers/visual/rasterizer_rd/rasterizer_scene_rd.cpp3
-rw-r--r--servers/visual/rasterizer_rd/rasterizer_storage_rd.cpp8
-rw-r--r--servers/visual/rasterizer_rd/render_pipeline_vertex_format_cache_rd.h1
-rw-r--r--servers/visual/rasterizer_rd/shader_rd.h5
6 files changed, 14 insertions, 24 deletions
diff --git a/servers/visual/rasterizer_rd/rasterizer_canvas_rd.cpp b/servers/visual/rasterizer_rd/rasterizer_canvas_rd.cpp
index 425221608b..c3e8ca5e90 100644
--- a/servers/visual/rasterizer_rd/rasterizer_canvas_rd.cpp
+++ b/servers/visual/rasterizer_rd/rasterizer_canvas_rd.cpp
@@ -991,6 +991,15 @@ void RasterizerCanvasRD::_render_item(RD::DrawListID p_draw_list, const Item *p_
}
} break;
+ case Item::Command::TYPE_MESH:
+ case Item::Command::TYPE_MULTIMESH:
+ case Item::Command::TYPE_PARTICLES: {
+ ERR_PRINT("FIXME: Mesh, MultiMesh and Particles render commands are unimplemented currently, they need to be ported to the 4.0 rendering architecture.");
+#ifndef _MSC_VER
+#warning Item::Command types for Mesh, MultiMesh and Particles need to be implemented.
+#endif
+ // See #if 0'ed code below to port from GLES3.
+ } break;
#if 0
case Item::Command::TYPE_MESH: {
diff --git a/servers/visual/rasterizer_rd/rasterizer_scene_high_end_rd.cpp b/servers/visual/rasterizer_rd/rasterizer_scene_high_end_rd.cpp
index d329fa5779..608b7c1c68 100644
--- a/servers/visual/rasterizer_rd/rasterizer_scene_high_end_rd.cpp
+++ b/servers/visual/rasterizer_rd/rasterizer_scene_high_end_rd.cpp
@@ -67,18 +67,6 @@ static _FORCE_INLINE_ void store_transform_3x3(const Transform &p_mtx, float *p_
p_array[11] = 0;
}
-static _FORCE_INLINE_ void store_transform_3x3_430(const Transform &p_mtx, float *p_array) {
- p_array[0] = p_mtx.basis.elements[0][0];
- p_array[1] = p_mtx.basis.elements[1][0];
- p_array[2] = p_mtx.basis.elements[2][0];
- p_array[3] = p_mtx.basis.elements[0][1];
- p_array[4] = p_mtx.basis.elements[1][1];
- p_array[5] = p_mtx.basis.elements[2][1];
- p_array[6] = p_mtx.basis.elements[0][2];
- p_array[7] = p_mtx.basis.elements[1][2];
- p_array[8] = p_mtx.basis.elements[2][2];
-}
-
static _FORCE_INLINE_ void store_camera(const CameraMatrix &p_mtx, float *p_array) {
for (int i = 0; i < 4; i++) {
diff --git a/servers/visual/rasterizer_rd/rasterizer_scene_rd.cpp b/servers/visual/rasterizer_rd/rasterizer_scene_rd.cpp
index 7d5593c239..a19e633089 100644
--- a/servers/visual/rasterizer_rd/rasterizer_scene_rd.cpp
+++ b/servers/visual/rasterizer_rd/rasterizer_scene_rd.cpp
@@ -2745,7 +2745,6 @@ void RasterizerSceneRD::render_shadow(RID p_light, RID p_shadow_atlas, int p_pas
Rect2i atlas_rect;
RID atlas_fb;
- int atlas_fb_size;
bool using_dual_paraboloid = false;
bool using_dual_paraboloid_flip = false;
@@ -2816,7 +2815,6 @@ void RasterizerSceneRD::render_shadow(RID p_light, RID p_shadow_atlas, int p_pas
render_fb = shadow_map->fb;
render_texture = shadow_map->depth;
atlas_fb = directional_shadow.fb;
- atlas_fb_size = directional_shadow.size;
} else {
//set from shadow atlas
@@ -2844,7 +2842,6 @@ void RasterizerSceneRD::render_shadow(RID p_light, RID p_shadow_atlas, int p_pas
atlas_rect.size.width = shadow_size;
atlas_rect.size.height = shadow_size;
atlas_fb = shadow_atlas->fb;
- atlas_fb_size = shadow_atlas->size;
zfar = storage->light_get_param(light_instance->light, VS::LIGHT_PARAM_RANGE);
bias = storage->light_get_param(light_instance->light, VS::LIGHT_PARAM_SHADOW_BIAS);
diff --git a/servers/visual/rasterizer_rd/rasterizer_storage_rd.cpp b/servers/visual/rasterizer_rd/rasterizer_storage_rd.cpp
index 9f6b1a2b35..09767cb5a9 100644
--- a/servers/visual/rasterizer_rd/rasterizer_storage_rd.cpp
+++ b/servers/visual/rasterizer_rd/rasterizer_storage_rd.cpp
@@ -1944,7 +1944,7 @@ int RasterizerStorageRD::mesh_get_blend_shape_count(RID p_mesh) const {
void RasterizerStorageRD::mesh_set_blend_shape_mode(RID p_mesh, VS::BlendShapeMode p_mode) {
Mesh *mesh = mesh_owner.getornull(p_mesh);
ERR_FAIL_COND(!mesh);
- ERR_FAIL_INDEX(p_mode, 2);
+ ERR_FAIL_INDEX((int)p_mode, 2);
mesh->blend_shape_mode = p_mode;
}
@@ -2636,7 +2636,7 @@ void RasterizerStorageRD::multimesh_instance_set_custom_data(RID p_multimesh, in
MultiMesh *multimesh = multimesh_owner.getornull(p_multimesh);
ERR_FAIL_COND(!multimesh);
ERR_FAIL_INDEX(p_index, multimesh->instances);
- ERR_FAIL_INDEX(p_index, !multimesh->uses_custom_data);
+ ERR_FAIL_COND(!multimesh->uses_custom_data);
_multimesh_make_local(multimesh);
@@ -2723,7 +2723,7 @@ Color RasterizerStorageRD::multimesh_instance_get_color(RID p_multimesh, int p_i
MultiMesh *multimesh = multimesh_owner.getornull(p_multimesh);
ERR_FAIL_COND_V(!multimesh, Color());
ERR_FAIL_INDEX_V(p_index, multimesh->instances, Color());
- ERR_FAIL_INDEX_V(p_index, !multimesh->uses_colors, Color());
+ ERR_FAIL_COND_V(!multimesh->uses_colors, Color());
_multimesh_make_local(multimesh);
@@ -2746,7 +2746,7 @@ Color RasterizerStorageRD::multimesh_instance_get_custom_data(RID p_multimesh, i
MultiMesh *multimesh = multimesh_owner.getornull(p_multimesh);
ERR_FAIL_COND_V(!multimesh, Color());
ERR_FAIL_INDEX_V(p_index, multimesh->instances, Color());
- ERR_FAIL_INDEX_V(p_index, !multimesh->uses_custom_data, Color());
+ ERR_FAIL_COND_V(!multimesh->uses_custom_data, Color());
_multimesh_make_local(multimesh);
diff --git a/servers/visual/rasterizer_rd/render_pipeline_vertex_format_cache_rd.h b/servers/visual/rasterizer_rd/render_pipeline_vertex_format_cache_rd.h
index 173e839330..05c5968360 100644
--- a/servers/visual/rasterizer_rd/render_pipeline_vertex_format_cache_rd.h
+++ b/servers/visual/rasterizer_rd/render_pipeline_vertex_format_cache_rd.h
@@ -41,7 +41,6 @@ class RenderPipelineVertexFormatCacheRD {
RID shader;
uint32_t input_mask;
- RD::FramebufferFormatID framebuffer_format;
RD::RenderPrimitive render_primitive;
RD::PipelineRasterizationState rasterization_state;
RD::PipelineMultisampleState multisample_state;
diff --git a/servers/visual/rasterizer_rd/shader_rd.h b/servers/visual/rasterizer_rd/shader_rd.h
index dce46fc0b5..8581b85ff4 100644
--- a/servers/visual/rasterizer_rd/shader_rd.h
+++ b/servers/visual/rasterizer_rd/shader_rd.h
@@ -35,6 +35,7 @@
#include "core/map.h"
#include "core/rid_owner.h"
#include "core/variant.h"
+
#include <stdio.h>
#include <mutex>
/**
@@ -47,11 +48,7 @@ class ShaderRD {
CharString general_defines;
Vector<CharString> variant_defines;
- int vertex_code_start;
- int fragment_code_start;
-
struct Version {
-
CharString uniforms;
CharString vertex_globals;
CharString vertex_code;