瀏覽代碼

Merge pull request #36208 from akien-mga/warnings

Fix various GCC compilation warnings after Vulkan merge
Rémi Verschelde 5 年之前
父節點
當前提交
79d42069a9

+ 2 - 1
drivers/spirv-reflect/SCsub

@@ -3,12 +3,13 @@
 Import('env')
 Import('env')
 
 
 env_spirv_reflect = env.Clone()
 env_spirv_reflect = env.Clone()
+env_spirv_reflect.disable_warnings()
 
 
 thirdparty_dir = "#thirdparty/spirv-reflect/"
 thirdparty_dir = "#thirdparty/spirv-reflect/"
 thirdparty_sources = [
 thirdparty_sources = [
     "spirv_reflect.c"
     "spirv_reflect.c"
 ]
 ]
-    
+
 thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
 thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
 
 
 env_spirv_reflect.add_source_files(env.drivers_sources, thirdparty_sources)
 env_spirv_reflect.add_source_files(env.drivers_sources, thirdparty_sources)

+ 5 - 5
drivers/vulkan/rendering_device_vulkan.cpp

@@ -1997,8 +1997,8 @@ RID RenderingDeviceVulkan::texture_create_shared_from_slice(const TextureView &p
 
 
 	//create view
 	//create view
 
 
-	ERR_FAIL_INDEX_V(p_mipmap, src_texture->mipmaps, RID());
-	ERR_FAIL_INDEX_V(p_layer, src_texture->layers, RID());
+	ERR_FAIL_UNSIGNED_INDEX_V(p_mipmap, src_texture->mipmaps, RID());
+	ERR_FAIL_UNSIGNED_INDEX_V(p_layer, src_texture->layers, RID());
 
 
 	Texture texture = *src_texture;
 	Texture texture = *src_texture;
 	get_image_format_required_size(texture.format, texture.width, texture.height, texture.depth, p_mipmap + 1, &texture.width, &texture.height);
 	get_image_format_required_size(texture.format, texture.width, texture.height, texture.depth, p_mipmap + 1, &texture.width, &texture.height);
@@ -6940,15 +6940,15 @@ uint64_t RenderingDeviceVulkan::get_captured_timestamps_frame() const {
 }
 }
 
 
 uint64_t RenderingDeviceVulkan::get_captured_timestamp_gpu_time(uint32_t p_index) const {
 uint64_t RenderingDeviceVulkan::get_captured_timestamp_gpu_time(uint32_t p_index) const {
-	ERR_FAIL_INDEX_V(p_index, frames[frame].timestamp_result_count, 0);
+	ERR_FAIL_UNSIGNED_INDEX_V(p_index, frames[frame].timestamp_result_count, 0);
 	return frames[frame].timestamp_result_values[p_index] * limits.timestampPeriod;
 	return frames[frame].timestamp_result_values[p_index] * limits.timestampPeriod;
 }
 }
 uint64_t RenderingDeviceVulkan::get_captured_timestamp_cpu_time(uint32_t p_index) const {
 uint64_t RenderingDeviceVulkan::get_captured_timestamp_cpu_time(uint32_t p_index) const {
-	ERR_FAIL_INDEX_V(p_index, frames[frame].timestamp_result_count, 0);
+	ERR_FAIL_UNSIGNED_INDEX_V(p_index, frames[frame].timestamp_result_count, 0);
 	return frames[frame].timestamp_cpu_result_values[p_index];
 	return frames[frame].timestamp_cpu_result_values[p_index];
 }
 }
 String RenderingDeviceVulkan::get_captured_timestamp_name(uint32_t p_index) const {
 String RenderingDeviceVulkan::get_captured_timestamp_name(uint32_t p_index) const {
-	ERR_FAIL_INDEX_V(p_index, frames[frame].timestamp_result_count, String());
+	ERR_FAIL_UNSIGNED_INDEX_V(p_index, frames[frame].timestamp_result_count, String());
 	return frames[frame].timestamp_result_names[p_index];
 	return frames[frame].timestamp_result_names[p_index];
 }
 }
 
 

+ 1 - 0
drivers/vulkan/vulkan_context.cpp

