diff options
21 files changed, 75 insertions, 55 deletions
diff --git a/drivers/spirv-reflect/SCsub b/drivers/spirv-reflect/SCsub index f6b40ac433..8ff27da114 100644 --- a/drivers/spirv-reflect/SCsub +++ b/drivers/spirv-reflect/SCsub @@ -3,12 +3,13 @@ Import('env') env_spirv_reflect = env.Clone() +env_spirv_reflect.disable_warnings() thirdparty_dir = "#thirdparty/spirv-reflect/" thirdparty_sources = [ "spirv_reflect.c" ] - + thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources] env_spirv_reflect.add_source_files(env.drivers_sources, thirdparty_sources) diff --git a/drivers/vulkan/rendering_device_vulkan.cpp b/drivers/vulkan/rendering_device_vulkan.cpp index 4582f1c2c1..1eb6f204f2 100644 --- a/drivers/vulkan/rendering_device_vulkan.cpp +++ b/drivers/vulkan/rendering_device_vulkan.cpp @@ -1997,8 +1997,8 @@ RID RenderingDeviceVulkan::texture_create_shared_from_slice(const TextureView &p //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; 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 { - 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; } 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]; } 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]; } diff --git a/drivers/vulkan/vulkan_context.cpp b/drivers/vulkan/vulkan_context.cpp index 068c0fd9d2..ca488fc3a3 100644 --- a/drivers/vulkan/vulkan_context.cpp +++ b/drivers/vulkan/vulkan_context.cpp @@ -1344,6 +1344,7 @@ Error VulkanContext::swap_buffers() { /*swapchainCount*/ 0, /*pSwapchain*/ NULL, /*pImageIndices*/ NULL, + /*pResults*/ NULL, }; VkSwapchainKHR *pSwapchains = (VkSwapchainKHR *)alloca(sizeof(VkSwapchainKHR *) * windows.size()); diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index f88b071515..baee7abb32 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -6406,6 +6406,8 @@ EditorNode::EditorNode() { video_driver->set_focus_mode(Control::FOCUS_NONE); video_driver->connect("item_selected", this, "_video_driver_selected"); video_driver->add_font_override("font", gui_base->get_font("bold", "EditorFonts")); + // TODO re-enable when GLES2 is ported + video_driver->set_disabled(true); right_menu_hb->add_child(video_driver); String video_drivers = ProjectSettings::get_singleton()->get_custom_property_info()["rendering/quality/driver/driver_name"].hint_string; diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp index f43aefc944..50e3408037 100644 --- a/editor/editor_themes.cpp +++ b/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<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. // Generating upsampled icons is slower, and the benefit is hardly visible // with integer editor scales. diff --git a/editor/editor_visual_profiler.cpp b/editor/editor_visual_profiler.cpp index 3f3da7c4a5..1b68a89181 100644 --- a/editor/editor_visual_profiler.cpp +++ b/editor/editor_visual_profiler.cpp @@ -113,12 +113,6 @@ void EditorVisualProfiler::clear() { 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) { int dmode = display_mode->get_selected(); @@ -126,7 +120,7 @@ String EditorVisualProfiler::_get_time_as_text(float p_time) { if (dmode == DISPLAY_FRAME_TIME) { return rtos(p_time) + "ms"; } 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"; diff --git a/main/tests/test_shader_lang.cpp b/main/tests/test_shader_lang.cpp index 1e0f3c6425..941a6771bf 100644 --- a/main/tests/test_shader_lang.cpp +++ b/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: { // FIXME: Implement } break; + case SL::Node::TYPE_ARRAY_CONSTRUCT: { + // FIXME: Implement + } break; case SL::Node::TYPE_CONSTANT: { SL::ConstantNode *cnode = (SL::ConstantNode *)p_node; return get_constant_text(cnode->datatype, cnode->values); diff --git a/modules/assimp/import_utils.h b/modules/assimp/import_utils.h index 0eb055956b..d037efce21 100644 --- a/modules/assimp/import_utils.h +++ b/modules/assimp/import_utils.h @@ -320,10 +320,10 @@ public: static void set_texture_mapping_mode(aiTextureMapMode *map_mode, Ref<ImageTexture> texture) { ERR_FAIL_COND(texture.is_null()); ERR_FAIL_COND(map_mode == NULL); - aiTextureMapMode tex_mode = map_mode[0]; - // FIXME: Commented out during Vulkan port. /* + aiTextureMapMode tex_mode = map_mode[0]; + int32_t flags = Texture2D::FLAGS_DEFAULT; if (tex_mode == aiTextureMapMode_Wrap) { //Default diff --git a/modules/basis_universal/SCsub b/modules/basis_universal/SCsub index 3e179762a5..d7342358d7 100644 --- a/modules/basis_universal/SCsub +++ b/modules/basis_universal/SCsub @@ -28,7 +28,11 @@ tool_sources = [ tool_sources = [thirdparty_dir + file for file in tool_sources] 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": env_basisu.Append(CPPFLAGS=["-DBASISU_DEVEL_MESSAGES=1", "-DBASISD_ENABLE_DEBUG_FLAGS=1"]) diff --git a/modules/gdnative/arvr/arvr_interface_gdnative.cpp b/modules/gdnative/arvr/arvr_interface_gdnative.cpp index 7c791a3108..a033c2b7f9 100644 --- a/modules/gdnative/arvr/arvr_interface_gdnative.cpp +++ b/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) { // 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; +#if 0 RID *render_target = (RID *)p_render_target; +#endif Rect2 screen_rect = *(Rect2 *)p_rect; 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) { // 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. +#if 0 RID *render_target = (RID *)p_render_target; RID eye_texture = VSG::storage->render_target_get_texture(*render_target); +#endif + #ifndef _MSC_VER #warning need to obtain this ID again #endif diff --git a/scene/3d/voxelizer.cpp b/scene/3d/voxelizer.cpp index 4d7054726d..7cf26ab974 100644 --- a/scene/3d/voxelizer.cpp +++ b/scene/3d/voxelizer.cpp @@ -1087,7 +1087,7 @@ PoolVector<uint8_t> Voxelizer::get_sdf_3d_image() const { if (d == 0) { w[i] = 0; } else { - w[i] = CLAMP(d, 0, 254) + 1; + w[i] = MIN(d, 254) + 1; } } } diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp index 01e3c4c930..6e2fe01834 100644 --- a/scene/resources/material.cpp +++ b/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_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_MAX: break; // Internal value, skip. } if (flags[FLAG_USE_TEXTURE_REPEAT]) { diff --git a/servers/visual/rasterizer.h b/servers/visual/rasterizer.h index 72c9a7f913..08d2104f94 100644 --- a/servers/visual/rasterizer.h +++ b/servers/visual/rasterizer.h @@ -1080,8 +1080,8 @@ public: const Item::CommandTransform *transform = static_cast<const Item::CommandTransform *>(c); xf = transform->xform; found_xform = true; - - } //passthrough + FALLTHROUGH; + } default: { c = c->next; continue; diff --git a/servers/visual/rasterizer_rd/light_cluster_builder.cpp b/servers/visual/rasterizer_rd/light_cluster_builder.cpp index 5fe734e82d..78011c22cc 100644 --- a/servers/visual/rasterizer_rd/light_cluster_builder.cpp +++ b/servers/visual/rasterizer_rd/light_cluster_builder.cpp @@ -112,8 +112,8 @@ void LightClusterBuilder::bake_cluster() { int sx = MAX(0, from_x); 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)); 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 63a406a392..e3c3cdf0bf 100644 --- a/servers/visual/rasterizer_rd/rasterizer_scene_high_end_rd.cpp +++ b/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) { - 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[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)); 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); 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.atlas_rect[0] = 0; @@ -2690,6 +2690,8 @@ RasterizerSceneHighEndRD::RasterizerSceneHighEndRD(RasterizerStorageRD *p_storag } RasterizerSceneHighEndRD::~RasterizerSceneHighEndRD() { + directional_shadow_atlas_set_size(0); + //clear base uniform set if still valid if (view_dependant_uniform_set.is_valid() && RD::get_singleton()->uniform_set_is_valid(view_dependant_uniform_set)) { RD::get_singleton()->free(view_dependant_uniform_set); diff --git a/servers/visual/rasterizer_rd/rasterizer_scene_rd.cpp b/servers/visual/rasterizer_rd/rasterizer_scene_rd.cpp index e95b7c0b2a..317ffb994f 100644 --- a/servers/visual/rasterizer_rd/rasterizer_scene_rd.cpp +++ b/servers/visual/rasterizer_rd/rasterizer_scene_rd.cpp @@ -3125,8 +3125,6 @@ RasterizerSceneRD::RasterizerSceneRD(RasterizerStorageRD *p_storage) { } RasterizerSceneRD::~RasterizerSceneRD() { - directional_shadow_atlas_set_size(0); - for (Map<Vector2i, ShadowMap>::Element *E = shadow_maps.front(); E; E = E->next()) { RD::get_singleton()->free(E->get().depth); } diff --git a/servers/visual/rasterizer_rd/rasterizer_storage_rd.cpp b/servers/visual/rasterizer_rd/rasterizer_storage_rd.cpp index c92400c188..4a3960be1c 100644 --- a/servers/visual/rasterizer_rd/rasterizer_storage_rd.cpp +++ b/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) { Mesh *mesh = mesh_owner.getornull(p_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); uint64_t data_size = p_data.size(); 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) { Mesh *mesh = mesh_owner.getornull(p_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->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 { Mesh *mesh = mesh_owner.getornull(p_mesh); 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; } @@ -1987,7 +1987,7 @@ VS::SurfaceData RasterizerStorageRD::mesh_get_surface(RID p_mesh, int p_surface) Mesh *mesh = mesh_owner.getornull(p_mesh); 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]; @@ -2468,7 +2468,7 @@ void RasterizerStorageRD::_multimesh_mark_dirty(MultiMesh *multimesh, int p_inde uint32_t region_index = p_index / MULTIMESH_DIRTY_REGION_SIZE; #ifdef DEBUG_ENABLED 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 if (!multimesh->data_cache_dirty_regions[region_index]) { 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; - 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->octree_buffer = RD::get_singleton()->storage_buffer_create(p_octree_cells.size(), p_octree_cells); diff --git a/servers/visual/rasterizer_rd/rasterizer_storage_rd.h b/servers/visual/rasterizer_rd/rasterizer_storage_rd.h index 7ab8b904ad..055737d65d 100644 --- a/servers/visual/rasterizer_rd/rasterizer_storage_rd.h +++ b/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) { Mesh *mesh = mesh_owner.getornull(p_mesh); 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; } @@ -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) { Mesh *mesh = mesh_owner.getornull(p_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]; diff --git a/servers/visual/rendering_device.cpp b/servers/visual/rendering_device.cpp index dab936d9a9..d7c88d5671 100644 --- a/servers/visual/rendering_device.cpp +++ b/servers/visual/rendering_device.cpp @@ -60,9 +60,5 @@ PoolVector<uint8_t> RenderingDevice::shader_compile_from_source(ShaderStage p_st } RenderingDevice::RenderingDevice() { - - ShaderCompileFunction compile_function; - ShaderCacheFunction cache_function; - singleton = this; } diff --git a/servers/visual/shader_language.cpp b/servers/visual/shader_language.cpp index 76348373c9..734abd7365 100644 --- a/servers/visual/shader_language.cpp +++ b/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_string = "CubeMap"; } break; + case ShaderLanguage::TYPE_STRUCT: { + // FIXME: Implement this. + } break; } return pi; } uint32_t ShaderLanguage::get_type_size(DataType p_type) { switch (p_type) { + case TYPE_VOID: + return 0; case TYPE_BOOL: case TYPE_INT: case TYPE_UINT: - case TYPE_FLOAT: return 4; + case TYPE_FLOAT: + return 4; case TYPE_BVEC2: case TYPE_IVEC2: case TYPE_UVEC2: - case TYPE_VEC2: return 8; + case TYPE_VEC2: + return 8; case TYPE_BVEC3: case TYPE_IVEC3: case TYPE_UVEC3: - case TYPE_VEC3: return 12; + case TYPE_VEC3: + return 12; case TYPE_BVEC4: case TYPE_IVEC4: 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_ISAMPLER2D: case TYPE_USAMPLER2D: @@ -2742,7 +2754,11 @@ uint32_t ShaderLanguage::get_type_size(DataType p_type) { case TYPE_SAMPLER3D: case TYPE_ISAMPLER3D: 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; } diff --git a/servers/visual/visual_server_raster.cpp b/servers/visual/visual_server_raster.cpp index 6599b9a2d2..b27c01cccc 100644 --- a/servers/visual/visual_server_raster.cpp +++ b/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_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_gpu = VSG::storage->get_captured_timestamp_gpu_time(i) - base_gpu; new_profile.write[i].gpu_msec = float(time_gpu / 1000) / 1000.0; |