@@ -1344,6 +1344,7 @@ Error VulkanContext::swap_buffers() {
 		/*swapchainCount*/ 0,
 		/*swapchainCount*/ 0,
 		/*pSwapchain*/ NULL,
 		/*pSwapchain*/ NULL,
 		/*pImageIndices*/ NULL,
 		/*pImageIndices*/ NULL,
+		/*pResults*/ NULL,
 	};
 	};
 
 
 	VkSwapchainKHR *pSwapchains = (VkSwapchainKHR *)alloca(sizeof(VkSwapchainKHR *) * windows.size());
 	VkSwapchainKHR *pSwapchains = (VkSwapchainKHR *)alloca(sizeof(VkSwapchainKHR *) * windows.size());

+ 0 - 3
editor/editor_themes.cpp

@@ -90,9 +90,6 @@ Ref<ImageTexture> editor_generate_icon(int p_index, bool p_convert_color, float
 	Ref<ImageTexture> icon = memnew(ImageTexture);
 	Ref<ImageTexture> icon = memnew(ImageTexture);
 	Ref<Image> img = memnew(Image);
 	Ref<Image> img = memnew(Image);
 
 
-	// dumb gizmo check
-	bool is_gizmo = String(editor_icons_names[p_index]).begins_with("Gizmo");
-
 	// Upsample icon generation only if the editor scale isn't an integer multiplier.
 	// Upsample icon generation only if the editor scale isn't an integer multiplier.
 	// Generating upsampled icons is slower, and the benefit is hardly visible
 	// Generating upsampled icons is slower, and the benefit is hardly visible
 	// with integer editor scales.
 	// with integer editor scales.

+ 1 - 7
editor/editor_visual_profiler.cpp

@@ -113,12 +113,6 @@ void EditorVisualProfiler::clear() {
 	seeking = false;
 	seeking = false;
 }
 }
 
 
-static String _get_percent_txt(float p_value, float p_total) {
-	if (p_total == 0)
-		p_total = 0.00001;
-	return String::num((p_value / p_total) * 100, 1) + "%";
-}
-
 String EditorVisualProfiler::_get_time_as_text(float p_time) {
 String EditorVisualProfiler::_get_time_as_text(float p_time) {
 
 
 	int dmode = display_mode->get_selected();
 	int dmode = display_mode->get_selected();
@@ -126,7 +120,7 @@ String EditorVisualProfiler::_get_time_as_text(float p_time) {
 	if (dmode == DISPLAY_FRAME_TIME) {
 	if (dmode == DISPLAY_FRAME_TIME) {
 		return rtos(p_time) + "ms";
 		return rtos(p_time) + "ms";
 	} else if (dmode == DISPLAY_FRAME_PERCENT) {
 	} else if (dmode == DISPLAY_FRAME_PERCENT) {
-		return String::num(p_time * 100 / graph_limit, 2) + "%"; //_get_percent_txt(p_time, m.frame_time);
+		return String::num(p_time * 100 / graph_limit, 2) + "%";
 	}
 	}
 
 
 	return "err";
 	return "err";

+ 3 - 0
main/tests/test_shader_lang.cpp

@@ -207,6 +207,9 @@ static String dump_node_code(SL::Node *p_node, int p_level) {
 		case SL::Node::TYPE_ARRAY_DECLARATION: {
 		case SL::Node::TYPE_ARRAY_DECLARATION: {
 			// FIXME: Implement
 			// FIXME: Implement
 		} break;
 		} break;
+		case SL::Node::TYPE_ARRAY_CONSTRUCT: {
+			// FIXME: Implement
+		} break;
 		case SL::Node::TYPE_CONSTANT: {
 		case SL::Node::TYPE_CONSTANT: {
 			SL::ConstantNode *cnode = (SL::ConstantNode *)p_node;
 			SL::ConstantNode *cnode = (SL::ConstantNode *)p_node;
 			return get_constant_text(cnode->datatype, cnode->values);
 			return get_constant_text(cnode->datatype, cnode->values);

+ 2 - 2
modules/assimp/import_utils.h

@@ -320,10 +320,10 @@ public:
 	static void set_texture_mapping_mode(aiTextureMapMode *map_mode, Ref<ImageTexture> texture) {
 	static void set_texture_mapping_mode(aiTextureMapMode *map_mode, Ref<ImageTexture> texture) {
 		ERR_FAIL_COND(texture.is_null());
 		ERR_FAIL_COND(texture.is_null());
 		ERR_FAIL_COND(map_mode == NULL);
 		ERR_FAIL_COND(map_mode == NULL);
-		aiTextureMapMode tex_mode = map_mode[0];
-
 		// FIXME: Commented out during Vulkan port.
 		// FIXME: Commented out during Vulkan port.
 		/*
 		/*
+		aiTextureMapMode tex_mode = map_mode[0];
+
 		int32_t flags = Texture2D::FLAGS_DEFAULT;
 		int32_t flags = Texture2D::FLAGS_DEFAULT;
 		if (tex_mode == aiTextureMapMode_Wrap) {
 		if (tex_mode == aiTextureMapMode_Wrap) {
 			//Default
 			//Default

+ 5 - 1
modules/basis_universal/SCsub

@@ -28,7 +28,11 @@ tool_sources = [
 tool_sources = [thirdparty_dir + file for file in tool_sources]
 tool_sources = [thirdparty_dir + file for file in tool_sources]
 transcoder_sources = [thirdparty_dir + "transcoder/basisu_transcoder.cpp"]
 transcoder_sources = [thirdparty_dir + "transcoder/basisu_transcoder.cpp"]
 
 
-env_basisu.Append(CPPPATH=[thirdparty_dir, thirdparty_dir + "transcoder"])
+# Treat Basis headers as system headers to avoid raising warnings. Not supported on MSVC.
+if not env.msvc:
+    env_basisu.Append(CPPFLAGS=['-isystem', Dir(thirdparty_dir).path, '-isystem', Dir(thirdparty_dir + "transcoder").path])
+else:
+    env_basisu.Prepend(CPPPATH=[thirdparty_dir, thirdparty_dir + "transcoder"])
 
 
 if env['target'] == "debug":
 if env['target'] == "debug":
 	env_basisu.Append(CPPFLAGS=["-DBASISU_DEVEL_MESSAGES=1", "-DBASISD_ENABLE_DEBUG_FLAGS=1"])
 	env_basisu.Append(CPPFLAGS=["-DBASISU_DEVEL_MESSAGES=1", "-DBASISD_ENABLE_DEBUG_FLAGS=1"])

+ 5 - 0
modules/gdnative/arvr/arvr_interface_gdnative.cpp

@@ -277,7 +277,9 @@ godot_transform GDAPI godot_arvr_get_reference_frame() {
 void GDAPI godot_arvr_blit(godot_int p_eye, godot_rid *p_render_target, godot_rect2 *p_rect) {
 void GDAPI godot_arvr_blit(godot_int p_eye, godot_rid *p_render_target, godot_rect2 *p_rect) {
 	// blits out our texture as is, handy for preview display of one of the eyes that is already rendered with lens distortion on an external HMD
 	// blits out our texture as is, handy for preview display of one of the eyes that is already rendered with lens distortion on an external HMD
 	ARVRInterface::Eyes eye = (ARVRInterface::Eyes)p_eye;
 	ARVRInterface::Eyes eye = (ARVRInterface::Eyes)p_eye;
+#if 0
 	RID *render_target = (RID *)p_render_target;
 	RID *render_target = (RID *)p_render_target;
+#endif
 	Rect2 screen_rect = *(Rect2 *)p_rect;
 	Rect2 screen_rect = *(Rect2 *)p_rect;
 
 
 	if (eye == ARVRInterface::EYE_LEFT) {
 	if (eye == ARVRInterface::EYE_LEFT) {
@@ -297,9 +299,12 @@ void GDAPI godot_arvr_blit(godot_int p_eye, godot_rid *p_render_target, godot_re
 godot_int GDAPI godot_arvr_get_texid(godot_rid *p_render_target) {
 godot_int GDAPI godot_arvr_get_texid(godot_rid *p_render_target) {
 	// In order to send off our textures to display on our hardware we need the opengl texture ID instead of the render target RID
 	// In order to send off our textures to display on our hardware we need the opengl texture ID instead of the render target RID
 	// This is a handy function to expose that.
 	// This is a handy function to expose that.
+#if 0
 	RID *render_target = (RID *)p_render_target;
 	RID *render_target = (RID *)p_render_target;
 
 
 	RID eye_texture = VSG::storage->render_target_get_texture(*render_target);
 	RID eye_texture = VSG::storage->render_target_get_texture(*render_target);
+#endif
+
 #ifndef _MSC_VER
 #ifndef _MSC_VER
 #warning need to obtain this ID again
 #warning need to obtain this ID again
 #endif
 #endif

+ 1 - 1
scene/3d/voxelizer.cpp

@@ -1087,7 +1087,7 @@ PoolVector<uint8_t> Voxelizer::get_sdf_3d_image() const {
 			if (d == 0) {
 			if (d == 0) {
 				w[i] = 0;
 				w[i] = 0;
 			} else {
 			} else {
-				w[i] = CLAMP(d, 0, 254) + 1;
+				w[i] = MIN(d, 254) + 1;
 			}
 			}
 		}
 		}
 	}
 	}

+ 1 - 0
scene/resources/material.cpp

@@ -423,6 +423,7 @@ void BaseMaterial3D::_update_shader() {
 		case TEXTURE_FILTER_LINEAR_WITH_MIPMAPS: texfilter_str = "filter_linear_mipmap"; break;
 		case TEXTURE_FILTER_LINEAR_WITH_MIPMAPS: texfilter_str = "filter_linear_mipmap"; break;
 		case TEXTURE_FILTER_NEAREST_WITH_MIMPAMPS_ANISOTROPIC: texfilter_str = "filter_nearest_mipmap_aniso"; break;
 		case TEXTURE_FILTER_NEAREST_WITH_MIMPAMPS_ANISOTROPIC: texfilter_str = "filter_nearest_mipmap_aniso"; break;
 		case TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC: texfilter_str = "filter_linear_mipmap_aniso"; break;
 		case TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC: texfilter_str = "filter_linear_mipmap_aniso"; break;
+		case TEXTURE_FILTER_MAX: break; // Internal value, skip.
 	}
 	}
 
 
 	if (flags[FLAG_USE_TEXTURE_REPEAT]) {
 	if (flags[FLAG_USE_TEXTURE_REPEAT]) {

+ 2 - 2
servers/visual/rasterizer.h

@@ -1080,8 +1080,8 @@ public:
 						const Item::CommandTransform *transform = static_cast<const Item::CommandTransform *>(c);
 						const Item::CommandTransform *transform = static_cast<const Item::CommandTransform *>(c);
 						xf = transform->xform;
 						xf = transform->xform;
 						found_xform = true;
 						found_xform = true;
-
-					} //passthrough
+						FALLTHROUGH;
+					}
 					default: {
 					default: {
 						c = c->next;
 						c = c->next;
 						continue;
 						continue;

+ 2 - 2
servers/visual/rasterizer_rd/light_cluster_builder.cpp

@@ -112,8 +112,8 @@ void LightClusterBuilder::bake_cluster() {
 
 
 			int sx = MAX(0, from_x);
 			int sx = MAX(0, from_x);
 			int sy = MAX(0, from_y);
 			int sy = MAX(0, from_y);
-			int dx = MIN(width - 1, to_x);
-			int dy = MIN(height - 1, to_y);
+			int dx = MIN((int)width - 1, to_x);
+			int dy = MIN((int)height - 1, to_y);
 
 
 			//print_line(itos(j) + " - " + Vector2i(sx, sy) + " -> " + Vector2i(dx, dy));
 			//print_line(itos(j) + " - " + Vector2i(sx, sy) + " -> " + Vector2i(dx, dy));
 
 

+ 8 - 8
servers/visual/rasterizer_rd/rasterizer_scene_high_end_rd.cpp

@@ -1409,7 +1409,7 @@ void RasterizerSceneHighEndRD::_setup_reflections(RID *p_reflection_probe_cull_r
 	}
 	}
 
 
 	if (p_reflection_probe_cull_count) {
 	if (p_reflection_probe_cull_count) {
-		RD::get_singleton()->buffer_update(scene_state.reflection_buffer, 0, MIN(scene_state.max_reflections, p_reflection_probe_cull_count) * sizeof(ReflectionData), scene_state.reflections, true);
+		RD::get_singleton()->buffer_update(scene_state.reflection_buffer, 0, MIN(scene_state.max_reflections, (unsigned int)p_reflection_probe_cull_count) * sizeof(ReflectionData), scene_state.reflections, true);
 	}
 	}
 }
 }
 
 
@@ -1566,10 +1566,10 @@ void RasterizerSceneHighEndRD::_setup_lights(RID *p_light_cull_result, int p_lig
 				light_data.attenuation_energy[0] = Math::make_half_float(storage->light_get_param(base, VS::LIGHT_PARAM_ATTENUATION));
 				light_data.attenuation_energy[0] = Math::make_half_float(storage->light_get_param(base, VS::LIGHT_PARAM_ATTENUATION));
 				light_data.attenuation_energy[1] = Math::make_half_float(sign * storage->light_get_param(base, VS::LIGHT_PARAM_ENERGY) * Math_PI);
 				light_data.attenuation_energy[1] = Math::make_half_float(sign * storage->light_get_param(base, VS::LIGHT_PARAM_ENERGY) * Math_PI);
 
 
-				light_data.color_specular[0] = CLAMP(uint32_t(linear_col.r * 255), 0, 255);
-				light_data.color_specular[1] = CLAMP(uint32_t(linear_col.g * 255), 0, 255);
-				light_data.color_specular[2] = CLAMP(uint32_t(linear_col.b * 255), 0, 255);
-				light_data.color_specular[3] = CLAMP(uint32_t(storage->light_get_param(base, VS::LIGHT_PARAM_SPECULAR) * 255), 0, 255);
+				light_data.color_specular[0] = MIN(uint32_t(linear_col.r * 255), 255);
+				light_data.color_specular[1] = MIN(uint32_t(linear_col.g * 255), 255);
+				light_data.color_specular[2] = MIN(uint32_t(linear_col.b * 255), 255);
+				light_data.color_specular[3] = MIN(uint32_t(storage->light_get_param(base, VS::LIGHT_PARAM_SPECULAR) * 255), 255);
 
 
 				float radius = MAX(0.001, storage->light_get_param(base, VS::LIGHT_PARAM_RANGE));
 				float radius = MAX(0.001, storage->light_get_param(base, VS::LIGHT_PARAM_RANGE));
 				light_data.inv_radius = 1.0 / radius;
 				light_data.inv_radius = 1.0 / radius;
@@ -1595,9 +1595,9 @@ void RasterizerSceneHighEndRD::_setup_lights(RID *p_light_cull_result, int p_lig
 				Color shadow_color = storage->light_get_shadow_color(base);
 				Color shadow_color = storage->light_get_shadow_color(base);
 
 
 				bool has_shadow = p_using_shadows && storage->light_has_shadow(base);
 				bool has_shadow = p_using_shadows && storage->light_has_shadow(base);
-				light_data.shadow_color_enabled[0] = CLAMP(uint32_t(shadow_color.r * 255), 0, 255);
-				light_data.shadow_color_enabled[1] = CLAMP(uint32_t(shadow_color.g * 255), 0, 255);
-				light_data.shadow_color_enabled[2] = CLAMP(uint32_t(shadow_color.b * 255), 0, 255);
+				light_data.shadow_color_enabled[0] = MIN(uint32_t(shadow_color.r * 255), 255);
+				light_data.shadow_color_enabled[1] = MIN(uint32_t(shadow_color.g * 255), 255);
+				light_data.shadow_color_enabled[2] = MIN(uint32_t(shadow_color.b * 255), 255);
 				light_data.shadow_color_enabled[3] = has_shadow ? 255 : 0;
 				light_data.shadow_color_enabled[3] = has_shadow ? 255 : 0;
 
 
 				light_data.atlas_rect[0] = 0;
 				light_data.atlas_rect[0] = 0;

+ 6 - 6
servers/visual/rasterizer_rd/rasterizer_storage_rd.cpp

@@ -1958,7 +1958,7 @@ VS::BlendShapeMode RasterizerStorageRD::mesh_get_blend_shape_mode(RID p_mesh) co
 void RasterizerStorageRD::mesh_surface_update_region(RID p_mesh, int p_surface, int p_offset, const PoolVector<uint8_t> &p_data) {
 void RasterizerStorageRD::mesh_surface_update_region(RID p_mesh, int p_surface, int p_offset, const PoolVector<uint8_t> &p_data) {
 	Mesh *mesh = mesh_owner.getornull(p_mesh);
 	Mesh *mesh = mesh_owner.getornull(p_mesh);
 	ERR_FAIL_COND(!mesh);
 	ERR_FAIL_COND(!mesh);
-	ERR_FAIL_INDEX((uint32_t)p_surface, mesh->surface_count);
+	ERR_FAIL_UNSIGNED_INDEX((uint32_t)p_surface, mesh->surface_count);
 	ERR_FAIL_COND(p_data.size() == 0);
 	ERR_FAIL_COND(p_data.size() == 0);
 	uint64_t data_size = p_data.size();
 	uint64_t data_size = p_data.size();
 	PoolVector<uint8_t>::Read r = p_data.read();
 	PoolVector<uint8_t>::Read r = p_data.read();
@@ -1969,7 +1969,7 @@ void RasterizerStorageRD::mesh_surface_update_region(RID p_mesh, int p_surface,
 void RasterizerStorageRD::mesh_surface_set_material(RID p_mesh, int p_surface, RID p_material) {
 void RasterizerStorageRD::mesh_surface_set_material(RID p_mesh, int p_surface, RID p_material) {
 	Mesh *mesh = mesh_owner.getornull(p_mesh);
 	Mesh *mesh = mesh_owner.getornull(p_mesh);
 	ERR_FAIL_COND(!mesh);
 	ERR_FAIL_COND(!mesh);
-	ERR_FAIL_INDEX((uint32_t)p_surface, mesh->surface_count);
+	ERR_FAIL_UNSIGNED_INDEX((uint32_t)p_surface, mesh->surface_count);
 	mesh->surfaces[p_surface]->material = p_material;
 	mesh->surfaces[p_surface]->material = p_material;
 
 
 	mesh->instance_dependency.instance_notify_changed(false, true);
 	mesh->instance_dependency.instance_notify_changed(false, true);
@@ -1978,7 +1978,7 @@ void RasterizerStorageRD::mesh_surface_set_material(RID p_mesh, int p_surface, R
 RID RasterizerStorageRD::mesh_surface_get_material(RID p_mesh, int p_surface) const {
 RID RasterizerStorageRD::mesh_surface_get_material(RID p_mesh, int p_surface) const {
 	Mesh *mesh = mesh_owner.getornull(p_mesh);
 	Mesh *mesh = mesh_owner.getornull(p_mesh);
 	ERR_FAIL_COND_V(!mesh, RID());
 	ERR_FAIL_COND_V(!mesh, RID());
-	ERR_FAIL_INDEX_V((uint32_t)p_surface, mesh->surface_count, RID());
+	ERR_FAIL_UNSIGNED_INDEX_V((uint32_t)p_surface, mesh->surface_count, RID());
 
 
 	return mesh->surfaces[p_surface]->material;
 	return mesh->surfaces[p_surface]->material;
 }
 }
@@ -1987,7 +1987,7 @@ VS::SurfaceData RasterizerStorageRD::mesh_get_surface(RID p_mesh, int p_surface)
 
 
 	Mesh *mesh = mesh_owner.getornull(p_mesh);
 	Mesh *mesh = mesh_owner.getornull(p_mesh);
 	ERR_FAIL_COND_V(!mesh, VS::SurfaceData());
 	ERR_FAIL_COND_V(!mesh, VS::SurfaceData());
-	ERR_FAIL_INDEX_V((uint32_t)p_surface, mesh->surface_count, VS::SurfaceData());
+	ERR_FAIL_UNSIGNED_INDEX_V((uint32_t)p_surface, mesh->surface_count, VS::SurfaceData());
 
 
 	Mesh::Surface &s = *mesh->surfaces[p_surface];
 	Mesh::Surface &s = *mesh->surfaces[p_surface];
 
 
@@ -2468,7 +2468,7 @@ void RasterizerStorageRD::_multimesh_mark_dirty(MultiMesh *multimesh, int p_inde
 	uint32_t region_index = p_index / MULTIMESH_DIRTY_REGION_SIZE;
 	uint32_t region_index = p_index / MULTIMESH_DIRTY_REGION_SIZE;
 #ifdef DEBUG_ENABLED
 #ifdef DEBUG_ENABLED
 	uint32_t data_cache_dirty_region_count = (multimesh->instances - 1) / MULTIMESH_DIRTY_REGION_SIZE + 1;
 	uint32_t data_cache_dirty_region_count = (multimesh->instances - 1) / MULTIMESH_DIRTY_REGION_SIZE + 1;
-	ERR_FAIL_INDEX(region_index, data_cache_dirty_region_count); //bug
+	ERR_FAIL_UNSIGNED_INDEX(region_index, data_cache_dirty_region_count); //bug
 #endif
 #endif
 	if (!multimesh->data_cache_dirty_regions[region_index]) {
 	if (!multimesh->data_cache_dirty_regions[region_index]) {
 		multimesh->data_cache_dirty_regions[p_index] = true;
 		multimesh->data_cache_dirty_regions[p_index] = true;
@@ -3581,7 +3581,7 @@ void RasterizerStorageRD::gi_probe_allocate(RID p_gi_probe, const Transform &p_t
 
 
 		uint32_t cell_count = p_octree_cells.size() / 32;
 		uint32_t cell_count = p_octree_cells.size() / 32;
 
 
-		ERR_FAIL_COND(p_data_cells.size() != cell_count * 16); //see that data size matches
+		ERR_FAIL_COND(p_data_cells.size() != (int)cell_count * 16); //see that data size matches
 
 
 		gi_probe->cell_count = cell_count;
 		gi_probe->cell_count = cell_count;
 		gi_probe->octree_buffer = RD::get_singleton()->storage_buffer_create(p_octree_cells.size(), p_octree_cells);
 		gi_probe->octree_buffer = RD::get_singleton()->storage_buffer_create(p_octree_cells.size(), p_octree_cells);

+ 2 - 2
servers/visual/rasterizer_rd/rasterizer_storage_rd.h

@@ -657,7 +657,7 @@ public:
 	_FORCE_INLINE_ VS::PrimitiveType mesh_surface_get_primitive(RID p_mesh, uint32_t p_surface_index) {
 	_FORCE_INLINE_ VS::PrimitiveType mesh_surface_get_primitive(RID p_mesh, uint32_t p_surface_index) {
 		Mesh *mesh = mesh_owner.getornull(p_mesh);
 		Mesh *mesh = mesh_owner.getornull(p_mesh);
 		ERR_FAIL_COND_V(!mesh, VS::PRIMITIVE_MAX);
 		ERR_FAIL_COND_V(!mesh, VS::PRIMITIVE_MAX);
-		ERR_FAIL_INDEX_V(p_surface_index, mesh->surface_count, VS::PRIMITIVE_MAX);
+		ERR_FAIL_UNSIGNED_INDEX_V(p_surface_index, mesh->surface_count, VS::PRIMITIVE_MAX);
 
 
 		return mesh->surfaces[p_surface_index]->primitive;
 		return mesh->surfaces[p_surface_index]->primitive;
 	}
 	}
@@ -665,7 +665,7 @@ public:
 	_FORCE_INLINE_ void mesh_surface_get_arrays_and_format(RID p_mesh, uint32_t p_surface_index, uint32_t p_input_mask, RID &r_vertex_array_rd, RID &r_index_array_rd, RD::VertexFormatID &r_vertex_format) {
 	_FORCE_INLINE_ void mesh_surface_get_arrays_and_format(RID p_mesh, uint32_t p_surface_index, uint32_t p_input_mask, RID &r_vertex_array_rd, RID &r_index_array_rd, RD::VertexFormatID &r_vertex_format) {
 		Mesh *mesh = mesh_owner.getornull(p_mesh);
 		Mesh *mesh = mesh_owner.getornull(p_mesh);
 		ERR_FAIL_COND(!mesh);
 		ERR_FAIL_COND(!mesh);
-		ERR_FAIL_INDEX(p_surface_index, mesh->surface_count);
+		ERR_FAIL_UNSIGNED_INDEX(p_surface_index, mesh->surface_count);
 
 
 		Mesh::Surface *s = mesh->surfaces[p_surface_index];
 		Mesh::Surface *s = mesh->surfaces[p_surface_index];
 
 

+ 0 - 4
servers/visual/rendering_device.cpp

@@ -60,9 +60,5 @@ PoolVector<uint8_t> RenderingDevice::shader_compile_from_source(ShaderStage p_st
 }
 }
 
 
 RenderingDevice::RenderingDevice() {
 RenderingDevice::RenderingDevice() {
-
-	ShaderCompileFunction compile_function;
-	ShaderCacheFunction cache_function;
-
 	singleton = this;
 	singleton = this;
 }
 }

+ 24 - 8
servers/visual/shader_language.cpp

@@ -2708,31 +2708,43 @@ PropertyInfo ShaderLanguage::uniform_to_property_info(const ShaderNode::Uniform
 			pi.hint = PROPERTY_HINT_RESOURCE_TYPE;
 			pi.hint = PROPERTY_HINT_RESOURCE_TYPE;
 			pi.hint_string = "CubeMap";
 			pi.hint_string = "CubeMap";
 		} break;
 		} break;
+		case ShaderLanguage::TYPE_STRUCT: {
+			// FIXME: Implement this.
+		} break;
 	}
 	}
 	return pi;
 	return pi;
 }
 }
 
 
 uint32_t ShaderLanguage::get_type_size(DataType p_type) {
 uint32_t ShaderLanguage::get_type_size(DataType p_type) {
 	switch (p_type) {
 	switch (p_type) {
+		case TYPE_VOID:
+			return 0;
 		case TYPE_BOOL:
 		case TYPE_BOOL:
 		case TYPE_INT:
 		case TYPE_INT:
 		case TYPE_UINT:
 		case TYPE_UINT:
-		case TYPE_FLOAT: return 4;
+		case TYPE_FLOAT:
+			return 4;
 		case TYPE_BVEC2:
 		case TYPE_BVEC2:
 		case TYPE_IVEC2:
 		case TYPE_IVEC2:
 		case TYPE_UVEC2:
 		case TYPE_UVEC2:
-		case TYPE_VEC2: return 8;
+		case TYPE_VEC2:
+			return 8;
 		case TYPE_BVEC3:
 		case TYPE_BVEC3:
 		case TYPE_IVEC3:
 		case TYPE_IVEC3:
 		case TYPE_UVEC3:
 		case TYPE_UVEC3:
-		case TYPE_VEC3: return 12;
+		case TYPE_VEC3:
+			return 12;
 		case TYPE_BVEC4:
 		case TYPE_BVEC4:
 		case TYPE_IVEC4:
 		case TYPE_IVEC4:
 		case TYPE_UVEC4:
 		case TYPE_UVEC4:
-		case TYPE_VEC4: return 16;
-		case TYPE_MAT2: return 8;
-		case TYPE_MAT3: return 12;
-		case TYPE_MAT4: return 16;
+		case TYPE_VEC4:
+			return 16;
+		case TYPE_MAT2:
+			return 8;
+		case TYPE_MAT3:
+			return 12;
+		case TYPE_MAT4:
+			return 16;
 		case TYPE_SAMPLER2D:
 		case TYPE_SAMPLER2D:
 		case TYPE_ISAMPLER2D:
 		case TYPE_ISAMPLER2D:
 		case TYPE_USAMPLER2D:
 		case TYPE_USAMPLER2D:
@@ -2742,7 +2754,11 @@ uint32_t ShaderLanguage::get_type_size(DataType p_type) {
 		case TYPE_SAMPLER3D:
 		case TYPE_SAMPLER3D:
 		case TYPE_ISAMPLER3D:
 		case TYPE_ISAMPLER3D:
 		case TYPE_USAMPLER3D:
 		case TYPE_USAMPLER3D:
-		case TYPE_SAMPLERCUBE: return 4; //not really, but useful for indices
+		case TYPE_SAMPLERCUBE:
+			return 4; //not really, but useful for indices
+		case TYPE_STRUCT:
+			// FIXME: Implement.
+			return 0;
 	}
 	}
 	return 0;
 	return 0;
 }
 }

+ 1 - 1
servers/visual/visual_server_raster.cpp

@@ -139,7 +139,7 @@ void VisualServerRaster::draw(bool p_swap_buffers, double frame_step) {
 
 
 		uint64_t base_cpu = VSG::storage->get_captured_timestamp_cpu_time(0);
 		uint64_t base_cpu = VSG::storage->get_captured_timestamp_cpu_time(0);
 		uint64_t base_gpu = VSG::storage->get_captured_timestamp_gpu_time(0);
 		uint64_t base_gpu = VSG::storage->get_captured_timestamp_gpu_time(0);
-		for (int i = 0; i < VSG::storage->get_captured_timestamps_count(); i++) {
+		for (uint32_t i = 0; i < VSG::storage->get_captured_timestamps_count(); i++) {
 			uint64_t time_cpu = VSG::storage->get_captured_timestamp_cpu_time(i) - base_cpu;
 			uint64_t time_cpu = VSG::storage->get_captured_timestamp_cpu_time(i) - base_cpu;
 			uint64_t time_gpu = VSG::storage->get_captured_timestamp_gpu_time(i) - base_gpu;
 			uint64_t time_gpu = VSG::storage->get_captured_timestamp_gpu_time(i) - base_gpu;
 			new_profile.write[i].gpu_msec = float(time_gpu / 1000) / 1000.0;
 			new_profile.write[i].gpu_msec = float(time_gpu / 1000) / 1000.0;