diff options
120 files changed, 1172 insertions, 832 deletions
diff --git a/core/core_bind.cpp b/core/core_bind.cpp index 12fca4215a..9e96d4b079 100644 --- a/core/core_bind.cpp +++ b/core/core_bind.cpp @@ -355,20 +355,20 @@ void _OS::print_all_textures_by_size() { List<Ref<Resource>> rsrc; ResourceCache::get_cached_resources(&rsrc); - for (Ref<Resource> E : rsrc) { - if (!E->is_class("ImageTexture")) { + for (Ref<Resource> &res : rsrc) { + if (!res->is_class("ImageTexture")) { continue; } - Size2 size = E->call("get_size"); - int fmt = E->call("get_format"); + Size2 size = res->call("get_size"); + int fmt = res->call("get_format"); _OSCoreBindImg img; img.size = size; img.fmt = fmt; - img.path = E->get_path(); + img.path = res->get_path(); img.vram = Image::get_image_data_size(img.size.width, img.size.height, Image::Format(img.fmt)); - img.id = E->get_instance_id(); + img.id = res->get_instance_id(); total += img.vram; imgs.push_back(img); } @@ -387,7 +387,7 @@ void _OS::print_resources_by_type(const Vector<String> &p_types) { List<Ref<Resource>> resources; ResourceCache::get_cached_resources(&resources); - for (Ref<Resource> r : resources) { + for (const Ref<Resource> &r : resources) { bool found = false; for (int i = 0; i < p_types.size(); i++) { diff --git a/core/os/main_loop.cpp b/core/os/main_loop.cpp index 016d9d0a09..3c0e56f5a8 100644 --- a/core/os/main_loop.cpp +++ b/core/os/main_loop.cpp @@ -66,7 +66,7 @@ void MainLoop::initialize() { } } -bool MainLoop::physics_process(float p_time) { +bool MainLoop::physics_process(double p_time) { if (get_script_instance()) { return get_script_instance()->call("_physics_process", p_time); } @@ -74,7 +74,7 @@ bool MainLoop::physics_process(float p_time) { return false; } -bool MainLoop::process(float p_time) { +bool MainLoop::process(double p_time) { if (get_script_instance()) { return get_script_instance()->call("_process", p_time); } diff --git a/core/os/main_loop.h b/core/os/main_loop.h index 34e944709b..b42e9b18ff 100644 --- a/core/os/main_loop.h +++ b/core/os/main_loop.h @@ -60,8 +60,8 @@ public: }; virtual void initialize(); - virtual bool physics_process(float p_time); - virtual bool process(float p_time); + virtual bool physics_process(double p_time); + virtual bool process(double p_time); virtual void finalize(); void set_initialize_script(const Ref<Script> &p_initialize_script); diff --git a/doc/classes/RDShaderFile.xml b/doc/classes/RDShaderFile.xml index 346a97a1c0..dab2b9822f 100644 --- a/doc/classes/RDShaderFile.xml +++ b/doc/classes/RDShaderFile.xml @@ -7,8 +7,8 @@ <tutorials> </tutorials> <methods> - <method name="get_bytecode" qualifiers="const"> - <return type="RDShaderBytecode"> + <method name="get_spirv" qualifiers="const"> + <return type="RDShaderSPIRV"> </return> <argument index="0" name="version" type="StringName" default="&"""> </argument> @@ -24,7 +24,7 @@ <method name="set_bytecode"> <return type="void"> </return> - <argument index="0" name="bytecode" type="RDShaderBytecode"> + <argument index="0" name="bytecode" type="RDShaderSPIRV"> </argument> <argument index="1" name="version" type="StringName" default="&"""> </argument> diff --git a/doc/classes/RDShaderBytecode.xml b/doc/classes/RDShaderSPIRV.xml index 20bf9bdd72..c9aefe31dc 100644 --- a/doc/classes/RDShaderBytecode.xml +++ b/doc/classes/RDShaderSPIRV.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="RDShaderBytecode" inherits="Resource" version="4.0"> +<class name="RDShaderSPIRV" inherits="Resource" version="4.0"> <brief_description> </brief_description> <description> diff --git a/doc/classes/RenderingDevice.xml b/doc/classes/RenderingDevice.xml index 901a985961..c73c2ddfd7 100644 --- a/doc/classes/RenderingDevice.xml +++ b/doc/classes/RenderingDevice.xml @@ -635,8 +635,16 @@ <description> </description> </method> - <method name="shader_compile_from_source"> - <return type="RDShaderBytecode"> + <method name="shader_compile_binary_from_spirv"> + <return type="PackedByteArray"> + </return> + <argument index="0" name="spirv_data" type="RDShaderSPIRV"> + </argument> + <description> + </description> + </method> + <method name="shader_compile_spirv_from_source"> + <return type="RDShaderSPIRV"> </return> <argument index="0" name="shader_source" type="RDShaderSource"> </argument> @@ -645,10 +653,18 @@ <description> </description> </method> - <method name="shader_create"> + <method name="shader_create_from_bytecode"> <return type="RID"> </return> - <argument index="0" name="shader_data" type="RDShaderBytecode"> + <argument index="0" name="binary_data" type="PackedByteArray"> + </argument> + <description> + </description> + </method> + <method name="shader_create_from_spirv"> + <return type="PackedByteArray"> + </return> + <argument index="0" name="spirv_data" type="RDShaderSPIRV"> </argument> <description> </description> diff --git a/drivers/vulkan/rendering_device_vulkan.cpp b/drivers/vulkan/rendering_device_vulkan.cpp index 8d3362c7aa..9ee2a28240 100644 --- a/drivers/vulkan/rendering_device_vulkan.cpp +++ b/drivers/vulkan/rendering_device_vulkan.cpp @@ -31,11 +31,14 @@ #include "rendering_device_vulkan.h" #include "core/config/project_settings.h" +#include "core/io/compression.h" #include "core/io/file_access.h" +#include "core/io/marshalls.h" #include "core/os/os.h" #include "core/templates/hashfuncs.h" #include "drivers/vulkan/vulkan_context.h" +#include "thirdparty/misc/smolv.h" #include "thirdparty/spirv-reflect/spirv_reflect.h" //#define FORCE_FULL_BARRIER @@ -4360,53 +4363,87 @@ bool RenderingDeviceVulkan::_uniform_add_binding(Vector<Vector<VkDescriptorSetLa } #endif -RID RenderingDeviceVulkan::shader_create(const Vector<ShaderStageData> &p_stages) { - //descriptor layouts - Vector<Vector<VkDescriptorSetLayoutBinding>> set_bindings; - Vector<Vector<UniformInfo>> uniform_info; - Shader::PushConstant push_constant; - push_constant.push_constant_size = 0; - push_constant.push_constants_vk_stage = 0; +#define SHADER_BINARY_VERSION 1 - uint32_t vertex_input_mask = 0; +String RenderingDeviceVulkan::shader_get_binary_cache_key() const { + return "Vulkan-SV" + itos(SHADER_BINARY_VERSION); +} - uint32_t fragment_outputs = 0; +struct RenderingDeviceVulkanShaderBinaryDataBinding { + uint32_t type; + uint32_t binding; + uint32_t stages; + uint32_t length; //size of arrays (in total elements), or ubos (in bytes * total elements) +}; - uint32_t stages_processed = 0; +struct RenderingDeviceVulkanShaderBinarySpecializationConstant { + uint32_t type; + uint32_t constant_id; + union { + uint32_t int_value; + float float_value; + bool bool_value; + }; + uint32_t stage_flags; +}; - Vector<Shader::SpecializationConstant> specialization_constants; +struct RenderingDeviceVulkanShaderBinaryData { + uint32_t vertex_input_mask; + uint32_t fragment_outputs; + uint32_t specialization_constant_count; + uint32_t is_compute; + uint32_t compute_local_size[3]; + uint32_t set_count; + uint32_t push_constant_size; + uint32_t push_constants_vk_stage; + uint32_t stage_count; +}; - bool is_compute = false; +Vector<uint8_t> RenderingDeviceVulkan::shader_compile_binary_from_spirv(const Vector<ShaderStageSPIRVData> &p_spirv) { + RenderingDeviceVulkanShaderBinaryData binary_data; + binary_data.vertex_input_mask = 0; + binary_data.fragment_outputs = 0; + binary_data.specialization_constant_count = 0; + binary_data.is_compute = 0; + binary_data.compute_local_size[0] = 0; + binary_data.compute_local_size[1] = 0; + binary_data.compute_local_size[2] = 0; + binary_data.set_count = 0; + binary_data.push_constant_size = 0; + binary_data.push_constants_vk_stage = 0; + + Vector<Vector<RenderingDeviceVulkanShaderBinaryDataBinding>> uniform_info; //set bindings + Vector<RenderingDeviceVulkanShaderBinarySpecializationConstant> specialization_constants; - uint32_t compute_local_size[3] = { 0, 0, 0 }; + uint32_t stages_processed = 0; - for (int i = 0; i < p_stages.size(); i++) { - if (p_stages[i].shader_stage == SHADER_STAGE_COMPUTE) { - is_compute = true; - ERR_FAIL_COND_V_MSG(p_stages.size() != 1, RID(), + for (int i = 0; i < p_spirv.size(); i++) { + if (p_spirv[i].shader_stage == SHADER_STAGE_COMPUTE) { + binary_data.is_compute = true; + ERR_FAIL_COND_V_MSG(p_spirv.size() != 1, Vector<uint8_t>(), "Compute shaders can only receive one stage, dedicated to compute."); } - ERR_FAIL_COND_V_MSG(stages_processed & (1 << p_stages[i].shader_stage), RID(), - "Stage " + String(shader_stage_names[p_stages[i].shader_stage]) + " submitted more than once."); + ERR_FAIL_COND_V_MSG(stages_processed & (1 << p_spirv[i].shader_stage), Vector<uint8_t>(), + "Stage " + String(shader_stage_names[p_spirv[i].shader_stage]) + " submitted more than once."); { SpvReflectShaderModule module; - const uint8_t *spirv = p_stages[i].spir_v.ptr(); - SpvReflectResult result = spvReflectCreateShaderModule(p_stages[i].spir_v.size(), spirv, &module); - ERR_FAIL_COND_V_MSG(result != SPV_REFLECT_RESULT_SUCCESS, RID(), - "Reflection of SPIR-V shader stage '" + String(shader_stage_names[p_stages[i].shader_stage]) + "' failed parsing shader."); - - if (is_compute) { - compute_local_size[0] = module.entry_points->local_size.x; - compute_local_size[1] = module.entry_points->local_size.y; - compute_local_size[2] = module.entry_points->local_size.z; + const uint8_t *spirv = p_spirv[i].spir_v.ptr(); + SpvReflectResult result = spvReflectCreateShaderModule(p_spirv[i].spir_v.size(), spirv, &module); + ERR_FAIL_COND_V_MSG(result != SPV_REFLECT_RESULT_SUCCESS, Vector<uint8_t>(), + "Reflection of SPIR-V shader stage '" + String(shader_stage_names[p_spirv[i].shader_stage]) + "' failed parsing shader."); + + if (binary_data.is_compute) { + binary_data.compute_local_size[0] = module.entry_points->local_size.x; + binary_data.compute_local_size[1] = module.entry_points->local_size.y; + binary_data.compute_local_size[2] = module.entry_points->local_size.z; } uint32_t binding_count = 0; result = spvReflectEnumerateDescriptorBindings(&module, &binding_count, nullptr); - ERR_FAIL_COND_V_MSG(result != SPV_REFLECT_RESULT_SUCCESS, RID(), - "Reflection of SPIR-V shader stage '" + String(shader_stage_names[p_stages[i].shader_stage]) + "' failed enumerating descriptor bindings."); + ERR_FAIL_COND_V_MSG(result != SPV_REFLECT_RESULT_SUCCESS, Vector<uint8_t>(), + "Reflection of SPIR-V shader stage '" + String(shader_stage_names[p_spirv[i].shader_stage]) + "' failed enumerating descriptor bindings."); - uint32_t stage = p_stages[i].shader_stage; + uint32_t stage = p_spirv[i].shader_stage; if (binding_count > 0) { //Parse bindings @@ -4415,56 +4452,47 @@ RID RenderingDeviceVulkan::shader_create(const Vector<ShaderStageData> &p_stages bindings.resize(binding_count); result = spvReflectEnumerateDescriptorBindings(&module, &binding_count, bindings.ptrw()); - ERR_FAIL_COND_V_MSG(result != SPV_REFLECT_RESULT_SUCCESS, RID(), - "Reflection of SPIR-V shader stage '" + String(shader_stage_names[p_stages[i].shader_stage]) + "' failed getting descriptor bindings."); + ERR_FAIL_COND_V_MSG(result != SPV_REFLECT_RESULT_SUCCESS, Vector<uint8_t>(), + "Reflection of SPIR-V shader stage '" + String(shader_stage_names[p_spirv[i].shader_stage]) + "' failed getting descriptor bindings."); for (uint32_t j = 0; j < binding_count; j++) { const SpvReflectDescriptorBinding &binding = *bindings[j]; - VkDescriptorSetLayoutBinding layout_binding; - UniformInfo info; + RenderingDeviceVulkanShaderBinaryDataBinding info; bool need_array_dimensions = false; bool need_block_size = false; switch (binding.descriptor_type) { case SPV_REFLECT_DESCRIPTOR_TYPE_SAMPLER: { - layout_binding.descriptorType = VK_DESCRIPTOR_TYPE_SAMPLER; info.type = UNIFORM_TYPE_SAMPLER; need_array_dimensions = true; } break; case SPV_REFLECT_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER: { - layout_binding.descriptorType = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER; info.type = UNIFORM_TYPE_SAMPLER_WITH_TEXTURE; need_array_dimensions = true; } break; case SPV_REFLECT_DESCRIPTOR_TYPE_SAMPLED_IMAGE: { - layout_binding.descriptorType = VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE; info.type = UNIFORM_TYPE_TEXTURE; need_array_dimensions = true; } break; case SPV_REFLECT_DESCRIPTOR_TYPE_STORAGE_IMAGE: { - layout_binding.descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_IMAGE; info.type = UNIFORM_TYPE_IMAGE; need_array_dimensions = true; } break; case SPV_REFLECT_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER: { - layout_binding.descriptorType = VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER; info.type = UNIFORM_TYPE_TEXTURE_BUFFER; need_array_dimensions = true; } break; case SPV_REFLECT_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER: { - layout_binding.descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER; info.type = UNIFORM_TYPE_IMAGE_BUFFER; need_array_dimensions = true; } break; case SPV_REFLECT_DESCRIPTOR_TYPE_UNIFORM_BUFFER: { - layout_binding.descriptorType = VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER; info.type = UNIFORM_TYPE_UNIFORM_BUFFER; need_block_size = true; } break; case SPV_REFLECT_DESCRIPTOR_TYPE_STORAGE_BUFFER: { - layout_binding.descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_BUFFER; info.type = UNIFORM_TYPE_STORAGE_BUFFER; need_block_size = true; } break; @@ -4477,7 +4505,6 @@ RID RenderingDeviceVulkan::shader_create(const Vector<ShaderStageData> &p_stages continue; } break; case SPV_REFLECT_DESCRIPTOR_TYPE_INPUT_ATTACHMENT: { - layout_binding.descriptorType = VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT; info.type = UNIFORM_TYPE_INPUT_ATTACHMENT; } break; case SPV_REFLECT_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_KHR: { @@ -4499,42 +4526,35 @@ RID RenderingDeviceVulkan::shader_create(const Vector<ShaderStageData> &p_stages } } - layout_binding.descriptorCount = info.length; - } else if (need_block_size) { info.length = binding.block.size; - layout_binding.descriptorCount = 1; } else { info.length = 0; - layout_binding.descriptorCount = 1; } info.binding = binding.binding; uint32_t set = binding.set; - //print_line("Stage: " + String(shader_stage_names[stage]) + " set=" + itos(set) + " binding=" + itos(info.binding) + " type=" + shader_uniform_names[info.type] + " length=" + itos(info.length)); - - ERR_FAIL_COND_V_MSG(set >= MAX_UNIFORM_SETS, RID(), + ERR_FAIL_COND_V_MSG(set >= MAX_UNIFORM_SETS, Vector<uint8_t>(), "On shader stage '" + String(shader_stage_names[stage]) + "', uniform '" + binding.name + "' uses a set (" + itos(set) + ") index larger than what is supported (" + itos(MAX_UNIFORM_SETS) + ")."); - ERR_FAIL_COND_V_MSG(set >= limits.maxBoundDescriptorSets, RID(), + ERR_FAIL_COND_V_MSG(set >= limits.maxBoundDescriptorSets, Vector<uint8_t>(), "On shader stage '" + String(shader_stage_names[stage]) + "', uniform '" + binding.name + "' uses a set (" + itos(set) + ") index larger than what is supported by the hardware (" + itos(limits.maxBoundDescriptorSets) + ")."); - if (set < (uint32_t)set_bindings.size()) { + if (set < (uint32_t)uniform_info.size()) { //check if this already exists bool exists = false; - for (int k = 0; k < set_bindings[set].size(); k++) { - if (set_bindings[set][k].binding == (uint32_t)info.binding) { + for (int k = 0; k < uniform_info[set].size(); k++) { + if (uniform_info[set][k].binding == (uint32_t)info.binding) { //already exists, verify that it's the same type - ERR_FAIL_COND_V_MSG(set_bindings[set][k].descriptorType != layout_binding.descriptorType, RID(), + ERR_FAIL_COND_V_MSG(uniform_info[set][k].type != info.type, Vector<uint8_t>(), "On shader stage '" + String(shader_stage_names[stage]) + "', uniform '" + binding.name + "' trying to re-use location for set=" + itos(set) + ", binding=" + itos(info.binding) + " with different uniform type."); //also, verify that it's the same size - ERR_FAIL_COND_V_MSG(set_bindings[set][k].descriptorCount != layout_binding.descriptorCount || uniform_info[set][k].length != info.length, RID(), + ERR_FAIL_COND_V_MSG(uniform_info[set][k].length != info.length, Vector<uint8_t>(), "On shader stage '" + String(shader_stage_names[stage]) + "', uniform '" + binding.name + "' trying to re-use location for set=" + itos(set) + ", binding=" + itos(info.binding) + " with different uniform size."); //just append stage mask and return - set_bindings.write[set].write[k].stageFlags |= shader_stage_masks[stage]; uniform_info.write[set].write[k].stages |= 1 << stage; exists = true; } @@ -4545,19 +4565,12 @@ RID RenderingDeviceVulkan::shader_create(const Vector<ShaderStageData> &p_stages } } - layout_binding.binding = info.binding; - layout_binding.stageFlags = shader_stage_masks[stage]; - layout_binding.pImmutableSamplers = nullptr; //no support for this yet - info.stages = 1 << stage; - info.binding = info.binding; - if (set >= (uint32_t)set_bindings.size()) { - set_bindings.resize(set + 1); + if (set >= (uint32_t)uniform_info.size()) { uniform_info.resize(set + 1); } - set_bindings.write[set].push_back(layout_binding); uniform_info.write[set].push_back(info); } } @@ -4567,41 +4580,41 @@ RID RenderingDeviceVulkan::shader_create(const Vector<ShaderStageData> &p_stages uint32_t sc_count = 0; result = spvReflectEnumerateSpecializationConstants(&module, &sc_count, nullptr); - ERR_FAIL_COND_V_MSG(result != SPV_REFLECT_RESULT_SUCCESS, RID(), - "Reflection of SPIR-V shader stage '" + String(shader_stage_names[p_stages[i].shader_stage]) + "' failed enumerating specialization constants."); + ERR_FAIL_COND_V_MSG(result != SPV_REFLECT_RESULT_SUCCESS, Vector<uint8_t>(), + "Reflection of SPIR-V shader stage '" + String(shader_stage_names[p_spirv[i].shader_stage]) + "' failed enumerating specialization constants."); if (sc_count) { Vector<SpvReflectSpecializationConstant *> spec_constants; spec_constants.resize(sc_count); result = spvReflectEnumerateSpecializationConstants(&module, &sc_count, spec_constants.ptrw()); - ERR_FAIL_COND_V_MSG(result != SPV_REFLECT_RESULT_SUCCESS, RID(), - "Reflection of SPIR-V shader stage '" + String(shader_stage_names[p_stages[i].shader_stage]) + "' failed obtaining specialization constants."); + ERR_FAIL_COND_V_MSG(result != SPV_REFLECT_RESULT_SUCCESS, Vector<uint8_t>(), + "Reflection of SPIR-V shader stage '" + String(shader_stage_names[p_spirv[i].shader_stage]) + "' failed obtaining specialization constants."); for (uint32_t j = 0; j < sc_count; j++) { int32_t existing = -1; - Shader::SpecializationConstant sconst; - sconst.constant.constant_id = spec_constants[j]->constant_id; + RenderingDeviceVulkanShaderBinarySpecializationConstant sconst; + sconst.constant_id = spec_constants[j]->constant_id; switch (spec_constants[j]->constant_type) { case SPV_REFLECT_SPECIALIZATION_CONSTANT_BOOL: { - sconst.constant.type = PIPELINE_SPECIALIZATION_CONSTANT_TYPE_BOOL; - sconst.constant.bool_value = spec_constants[j]->default_value.int_bool_value != 0; + sconst.type = PIPELINE_SPECIALIZATION_CONSTANT_TYPE_BOOL; + sconst.bool_value = spec_constants[j]->default_value.int_bool_value != 0; } break; case SPV_REFLECT_SPECIALIZATION_CONSTANT_INT: { - sconst.constant.type = PIPELINE_SPECIALIZATION_CONSTANT_TYPE_INT; - sconst.constant.int_value = spec_constants[j]->default_value.int_bool_value; + sconst.type = PIPELINE_SPECIALIZATION_CONSTANT_TYPE_INT; + sconst.int_value = spec_constants[j]->default_value.int_bool_value; } break; case SPV_REFLECT_SPECIALIZATION_CONSTANT_FLOAT: { - sconst.constant.type = PIPELINE_SPECIALIZATION_CONSTANT_TYPE_FLOAT; - sconst.constant.float_value = spec_constants[j]->default_value.float_value; + sconst.type = PIPELINE_SPECIALIZATION_CONSTANT_TYPE_FLOAT; + sconst.float_value = spec_constants[j]->default_value.float_value; } break; } - sconst.stage_flags = 1 << p_stages[i].shader_stage; + sconst.stage_flags = 1 << p_spirv[i].shader_stage; for (int k = 0; k < specialization_constants.size(); k++) { - if (specialization_constants[k].constant.constant_id == sconst.constant.constant_id) { - ERR_FAIL_COND_V_MSG(specialization_constants[k].constant.type != sconst.constant.type, RID(), "More than one specialization constant used for id (" + itos(sconst.constant.constant_id) + "), but their types differ."); - ERR_FAIL_COND_V_MSG(specialization_constants[k].constant.int_value != sconst.constant.int_value, RID(), "More than one specialization constant used for id (" + itos(sconst.constant.constant_id) + "), but their default values differ."); + if (specialization_constants[k].constant_id == sconst.constant_id) { + ERR_FAIL_COND_V_MSG(specialization_constants[k].type != sconst.type, Vector<uint8_t>(), "More than one specialization constant used for id (" + itos(sconst.constant_id) + "), but their types differ."); + ERR_FAIL_COND_V_MSG(specialization_constants[k].int_value != sconst.int_value, Vector<uint8_t>(), "More than one specialization constant used for id (" + itos(sconst.constant_id) + "), but their default values differ."); existing = k; break; } @@ -4619,20 +4632,20 @@ RID RenderingDeviceVulkan::shader_create(const Vector<ShaderStageData> &p_stages if (stage == SHADER_STAGE_VERTEX) { uint32_t iv_count = 0; result = spvReflectEnumerateInputVariables(&module, &iv_count, nullptr); - ERR_FAIL_COND_V_MSG(result != SPV_REFLECT_RESULT_SUCCESS, RID(), - "Reflection of SPIR-V shader stage '" + String(shader_stage_names[p_stages[i].shader_stage]) + "' failed enumerating input variables."); + ERR_FAIL_COND_V_MSG(result != SPV_REFLECT_RESULT_SUCCESS, Vector<uint8_t>(), + "Reflection of SPIR-V shader stage '" + String(shader_stage_names[p_spirv[i].shader_stage]) + "' failed enumerating input variables."); if (iv_count) { Vector<SpvReflectInterfaceVariable *> input_vars; input_vars.resize(iv_count); result = spvReflectEnumerateInputVariables(&module, &iv_count, input_vars.ptrw()); - ERR_FAIL_COND_V_MSG(result != SPV_REFLECT_RESULT_SUCCESS, RID(), - "Reflection of SPIR-V shader stage '" + String(shader_stage_names[p_stages[i].shader_stage]) + "' failed obtaining input variables."); + ERR_FAIL_COND_V_MSG(result != SPV_REFLECT_RESULT_SUCCESS, Vector<uint8_t>(), + "Reflection of SPIR-V shader stage '" + String(shader_stage_names[p_spirv[i].shader_stage]) + "' failed obtaining input variables."); for (uint32_t j = 0; j < iv_count; j++) { if (input_vars[j] && input_vars[j]->decoration_flags == 0) { //regular input - vertex_input_mask |= (1 << uint32_t(input_vars[j]->location)); + binary_data.vertex_input_mask |= (1 << uint32_t(input_vars[j]->location)); } } } @@ -4641,21 +4654,21 @@ RID RenderingDeviceVulkan::shader_create(const Vector<ShaderStageData> &p_stages if (stage == SHADER_STAGE_FRAGMENT) { uint32_t ov_count = 0; result = spvReflectEnumerateOutputVariables(&module, &ov_count, nullptr); - ERR_FAIL_COND_V_MSG(result != SPV_REFLECT_RESULT_SUCCESS, RID(), - "Reflection of SPIR-V shader stage '" + String(shader_stage_names[p_stages[i].shader_stage]) + "' failed enumerating output variables."); + ERR_FAIL_COND_V_MSG(result != SPV_REFLECT_RESULT_SUCCESS, Vector<uint8_t>(), + "Reflection of SPIR-V shader stage '" + String(shader_stage_names[p_spirv[i].shader_stage]) + "' failed enumerating output variables."); if (ov_count) { Vector<SpvReflectInterfaceVariable *> output_vars; output_vars.resize(ov_count); result = spvReflectEnumerateOutputVariables(&module, &ov_count, output_vars.ptrw()); - ERR_FAIL_COND_V_MSG(result != SPV_REFLECT_RESULT_SUCCESS, RID(), - "Reflection of SPIR-V shader stage '" + String(shader_stage_names[p_stages[i].shader_stage]) + "' failed obtaining output variables."); + ERR_FAIL_COND_V_MSG(result != SPV_REFLECT_RESULT_SUCCESS, Vector<uint8_t>(), + "Reflection of SPIR-V shader stage '" + String(shader_stage_names[p_spirv[i].shader_stage]) + "' failed obtaining output variables."); for (uint32_t j = 0; j < ov_count; j++) { const SpvReflectInterfaceVariable *refvar = output_vars[j]; if (refvar != nullptr && refvar->built_in != SpvBuiltInFragDepth) { - fragment_outputs |= 1 << refvar->location; + binary_data.fragment_outputs |= 1 << refvar->location; } } } @@ -4663,18 +4676,18 @@ RID RenderingDeviceVulkan::shader_create(const Vector<ShaderStageData> &p_stages uint32_t pc_count = 0; result = spvReflectEnumeratePushConstantBlocks(&module, &pc_count, nullptr); - ERR_FAIL_COND_V_MSG(result != SPV_REFLECT_RESULT_SUCCESS, RID(), - "Reflection of SPIR-V shader stage '" + String(shader_stage_names[p_stages[i].shader_stage]) + "' failed enumerating push constants."); + ERR_FAIL_COND_V_MSG(result != SPV_REFLECT_RESULT_SUCCESS, Vector<uint8_t>(), + "Reflection of SPIR-V shader stage '" + String(shader_stage_names[p_spirv[i].shader_stage]) + "' failed enumerating push constants."); if (pc_count) { - ERR_FAIL_COND_V_MSG(pc_count > 1, RID(), - "Reflection of SPIR-V shader stage '" + String(shader_stage_names[p_stages[i].shader_stage]) + "': Only one push constant is supported, which should be the same across shader stages."); + ERR_FAIL_COND_V_MSG(pc_count > 1, Vector<uint8_t>(), + "Reflection of SPIR-V shader stage '" + String(shader_stage_names[p_spirv[i].shader_stage]) + "': Only one push constant is supported, which should be the same across shader stages."); Vector<SpvReflectBlockVariable *> pconstants; pconstants.resize(pc_count); result = spvReflectEnumeratePushConstantBlocks(&module, &pc_count, pconstants.ptrw()); - ERR_FAIL_COND_V_MSG(result != SPV_REFLECT_RESULT_SUCCESS, RID(), - "Reflection of SPIR-V shader stage '" + String(shader_stage_names[p_stages[i].shader_stage]) + "' failed obtaining push constants."); + ERR_FAIL_COND_V_MSG(result != SPV_REFLECT_RESULT_SUCCESS, Vector<uint8_t>(), + "Reflection of SPIR-V shader stage '" + String(shader_stage_names[p_spirv[i].shader_stage]) + "' failed obtaining push constants."); #if 0 if (pconstants[0] == nullptr) { FileAccess *f = FileAccess::open("res://popo.spv", FileAccess::WRITE); @@ -4683,11 +4696,11 @@ RID RenderingDeviceVulkan::shader_create(const Vector<ShaderStageData> &p_stages } #endif - ERR_FAIL_COND_V_MSG(push_constant.push_constant_size && push_constant.push_constant_size != pconstants[0]->size, RID(), - "Reflection of SPIR-V shader stage '" + String(shader_stage_names[p_stages[i].shader_stage]) + "': Push constant block must be the same across shader stages."); + ERR_FAIL_COND_V_MSG(binary_data.push_constant_size && binary_data.push_constant_size != pconstants[0]->size, Vector<uint8_t>(), + "Reflection of SPIR-V shader stage '" + String(shader_stage_names[p_spirv[i].shader_stage]) + "': Push constant block must be the same across shader stages."); - push_constant.push_constant_size = pconstants[0]->size; - push_constant.push_constants_vk_stage |= shader_stage_masks[stage]; + binary_data.push_constant_size = pconstants[0]->size; + binary_data.push_constants_vk_stage |= shader_stage_masks[stage]; //print_line("Stage: " + String(shader_stage_names[stage]) + " push constant of size=" + itos(push_constant.push_constant_size)); } @@ -4696,9 +4709,291 @@ RID RenderingDeviceVulkan::shader_create(const Vector<ShaderStageData> &p_stages spvReflectDestroyShaderModule(&module); } - stages_processed |= (1 << p_stages[i].shader_stage); + stages_processed |= (1 << p_spirv[i].shader_stage); + } + + Vector<Vector<uint8_t>> compressed_stages; + Vector<uint32_t> smolv_size; + Vector<uint32_t> zstd_size; //if 0, stdno t used + + uint32_t stages_binary_size = 0; + + bool strip_debug = false; + + for (int i = 0; i < p_spirv.size(); i++) { + smolv::ByteArray smolv; + if (!smolv::Encode(p_spirv[i].spir_v.ptr(), p_spirv[i].spir_v.size(), smolv, strip_debug ? smolv::kEncodeFlagStripDebugInfo : 0)) { + ERR_FAIL_V_MSG(Vector<uint8_t>(), "Error compressing shader stage :" + String(shader_stage_names[p_spirv[i].shader_stage])); + } else { + smolv_size.push_back(smolv.size()); + { //zstd + Vector<uint8_t> zstd; + zstd.resize(Compression::get_max_compressed_buffer_size(smolv.size(), Compression::MODE_ZSTD)); + int dst_size = Compression::compress(zstd.ptrw(), &smolv[0], smolv.size(), Compression::MODE_ZSTD); + + if (dst_size > 0 && (uint32_t)dst_size < smolv.size()) { + zstd_size.push_back(dst_size); + zstd.resize(dst_size); + compressed_stages.push_back(zstd); + } else { + Vector<uint8_t> smv; + smv.resize(smolv.size()); + memcpy(smv.ptrw(), &smolv[0], smolv.size()); + zstd_size.push_back(0); //not using zstd + compressed_stages.push_back(smv); + } + } + } + uint32_t s = compressed_stages[i].size(); + if (s % 4 != 0) { + s += 4 - (s % 4); + } + stages_binary_size += s; + } + + binary_data.specialization_constant_count = specialization_constants.size(); + binary_data.set_count = uniform_info.size(); + binary_data.stage_count = p_spirv.size(); + + uint32_t total_size = sizeof(uint32_t) * 3; //header + version + main datasize; + total_size += sizeof(RenderingDeviceVulkanShaderBinaryData); + + for (int i = 0; i < uniform_info.size(); i++) { + total_size += sizeof(uint32_t); + total_size += uniform_info[i].size() * sizeof(RenderingDeviceVulkanShaderBinaryDataBinding); + } + + total_size += sizeof(RenderingDeviceVulkanShaderBinarySpecializationConstant) * specialization_constants.size(); + + total_size += compressed_stages.size() * sizeof(uint32_t) * 3; //sizes + total_size += stages_binary_size; + + Vector<uint8_t> ret; + ret.resize(total_size); + uint32_t offset = 0; + { + uint8_t *binptr = ret.ptrw(); + binptr[0] = 'G'; + binptr[1] = 'V'; + binptr[2] = 'B'; + binptr[3] = 'D'; //godot vulkan binary data + offset += 4; + encode_uint32(SHADER_BINARY_VERSION, binptr + offset); + offset += sizeof(uint32_t); + encode_uint32(sizeof(RenderingDeviceVulkanShaderBinaryData), binptr + offset); + offset += sizeof(uint32_t); + memcpy(binptr + offset, &binary_data, sizeof(RenderingDeviceVulkanShaderBinaryData)); + offset += sizeof(RenderingDeviceVulkanShaderBinaryData); + + for (int i = 0; i < uniform_info.size(); i++) { + int count = uniform_info[i].size(); + encode_uint32(count, binptr + offset); + offset += sizeof(uint32_t); + if (count > 0) { + memcpy(binptr + offset, uniform_info[i].ptr(), sizeof(RenderingDeviceVulkanShaderBinaryDataBinding) * count); + offset += sizeof(RenderingDeviceVulkanShaderBinaryDataBinding) * count; + } + } + + if (specialization_constants.size()) { + memcpy(binptr + offset, specialization_constants.ptr(), sizeof(RenderingDeviceVulkanShaderBinarySpecializationConstant) * specialization_constants.size()); + offset += sizeof(RenderingDeviceVulkanShaderBinarySpecializationConstant) * specialization_constants.size(); + } + + for (int i = 0; i < compressed_stages.size(); i++) { + encode_uint32(p_spirv[i].shader_stage, binptr + offset); + offset += sizeof(uint32_t); + encode_uint32(smolv_size[i], binptr + offset); + offset += sizeof(uint32_t); + encode_uint32(zstd_size[i], binptr + offset); + offset += sizeof(uint32_t); + memcpy(binptr + offset, compressed_stages[i].ptr(), compressed_stages[i].size()); + + uint32_t s = compressed_stages[i].size(); + + if (s % 4 != 0) { + s += 4 - (s % 4); + } + + offset += s; + } + + ERR_FAIL_COND_V(offset != (uint32_t)ret.size(), Vector<uint8_t>()); } + return ret; +} + +RID RenderingDeviceVulkan::shader_create_from_bytecode(const Vector<uint8_t> &p_shader_binary) { + const uint8_t *binptr = p_shader_binary.ptr(); + uint32_t binsize = p_shader_binary.size(); + + uint32_t read_offset = 0; + //consistency check + ERR_FAIL_COND_V(binsize < sizeof(uint32_t) * 3 + sizeof(RenderingDeviceVulkanShaderBinaryData), RID()); + ERR_FAIL_COND_V(binptr[0] != 'G' || binptr[1] != 'V' || binptr[2] != 'B' || binptr[3] != 'D', RID()); + + uint32_t bin_version = decode_uint32(binptr + 4); + ERR_FAIL_COND_V(bin_version > SHADER_BINARY_VERSION, RID()); + + uint32_t bin_data_size = decode_uint32(binptr + 8); + + const RenderingDeviceVulkanShaderBinaryData &binary_data = *(const RenderingDeviceVulkanShaderBinaryData *)(binptr + 12); + + Shader::PushConstant push_constant; + push_constant.push_constant_size = binary_data.push_constant_size; + push_constant.push_constants_vk_stage = binary_data.push_constants_vk_stage; + + uint32_t vertex_input_mask = binary_data.vertex_input_mask; + + uint32_t fragment_outputs = binary_data.fragment_outputs; + + bool is_compute = binary_data.is_compute; + + uint32_t compute_local_size[3] = { binary_data.compute_local_size[0], binary_data.compute_local_size[1], binary_data.compute_local_size[2] }; + + read_offset += sizeof(uint32_t) * 3 + bin_data_size; + + Vector<Vector<VkDescriptorSetLayoutBinding>> set_bindings; + Vector<Vector<UniformInfo>> uniform_info; + + set_bindings.resize(binary_data.set_count); + uniform_info.resize(binary_data.set_count); + + for (uint32_t i = 0; i < binary_data.set_count; i++) { + ERR_FAIL_COND_V(read_offset + sizeof(uint32_t) >= binsize, RID()); + uint32_t set_count = decode_uint32(binptr + read_offset); + read_offset += sizeof(uint32_t); + const RenderingDeviceVulkanShaderBinaryDataBinding *set_ptr = (const RenderingDeviceVulkanShaderBinaryDataBinding *)(binptr + read_offset); + uint32_t set_size = set_count * sizeof(RenderingDeviceVulkanShaderBinaryDataBinding); + ERR_FAIL_COND_V(read_offset + set_size >= binsize, RID()); + + for (uint32_t j = 0; j < set_count; j++) { + UniformInfo info; + info.type = UniformType(set_ptr[j].type); + info.length = set_ptr[j].length; + info.binding = set_ptr[j].binding; + info.stages = set_ptr[j].stages; + + VkDescriptorSetLayoutBinding layout_binding; + layout_binding.pImmutableSamplers = nullptr; + layout_binding.binding = set_ptr[j].binding; + layout_binding.descriptorCount = 1; + layout_binding.stageFlags = 0; + for (uint32_t k = 0; k < SHADER_STAGE_MAX; k++) { + if (set_ptr[j].stages & (1 << k)) { + layout_binding.stageFlags |= shader_stage_masks[k]; + } + } + + switch (info.type) { + case UNIFORM_TYPE_SAMPLER: { + layout_binding.descriptorType = VK_DESCRIPTOR_TYPE_SAMPLER; + layout_binding.descriptorCount = set_ptr[j].length; + } break; + case UNIFORM_TYPE_SAMPLER_WITH_TEXTURE: { + layout_binding.descriptorType = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER; + layout_binding.descriptorCount = set_ptr[j].length; + } break; + case UNIFORM_TYPE_TEXTURE: { + layout_binding.descriptorType = VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE; + layout_binding.descriptorCount = set_ptr[j].length; + } break; + case UNIFORM_TYPE_IMAGE: { + layout_binding.descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_IMAGE; + layout_binding.descriptorCount = set_ptr[j].length; + } break; + case UNIFORM_TYPE_TEXTURE_BUFFER: { + layout_binding.descriptorType = VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER; + layout_binding.descriptorCount = set_ptr[j].length; + } break; + case UNIFORM_TYPE_IMAGE_BUFFER: { + layout_binding.descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER; + } break; + case UNIFORM_TYPE_UNIFORM_BUFFER: { + layout_binding.descriptorType = VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER; + } break; + case UNIFORM_TYPE_STORAGE_BUFFER: { + layout_binding.descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_BUFFER; + } break; + case UNIFORM_TYPE_INPUT_ATTACHMENT: { + layout_binding.descriptorType = VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT; + } break; + default: { + ERR_FAIL_V(RID()); + } + } + + set_bindings.write[i].push_back(layout_binding); + uniform_info.write[i].push_back(info); + } + + read_offset += set_size; + } + + ERR_FAIL_COND_V(read_offset + binary_data.specialization_constant_count * sizeof(RenderingDeviceVulkanShaderBinarySpecializationConstant) >= binsize, RID()); + + Vector<Shader::SpecializationConstant> specialization_constants; + + for (uint32_t i = 0; i < binary_data.specialization_constant_count; i++) { + const RenderingDeviceVulkanShaderBinarySpecializationConstant &src_sc = *(const RenderingDeviceVulkanShaderBinarySpecializationConstant *)(binptr + read_offset); + Shader::SpecializationConstant sc; + sc.constant.int_value = src_sc.int_value; + sc.constant.type = PipelineSpecializationConstantType(src_sc.type); + sc.constant.constant_id = src_sc.constant_id; + sc.stage_flags = src_sc.stage_flags; + specialization_constants.push_back(sc); + + read_offset += sizeof(RenderingDeviceVulkanShaderBinarySpecializationConstant); + } + + Vector<Vector<uint8_t>> stage_spirv_data; + Vector<ShaderStage> stage_type; + + for (uint32_t i = 0; i < binary_data.stage_count; i++) { + ERR_FAIL_COND_V(read_offset + sizeof(uint32_t) * 3 >= binsize, RID()); + uint32_t stage = decode_uint32(binptr + read_offset); + read_offset += sizeof(uint32_t); + uint32_t smolv_size = decode_uint32(binptr + read_offset); + read_offset += sizeof(uint32_t); + uint32_t zstd_size = decode_uint32(binptr + read_offset); + read_offset += sizeof(uint32_t); + + uint32_t buf_size = (zstd_size > 0) ? zstd_size : smolv_size; + + Vector<uint8_t> smolv; + const uint8_t *src_smolv = nullptr; + + if (zstd_size > 0) { + //decompress to smolv + smolv.resize(smolv_size); + int dec_smolv_size = Compression::decompress(smolv.ptrw(), smolv.size(), binptr + read_offset, zstd_size, Compression::MODE_ZSTD); + ERR_FAIL_COND_V(dec_smolv_size != (int32_t)smolv_size, RID()); + src_smolv = smolv.ptr(); + } else { + src_smolv = binptr + read_offset; + } + + Vector<uint8_t> spirv; + uint32_t spirv_size = smolv::GetDecodedBufferSize(src_smolv, smolv_size); + spirv.resize(spirv_size); + if (!smolv::Decode(src_smolv, smolv_size, spirv.ptrw(), spirv_size)) { + ERR_FAIL_V_MSG(RID(), "Malformed smolv input uncompressing shader stage:" + String(shader_stage_names[stage])); + } + stage_spirv_data.push_back(spirv); + stage_type.push_back(ShaderStage(stage)); + + if (buf_size % 4 != 0) { + buf_size += 4 - (buf_size % 4); + } + + ERR_FAIL_COND_V(read_offset + buf_size > binsize, RID()); + + read_offset += buf_size; + } + + ERR_FAIL_COND_V(read_offset != binsize, RID()); + //all good, let's create modules _THREAD_SAFE_METHOD_ @@ -4717,13 +5012,13 @@ RID RenderingDeviceVulkan::shader_create(const Vector<ShaderStageData> &p_stages String error_text; bool success = true; - for (int i = 0; i < p_stages.size(); i++) { + for (int i = 0; i < stage_spirv_data.size(); i++) { VkShaderModuleCreateInfo shader_module_create_info; shader_module_create_info.sType = VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO; shader_module_create_info.pNext = nullptr; shader_module_create_info.flags = 0; - shader_module_create_info.codeSize = p_stages[i].spir_v.size(); - const uint8_t *r = p_stages[i].spir_v.ptr(); + shader_module_create_info.codeSize = stage_spirv_data[i].size(); + const uint8_t *r = stage_spirv_data[i].ptr(); shader_module_create_info.pCode = (const uint32_t *)r; @@ -4731,7 +5026,7 @@ RID RenderingDeviceVulkan::shader_create(const Vector<ShaderStageData> &p_stages VkResult res = vkCreateShaderModule(device, &shader_module_create_info, nullptr, &module); if (res) { success = false; - error_text = "Error (" + itos(res) + ") creating shader module for stage: " + String(shader_stage_names[p_stages[i].shader_stage]); + error_text = "Error (" + itos(res) + ") creating shader module for stage: " + String(shader_stage_names[stage_type[i]]); break; } @@ -4747,7 +5042,7 @@ RID RenderingDeviceVulkan::shader_create(const Vector<ShaderStageData> &p_stages shader_stage.sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO; shader_stage.pNext = nullptr; shader_stage.flags = 0; - shader_stage.stage = shader_stage_bits[p_stages[i].shader_stage]; + shader_stage.stage = shader_stage_bits[stage_type[i]]; shader_stage.module = module; shader_stage.pName = "main"; shader_stage.pSpecializationInfo = nullptr; diff --git a/drivers/vulkan/rendering_device_vulkan.h b/drivers/vulkan/rendering_device_vulkan.h index 3b3582eaa3..f9ff61310a 100644 --- a/drivers/vulkan/rendering_device_vulkan.h +++ b/drivers/vulkan/rendering_device_vulkan.h @@ -1083,7 +1083,11 @@ public: /**** SHADER ****/ /****************/ - virtual RID shader_create(const Vector<ShaderStageData> &p_stages); + virtual String shader_get_binary_cache_key() const; + virtual Vector<uint8_t> shader_compile_binary_from_spirv(const Vector<ShaderStageSPIRVData> &p_spirv); + + virtual RID shader_create_from_bytecode(const Vector<uint8_t> &p_shader_binary); + virtual uint32_t shader_get_vertex_input_attribute_mask(RID p_shader); /*****************/ diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp index cdbe505441..3db03c0276 100644 --- a/editor/editor_inspector.cpp +++ b/editor/editor_inspector.cpp @@ -1648,7 +1648,7 @@ void EditorInspector::update_tree() { Color sscolor = get_theme_color(SNAME("prop_subsection"), SNAME("Editor")); - for (Ref<EditorInspectorPlugin> ped : valid_plugins) { + for (Ref<EditorInspectorPlugin> &ped : valid_plugins) { ped->parse_begin(object); _parse_added_editors(main_vbox, ped); } @@ -1745,7 +1745,7 @@ void EditorInspector::update_tree() { category->set_tooltip(p.name + "::" + (class_descr_cache[type2] == "" ? "" : class_descr_cache[type2])); } - for (Ref<EditorInspectorPlugin> ped : valid_plugins) { + for (Ref<EditorInspectorPlugin> &ped : valid_plugins) { ped->parse_category(object, p.name); _parse_added_editors(main_vbox, ped); } @@ -1946,7 +1946,7 @@ void EditorInspector::update_tree() { doc_hint = descr; } - for (Ref<EditorInspectorPlugin> ped : valid_plugins) { + for (Ref<EditorInspectorPlugin> &ped : valid_plugins) { bool exclusive = ped->parse_property(object, p.type, p.name, p.hint, p.hint_string, p.usage, wide_editors); List<EditorInspectorPlugin::AddedEditor> editors = ped->added_editors; //make a copy, since plugins may be used again in a sub-inspector @@ -2028,7 +2028,7 @@ void EditorInspector::update_tree() { } } - for (Ref<EditorInspectorPlugin> ped : valid_plugins) { + for (Ref<EditorInspectorPlugin> &ped : valid_plugins) { ped->parse_end(); _parse_added_editors(main_vbox, ped); } @@ -2595,7 +2595,7 @@ void EditorInspector::_update_script_class_properties(const Object &p_object, Li } Set<StringName> added; - for (Ref<Script> s : classes) { + for (const Ref<Script> &s : classes) { String path = s->get_path(); String name = EditorNode::get_editor_data().script_class_get_name(path); if (name.is_empty()) { diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 267854d7ec..46d76a946f 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -797,8 +797,8 @@ void EditorNode::_resources_changed(const Vector<String> &p_resources) { } if (changed.size()) { - for (Ref<Resource> E : changed) { - E->reload_from_file(); + for (Ref<Resource> &res : changed) { + res->reload_from_file(); } } } @@ -1551,7 +1551,7 @@ int EditorNode::_save_external_resources() { int saved = 0; List<Ref<Resource>> cached; ResourceCache::get_cached_resources(&cached); - for (Ref<Resource> res : cached) { + for (const Ref<Resource> &res : cached) { if (!res->get_path().is_resource_file()) { continue; } @@ -1641,7 +1641,7 @@ void EditorNode::_save_scene(String p_file, int idx) { editor_data.save_editor_external_data(); - for (Ref<AnimatedValuesBackup> E : anim_backups) { + for (Ref<AnimatedValuesBackup> &E : anim_backups) { E->restore(); } @@ -5333,27 +5333,6 @@ void EditorNode::_file_access_close_error_notify(const String &p_str) { } void EditorNode::reload_scene(const String &p_path) { - /* - * No longer necessary since scenes now reset and reload their internal resource if needed. - //first of all, reload internal textures, materials, meshes, etc. as they might have changed on disk - - List<Ref<Resource>> cached; - ResourceCache::get_cached_resources(&cached); - List<Ref<Resource>> to_clear; //clear internal resources from previous scene from being used - for (Ref<Resource> E : cached) { - if (E->get_path().begins_with(p_path + "::")) { //subresources of existing scene - to_clear.push_back(E); - } - } - - //so reload reloads everything, clear subresources of previous scene - while (to_clear.front()) { - to_clear.front()->get()->set_path(""); - to_clear.pop_front(); - } - - */ - int scene_idx = -1; for (int i = 0; i < editor_data.get_edited_scene_count(); i++) { if (editor_data.get_scene_path(i) == p_path) { diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp index a52b14643e..df4469b6fe 100644 --- a/editor/editor_settings.cpp +++ b/editor/editor_settings.cpp @@ -1580,7 +1580,7 @@ void EditorSettings::set_builtin_action_override(const String &p_name, const Arr int event_idx = 0; // Check equality of each event. - for (Ref<InputEvent> E : builtin_events) { + for (const Ref<InputEvent> &E : builtin_events) { if (!E->is_match(p_events[event_idx])) { same_as_builtin = false; break; @@ -1610,7 +1610,7 @@ const Array EditorSettings::get_builtin_action_overrides(const String &p_name) c Array event_array; List<Ref<InputEvent>> events_list = AO->get(); - for (Ref<InputEvent> E : events_list) { + for (const Ref<InputEvent> &E : events_list) { event_array.push_back(E); } return event_array; diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp index dbbbb03864..daee61c2dd 100644 --- a/editor/filesystem_dock.cpp +++ b/editor/filesystem_dock.cpp @@ -1237,7 +1237,7 @@ void FileSystemDock::_update_resource_paths_after_move(const Map<String, String> List<Ref<Resource>> cached; ResourceCache::get_cached_resources(&cached); - for (Ref<Resource> r : cached) { + for (Ref<Resource> &r : cached) { String base_path = r->get_path(); String extra_path; int sep_pos = r->get_path().find("::"); diff --git a/editor/import/resource_importer_obj.cpp b/editor/import/resource_importer_obj.cpp index 8b6bd8066f..34bc0a7d8d 100644 --- a/editor/import/resource_importer_obj.cpp +++ b/editor/import/resource_importer_obj.cpp @@ -438,7 +438,7 @@ Node *EditorOBJImporter::import_scene(const String &p_path, uint32_t p_flags, in Node3D *scene = memnew(Node3D); - for (Ref<Mesh> m : meshes) { + for (const Ref<Mesh> &m : meshes) { Ref<EditorSceneImporterMesh> mesh; mesh.instantiate(); for (int i = 0; i < m->get_surface_count(); i++) { diff --git a/editor/import_defaults_editor.cpp b/editor/import_defaults_editor.cpp index 7c06ef4516..25bca1d4f4 100644 --- a/editor/import_defaults_editor.cpp +++ b/editor/import_defaults_editor.cpp @@ -106,7 +106,7 @@ void ImportDefaultsEditor::_update_importer() { List<Ref<ResourceImporter>> importer_list; ResourceFormatImporter::get_singleton()->get_importers(&importer_list); Ref<ResourceImporter> importer; - for (Ref<ResourceImporter> E : importer_list) { + for (const Ref<ResourceImporter> &E : importer_list) { if (E->get_visible_name() == importers->get_item_text(importers->get_selected())) { importer = E; break; @@ -166,7 +166,7 @@ void ImportDefaultsEditor::clear() { List<Ref<ResourceImporter>> importer_list; ResourceFormatImporter::get_singleton()->get_importers(&importer_list); Vector<String> names; - for (Ref<ResourceImporter> E : importer_list) { + for (const Ref<ResourceImporter> &E : importer_list) { String vn = E->get_visible_name(); names.push_back(vn); } diff --git a/editor/import_dock.cpp b/editor/import_dock.cpp index 1f8fefbe6e..648e60a554 100644 --- a/editor/import_dock.cpp +++ b/editor/import_dock.cpp @@ -111,7 +111,7 @@ void ImportDock::set_edit_path(const String &p_path) { ResourceFormatImporter::get_singleton()->get_importers_for_extension(p_path.get_extension(), &importers); List<Pair<String, String>> importer_names; - for (Ref<ResourceImporter> E : importers) { + for (const Ref<ResourceImporter> &E : importers) { importer_names.push_back(Pair<String, String>(E->get_visible_name(), E->get_importer_name())); } @@ -254,7 +254,7 @@ void ImportDock::set_edit_multiple_paths(const Vector<String> &p_paths) { ResourceFormatImporter::get_singleton()->get_importers_for_extension(p_paths[0].get_extension(), &importers); List<Pair<String, String>> importer_names; - for (Ref<ResourceImporter> E : importers) { + for (const Ref<ResourceImporter> &E : importers) { importer_names.push_back(Pair<String, String>(E->get_visible_name(), E->get_importer_name())); } diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp index 6b6f5e7bc6..b7651c350c 100644 --- a/editor/plugins/node_3d_editor_plugin.cpp +++ b/editor/plugins/node_3d_editor_plugin.cpp @@ -3782,63 +3782,16 @@ Vector3 Node3DEditorViewport::_get_instance_position(const Point2 &p_pos) const Vector3 world_ray = _get_ray(p_pos); Vector3 world_pos = _get_ray_pos(p_pos); - Vector<ObjectID> instances = RenderingServer::get_singleton()->instances_cull_ray(world_pos, world_ray, get_tree()->get_root()->get_world_3d()->get_scenario()); - Set<Ref<EditorNode3DGizmo>> found_gizmos; - - float closest_dist = MAX_DISTANCE; - Vector3 point = world_pos + world_ray * MAX_DISTANCE; - Vector3 normal = Vector3(0.0, 0.0, 0.0); - - for (int i = 0; i < instances.size(); i++) { - MeshInstance3D *mesh_instance = Object::cast_to<MeshInstance3D>(ObjectDB::get_instance(instances[i])); - - if (!mesh_instance) { - continue; - } - - Vector<Ref<Node3DGizmo>> gizmos = mesh_instance->get_gizmos(); - - for (int j = 0; j < gizmos.size(); j++) { - Ref<EditorNode3DGizmo> seg = gizmos[j]; - - if ((!seg.is_valid()) || found_gizmos.has(seg)) { - continue; - } - - found_gizmos.insert(seg); - Vector3 hit_point; - Vector3 hit_normal; - bool inters = seg->intersect_ray(camera, p_pos, hit_point, hit_normal); - - if (!inters) { - continue; - } - - float dist = world_pos.distance_to(hit_point); - - if (dist < 0) { - continue; - } + PhysicsDirectSpaceState3D *ss = get_tree()->get_root()->get_world_3d()->get_direct_space_state(); + PhysicsDirectSpaceState3D::RayResult result; - if (dist < closest_dist) { - closest_dist = dist; - point = hit_point; - normal = hit_normal; - } - } + if (ss->intersect_ray(world_pos, world_pos + world_ray * MAX_DISTANCE, result)) { + point = result.position; } - Vector3 offset = Vector3(); - for (int i = 0; i < 3; i++) { - if (normal[i] > 0.0) { - offset[i] = (preview_bounds->get_size()[i] - (preview_bounds->get_size()[i] + preview_bounds->get_position()[i])); - } else if (normal[i] < 0.0) { - offset[i] = -(preview_bounds->get_size()[i] + preview_bounds->get_position()[i]); - } - } - return point + offset; + return point; } AABB Node3DEditorViewport::_calculate_spatial_bounds(const Node3D *p_parent, bool p_exclude_top_level_transform) { diff --git a/editor/plugins/shader_file_editor_plugin.cpp b/editor/plugins/shader_file_editor_plugin.cpp index 66d2b36be1..1e62261244 100644 --- a/editor/plugins/shader_file_editor_plugin.cpp +++ b/editor/plugins/shader_file_editor_plugin.cpp @@ -55,7 +55,7 @@ void ShaderFileEditor::_version_selected(int p_option) { RD::ShaderStage stage = RD::SHADER_STAGE_MAX; int first_found = -1; - Ref<RDShaderBytecode> bytecode = shader_file->get_bytecode(version_txt); + Ref<RDShaderSPIRV> bytecode = shader_file->get_spirv(version_txt); ERR_FAIL_COND(bytecode.is_null()); for (int i = 0; i < RD::SHADER_STAGE_MAX; i++) { @@ -142,7 +142,7 @@ void ShaderFileEditor::_update_options() { Ref<Texture2D> icon; - Ref<RDShaderBytecode> bytecode = shader_file->get_bytecode(version_list[i]); + Ref<RDShaderSPIRV> bytecode = shader_file->get_spirv(version_list[i]); ERR_FAIL_COND(bytecode.is_null()); bool failed = false; @@ -175,7 +175,7 @@ void ShaderFileEditor::_update_options() { return; } - Ref<RDShaderBytecode> bytecode = shader_file->get_bytecode(current_version); + Ref<RDShaderSPIRV> bytecode = shader_file->get_spirv(current_version); ERR_FAIL_COND(bytecode.is_null()); int first_valid = -1; int current = -1; diff --git a/editor/plugins/sprite_frames_editor_plugin.cpp b/editor/plugins/sprite_frames_editor_plugin.cpp index a5d0ebbc12..42f7d23da2 100644 --- a/editor/plugins/sprite_frames_editor_plugin.cpp +++ b/editor/plugins/sprite_frames_editor_plugin.cpp @@ -365,7 +365,7 @@ void SpriteFramesEditor::_file_load_request(const Vector<String> &p_path, int p_ int count = 0; - for (Ref<Texture2D> &E : resources) { + for (const Ref<Texture2D> &E : resources) { undo_redo->add_do_method(frames, "add_frame", edited_anim, E, p_at_pos == -1 ? -1 : p_at_pos + count); undo_redo->add_undo_method(frames, "remove_frame", edited_anim, p_at_pos == -1 ? fc : p_at_pos); count++; diff --git a/editor/plugins/theme_editor_plugin.cpp b/editor/plugins/theme_editor_plugin.cpp index 6bd901cead..6bcc65e30c 100644 --- a/editor/plugins/theme_editor_plugin.cpp +++ b/editor/plugins/theme_editor_plugin.cpp @@ -2906,7 +2906,7 @@ void ThemeTypeEditor::_update_stylebox_from_leading() { continue; } - for (Ref<StyleBox> F : styleboxes) { + for (const Ref<StyleBox> &F : styleboxes) { Ref<StyleBox> sb = F; sb->set(E.name, value); } diff --git a/editor/settings_config_dialog.cpp b/editor/settings_config_dialog.cpp index aefa8e434e..b3ec0c96c4 100644 --- a/editor/settings_config_dialog.cpp +++ b/editor/settings_config_dialog.cpp @@ -403,7 +403,7 @@ void EditorSettingsDialog::_shortcut_button_pressed(Object *p_item, int p_column List<Ref<InputEvent>> defaults = InputMap::get_singleton()->get_builtins()[current_action]; // Convert the list to an array, and only keep key events as this is for the editor. - for (Ref<InputEvent> k : defaults) { + for (const Ref<InputEvent> &k : defaults) { if (k.is_valid()) { events.append(k); } diff --git a/editor/translations/af.po b/editor/translations/af.po index bb7e7ca553..6a74789da2 100644 --- a/editor/translations/af.po +++ b/editor/translations/af.po @@ -5251,8 +5251,8 @@ msgstr "" #: editor/plugins/baked_lightmap_editor_plugin.cpp msgid "" -"No meshes to bake. Make sure they contain an UV2 channel and that the 'Bake " -"Light' flag is on." +"No meshes to bake. Make sure they contain an UV2 channel and that the 'Use " +"In Baked Light' and 'Generate Lightmap' flags are on." msgstr "" #: editor/plugins/baked_lightmap_editor_plugin.cpp diff --git a/editor/translations/ar.po b/editor/translations/ar.po index 6d8db6f47b..b851db361f 100644 --- a/editor/translations/ar.po +++ b/editor/translations/ar.po @@ -52,12 +52,13 @@ # ILG - Game <moegypt277@gmail.com>, 2021. # Hatim Jamal <hatimjamal8@gmail.com>, 2021. # HASSAN GAMER - حسن جيمر <gamerhassan55@gmail.com>, 2021. +# abubakrAlsaab <madeinsudan19@gmail.com>, 2021. msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2021-07-09 14:32+0000\n" -"Last-Translator: HASSAN GAMER - حسن جيمر <gamerhassan55@gmail.com>\n" +"PO-Revision-Date: 2021-07-16 05:47+0000\n" +"Last-Translator: abubakrAlsaab <madeinsudan19@gmail.com>\n" "Language-Team: Arabic <https://hosted.weblate.org/projects/godot-engine/" "godot/ar/>\n" "Language: ar\n" @@ -66,7 +67,7 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 " "&& n%100<=10 ? 3 : n%100>=11 ? 4 : 5;\n" -"X-Generator: Weblate 4.8-dev\n" +"X-Generator: Weblate 4.7.2-dev\n" #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp @@ -3021,7 +3022,7 @@ msgstr "حول" #: editor/editor_node.cpp msgid "Support Godot Development" -msgstr "" +msgstr "إدعم تطوير محرك غو-دوت" #: editor/editor_node.cpp msgid "Play the project." @@ -5215,9 +5216,10 @@ msgstr "" "الضوء المعدة مسبقا." #: editor/plugins/baked_lightmap_editor_plugin.cpp +#, fuzzy msgid "" -"No meshes to bake. Make sure they contain an UV2 channel and that the 'Bake " -"Light' flag is on." +"No meshes to bake. Make sure they contain an UV2 channel and that the 'Use " +"In Baked Light' and 'Generate Lightmap' flags are on." msgstr "" "لايوجد ميش لكي يتم تجهيزة. تاكد من انه يحتوي على منفذ UV2 و ان زر الضوء " "'المعد' مفعل." @@ -5342,7 +5344,7 @@ msgstr "تعديل حجم العقدة \"Node2D \"%s إلى (s, %s%)" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Resize Control \"%s\" to (%d, %d)" -msgstr "" +msgstr "تغيير حجم عنصر التحكم \"٪ s\" إلى (٪ d،٪ d)" #: editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy @@ -7566,6 +7568,7 @@ msgstr "تدوير الرؤية مقفول" msgid "" "To zoom further, change the camera's clipping planes (View -> Settings...)" msgstr "" +"للتكبير بشكل أكبر ، قم بتغيير مستويات اقتصاص الكاميرا (عرض -> الإعدادات ...)" #: editor/plugins/spatial_editor_plugin.cpp msgid "" @@ -9536,7 +9539,7 @@ msgstr "" #: editor/plugins/visual_shader_editor_plugin.cpp msgid "A reference to an existing uniform." -msgstr "" +msgstr "إشارة إلى زي موحد موجود." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "(Fragment/Light mode only) Scalar derivative function." @@ -9903,7 +9906,7 @@ msgstr "OpenGL ES 3.0" #: editor/project_manager.cpp msgid "Not supported by your GPU drivers." -msgstr "" +msgstr "غير مدعوم من قبل برامج تشغيل GPU(اجهزة اارسوم) الخاصة بك." #: editor/project_manager.cpp msgid "" @@ -10959,6 +10962,9 @@ msgid "" "every time it updates.\n" "Switch back to the Local scene tree dock to improve performance." msgstr "" +"إذا تم تحديده ، فسيؤدي شجرة المشهد إلى توقف المشروع في كل مرة يتم فيها " +"تحديثه.\n" +"قم بالتبديل مرة أخرى إلى رصيف شجرة المشهد المحلي لتحسين الأداء." #: editor/scene_tree_dock.cpp msgid "Local" @@ -11657,11 +11663,11 @@ msgstr "" #: modules/lightmapper_cpu/lightmapper_cpu.cpp msgid "Begin Bake" -msgstr "" +msgstr "ابدأ الخبز (دمج تاثير الضوء في الصورة )" #: modules/lightmapper_cpu/lightmapper_cpu.cpp msgid "Preparing data structures" -msgstr "" +msgstr "تحضير هياكل البيانات" #: modules/lightmapper_cpu/lightmapper_cpu.cpp #, fuzzy @@ -12192,7 +12198,7 @@ msgstr "اختر جهازاً من القائمة" #: platform/android/export/export.cpp msgid "Unable to find the 'apksigner' tool." -msgstr "" +msgstr "تعذر العثور على أداة توقيع تطبيق اندرويد\"apksigner\"." #: platform/android/export/export.cpp msgid "" diff --git a/editor/translations/az.po b/editor/translations/az.po index 054bc9263d..be05c12c5c 100644 --- a/editor/translations/az.po +++ b/editor/translations/az.po @@ -5056,8 +5056,8 @@ msgstr "" #: editor/plugins/baked_lightmap_editor_plugin.cpp msgid "" -"No meshes to bake. Make sure they contain an UV2 channel and that the 'Bake " -"Light' flag is on." +"No meshes to bake. Make sure they contain an UV2 channel and that the 'Use " +"In Baked Light' and 'Generate Lightmap' flags are on." msgstr "" #: editor/plugins/baked_lightmap_editor_plugin.cpp diff --git a/editor/translations/bg.po b/editor/translations/bg.po index 7bf3d40805..9759e3d1e5 100644 --- a/editor/translations/bg.po +++ b/editor/translations/bg.po @@ -5042,9 +5042,10 @@ msgstr "" "Запазете сцената и опитайте отново." #: editor/plugins/baked_lightmap_editor_plugin.cpp +#, fuzzy msgid "" -"No meshes to bake. Make sure they contain an UV2 channel and that the 'Bake " -"Light' flag is on." +"No meshes to bake. Make sure they contain an UV2 channel and that the 'Use " +"In Baked Light' and 'Generate Lightmap' flags are on." msgstr "" "Няма полигонни мрежи за изпичане. Уверете се, че те съдържат канал UV2 и че " "флагът „Изпичане на светлината“ е включен." diff --git a/editor/translations/bn.po b/editor/translations/bn.po index 70a66820fb..f4a10f7dea 100644 --- a/editor/translations/bn.po +++ b/editor/translations/bn.po @@ -5526,8 +5526,8 @@ msgstr "" #: editor/plugins/baked_lightmap_editor_plugin.cpp msgid "" -"No meshes to bake. Make sure they contain an UV2 channel and that the 'Bake " -"Light' flag is on." +"No meshes to bake. Make sure they contain an UV2 channel and that the 'Use " +"In Baked Light' and 'Generate Lightmap' flags are on." msgstr "" #: editor/plugins/baked_lightmap_editor_plugin.cpp diff --git a/editor/translations/br.po b/editor/translations/br.po index 9d1e52e009..0fe39331f9 100644 --- a/editor/translations/br.po +++ b/editor/translations/br.po @@ -5000,8 +5000,8 @@ msgstr "" #: editor/plugins/baked_lightmap_editor_plugin.cpp msgid "" -"No meshes to bake. Make sure they contain an UV2 channel and that the 'Bake " -"Light' flag is on." +"No meshes to bake. Make sure they contain an UV2 channel and that the 'Use " +"In Baked Light' and 'Generate Lightmap' flags are on." msgstr "" #: editor/plugins/baked_lightmap_editor_plugin.cpp diff --git a/editor/translations/ca.po b/editor/translations/ca.po index 1032b7cdeb..40429cc0e0 100644 --- a/editor/translations/ca.po +++ b/editor/translations/ca.po @@ -5277,9 +5277,10 @@ msgstr "" "camí des de les propietats de BakedLightmap." #: editor/plugins/baked_lightmap_editor_plugin.cpp +#, fuzzy msgid "" -"No meshes to bake. Make sure they contain an UV2 channel and that the 'Bake " -"Light' flag is on." +"No meshes to bake. Make sure they contain an UV2 channel and that the 'Use " +"In Baked Light' and 'Generate Lightmap' flags are on." msgstr "" "Cap Malla per precalcular. Comproveu que disposin d'un canal d'UV2 i que " "l'indicador 'Bake Light' és activat." diff --git a/editor/translations/cs.po b/editor/translations/cs.po index 3aaf91d758..281bc500f2 100644 --- a/editor/translations/cs.po +++ b/editor/translations/cs.po @@ -30,8 +30,8 @@ msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2021-06-25 02:57+0000\n" -"Last-Translator: Vojtěch Šamla <auzkok@seznam.cz>\n" +"PO-Revision-Date: 2021-07-26 14:18+0000\n" +"Last-Translator: Zbyněk <zbynek.fiala@gmail.com>\n" "Language-Team: Czech <https://hosted.weblate.org/projects/godot-engine/godot/" "cs/>\n" "Language: cs\n" @@ -39,7 +39,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" -"X-Generator: Weblate 4.7.1-dev\n" +"X-Generator: Weblate 4.7.2-dev\n" #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp @@ -5139,7 +5139,7 @@ msgstr "Poslední" #: editor/plugins/asset_library_editor_plugin.cpp msgid "All" -msgstr "Všechny" +msgstr "všichni" #: editor/plugins/asset_library_editor_plugin.cpp msgid "No results for \"%s\"." @@ -5194,9 +5194,10 @@ msgstr "" "Uložte scénu a zkuste to znovu." #: editor/plugins/baked_lightmap_editor_plugin.cpp +#, fuzzy msgid "" -"No meshes to bake. Make sure they contain an UV2 channel and that the 'Bake " -"Light' flag is on." +"No meshes to bake. Make sure they contain an UV2 channel and that the 'Use " +"In Baked Light' and 'Generate Lightmap' flags are on." msgstr "" "Žádné sítě k zapečení. Ujistěte se, že obsahují kanál UV2 a že je nastaven " "příznak \"Zapéct světlo\"." @@ -10546,7 +10547,7 @@ msgstr "Hodnota, o kterou se počítadlo zvýší za každý uzel" #: editor/rename_dialog.cpp msgid "Padding" -msgstr "Odsazení" +msgstr "Zarovnávání" #: editor/rename_dialog.cpp msgid "" diff --git a/editor/translations/da.po b/editor/translations/da.po index 9e09250fbc..c86ec25b4b 100644 --- a/editor/translations/da.po +++ b/editor/translations/da.po @@ -5390,8 +5390,8 @@ msgstr "" #: editor/plugins/baked_lightmap_editor_plugin.cpp msgid "" -"No meshes to bake. Make sure they contain an UV2 channel and that the 'Bake " -"Light' flag is on." +"No meshes to bake. Make sure they contain an UV2 channel and that the 'Use " +"In Baked Light' and 'Generate Lightmap' flags are on." msgstr "" #: editor/plugins/baked_lightmap_editor_plugin.cpp diff --git a/editor/translations/de.po b/editor/translations/de.po index bbf72f815b..954f8426f8 100644 --- a/editor/translations/de.po +++ b/editor/translations/de.po @@ -5289,9 +5289,10 @@ msgstr "" "Ein Speichern der Szene sollte dieses Problem beheben." #: editor/plugins/baked_lightmap_editor_plugin.cpp +#, fuzzy msgid "" -"No meshes to bake. Make sure they contain an UV2 channel and that the 'Bake " -"Light' flag is on." +"No meshes to bake. Make sure they contain an UV2 channel and that the 'Use " +"In Baked Light' and 'Generate Lightmap' flags are on." msgstr "" "Keine Meshes zum vorrendern vorhanden. Meshes, die vorgerendert werden " "sollen, müssen einen UV2-Kanal beinhalten und die ‚Bake Light‘-Option " diff --git a/editor/translations/editor.pot b/editor/translations/editor.pot index 99579c7b34..ae7b6b37dc 100644 --- a/editor/translations/editor.pot +++ b/editor/translations/editor.pot @@ -4980,8 +4980,8 @@ msgstr "" #: editor/plugins/baked_lightmap_editor_plugin.cpp msgid "" -"No meshes to bake. Make sure they contain an UV2 channel and that the 'Bake " -"Light' flag is on." +"No meshes to bake. Make sure they contain an UV2 channel and that the 'Use " +"In Baked Light' and 'Generate Lightmap' flags are on." msgstr "" #: editor/plugins/baked_lightmap_editor_plugin.cpp diff --git a/editor/translations/el.po b/editor/translations/el.po index 035a82f99f..40d8ab46cc 100644 --- a/editor/translations/el.po +++ b/editor/translations/el.po @@ -5239,9 +5239,10 @@ msgstr "" "Αποθηκεύστε τη σκηνή σας και δοκιμάστε ξανα." #: editor/plugins/baked_lightmap_editor_plugin.cpp +#, fuzzy msgid "" -"No meshes to bake. Make sure they contain an UV2 channel and that the 'Bake " -"Light' flag is on." +"No meshes to bake. Make sure they contain an UV2 channel and that the 'Use " +"In Baked Light' and 'Generate Lightmap' flags are on." msgstr "" "Δεν υπάρχουν πλέγματα για προετοιμασία. Σιγουρευτείτε ότι εμπεριέχουν κανάλι " "UV2 και πως η σημαία 'Bake Light' είναι ενεργοποιημένη." diff --git a/editor/translations/eo.po b/editor/translations/eo.po index 0523742303..38c72380da 100644 --- a/editor/translations/eo.po +++ b/editor/translations/eo.po @@ -5204,8 +5204,8 @@ msgstr "" #: editor/plugins/baked_lightmap_editor_plugin.cpp msgid "" -"No meshes to bake. Make sure they contain an UV2 channel and that the 'Bake " -"Light' flag is on." +"No meshes to bake. Make sure they contain an UV2 channel and that the 'Use " +"In Baked Light' and 'Generate Lightmap' flags are on." msgstr "" #: editor/plugins/baked_lightmap_editor_plugin.cpp diff --git a/editor/translations/es.po b/editor/translations/es.po index 5953536c60..e09d1df8c7 100644 --- a/editor/translations/es.po +++ b/editor/translations/es.po @@ -72,7 +72,7 @@ msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2021-07-05 21:41+0000\n" +"PO-Revision-Date: 2021-07-16 05:47+0000\n" "Last-Translator: Erick Figueroa <querecuto@hotmail.com>\n" "Language-Team: Spanish <https://hosted.weblate.org/projects/godot-engine/" "godot/es/>\n" @@ -81,7 +81,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 4.8-dev\n" +"X-Generator: Weblate 4.7.2-dev\n" #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp @@ -1205,7 +1205,7 @@ msgstr "Desarrollador Principal" #. you do not have to keep it in your translation. #: editor/editor_about.cpp msgid "Project Manager " -msgstr "Gestor del Proyecto " +msgstr "Administrador de Proyectos " #: editor/editor_about.cpp msgid "Developers" @@ -3078,7 +3078,7 @@ msgstr "Apoyar el desarrollo de Godot" #: editor/editor_node.cpp msgid "Play the project." -msgstr "Reproducir el proyecto." +msgstr "Ejecutar el proyecto." #: editor/editor_node.cpp msgid "Play" @@ -5293,9 +5293,10 @@ msgstr "" "Guarda tu escena e inténtalo de nuevo." #: editor/plugins/baked_lightmap_editor_plugin.cpp +#, fuzzy msgid "" -"No meshes to bake. Make sure they contain an UV2 channel and that the 'Bake " -"Light' flag is on." +"No meshes to bake. Make sure they contain an UV2 channel and that the 'Use " +"In Baked Light' and 'Generate Lightmap' flags are on." msgstr "" "No hay mallas para hacer bake. Asegúrate que contengan un canal UV2 y que la " "opción de 'Bake Light' está activada." @@ -10154,8 +10155,8 @@ msgid "" "The interface will update after restarting the editor or project manager." msgstr "" "Idioma cambiado.\n" -"La interfaz se actualizará después de reiniciar el editor o el gestor de " -"proyectos." +"La interfaz se actualizará después de reiniciar el editor o el administrador " +"de proyectos." #: editor/project_manager.cpp msgid "" @@ -11737,7 +11738,7 @@ msgstr "Eliminar Rotación del Cursor" #: modules/gridmap/grid_map_editor_plugin.cpp msgid "Paste Selects" -msgstr "Pegar Selecciona" +msgstr "Pegar Seleccionados" #: modules/gridmap/grid_map_editor_plugin.cpp msgid "Clear Selection" diff --git a/editor/translations/es_AR.po b/editor/translations/es_AR.po index d1fe06a565..33c29d9c6e 100644 --- a/editor/translations/es_AR.po +++ b/editor/translations/es_AR.po @@ -5237,9 +5237,10 @@ msgstr "" "Guardá tu escena e inténtalo de nuevo." #: editor/plugins/baked_lightmap_editor_plugin.cpp +#, fuzzy msgid "" -"No meshes to bake. Make sure they contain an UV2 channel and that the 'Bake " -"Light' flag is on." +"No meshes to bake. Make sure they contain an UV2 channel and that the 'Use " +"In Baked Light' and 'Generate Lightmap' flags are on." msgstr "" "No hay meshes para hacer bake. Asegúrate que contienen un canal UV2 y que el " "flag 'Bake Light' esta activado." diff --git a/editor/translations/et.po b/editor/translations/et.po index 05a414f5a9..fd534943b1 100644 --- a/editor/translations/et.po +++ b/editor/translations/et.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" -"PO-Revision-Date: 2021-05-10 15:32+0000\n" +"PO-Revision-Date: 2021-07-16 05:47+0000\n" "Last-Translator: Kritzmensch <streef.gtx@gmail.com>\n" "Language-Team: Estonian <https://hosted.weblate.org/projects/godot-engine/" "godot/et/>\n" @@ -18,7 +18,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8-bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 4.7-dev\n" +"X-Generator: Weblate 4.7.2-dev\n" #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp @@ -1090,7 +1090,7 @@ msgstr "Suur tänu Godot kogukonnalt!" #: editor/editor_about.cpp editor/editor_node.cpp editor/project_manager.cpp msgid "Click to copy." -msgstr "" +msgstr "Klõpsa, et kopeerida." #: editor/editor_about.cpp msgid "Godot Engine contributors" @@ -5039,8 +5039,8 @@ msgstr "" #: editor/plugins/baked_lightmap_editor_plugin.cpp msgid "" -"No meshes to bake. Make sure they contain an UV2 channel and that the 'Bake " -"Light' flag is on." +"No meshes to bake. Make sure they contain an UV2 channel and that the 'Use " +"In Baked Light' and 'Generate Lightmap' flags are on." msgstr "" #: editor/plugins/baked_lightmap_editor_plugin.cpp @@ -7244,7 +7244,7 @@ msgstr "Kuva tavaliselt" #: editor/plugins/spatial_editor_plugin.cpp msgid "Display Wireframe" -msgstr "Kuva traadiraamina" +msgstr "Kuva traatraamina" #: editor/plugins/spatial_editor_plugin.cpp msgid "Display Overdraw" diff --git a/editor/translations/eu.po b/editor/translations/eu.po index 87c91de10e..f9f2d97348 100644 --- a/editor/translations/eu.po +++ b/editor/translations/eu.po @@ -5012,8 +5012,8 @@ msgstr "" #: editor/plugins/baked_lightmap_editor_plugin.cpp msgid "" -"No meshes to bake. Make sure they contain an UV2 channel and that the 'Bake " -"Light' flag is on." +"No meshes to bake. Make sure they contain an UV2 channel and that the 'Use " +"In Baked Light' and 'Generate Lightmap' flags are on." msgstr "" #: editor/plugins/baked_lightmap_editor_plugin.cpp diff --git a/editor/translations/fa.po b/editor/translations/fa.po index ddccfeaebe..ab4157565e 100644 --- a/editor/translations/fa.po +++ b/editor/translations/fa.po @@ -5191,8 +5191,8 @@ msgstr "" #: editor/plugins/baked_lightmap_editor_plugin.cpp msgid "" -"No meshes to bake. Make sure they contain an UV2 channel and that the 'Bake " -"Light' flag is on." +"No meshes to bake. Make sure they contain an UV2 channel and that the 'Use " +"In Baked Light' and 'Generate Lightmap' flags are on." msgstr "" #: editor/plugins/baked_lightmap_editor_plugin.cpp diff --git a/editor/translations/fi.po b/editor/translations/fi.po index 834d1894e3..1007ee660b 100644 --- a/editor/translations/fi.po +++ b/editor/translations/fi.po @@ -5195,9 +5195,10 @@ msgstr "" "Tallenna skenesi ja yritä uudelleen." #: editor/plugins/baked_lightmap_editor_plugin.cpp +#, fuzzy msgid "" -"No meshes to bake. Make sure they contain an UV2 channel and that the 'Bake " -"Light' flag is on." +"No meshes to bake. Make sure they contain an UV2 channel and that the 'Use " +"In Baked Light' and 'Generate Lightmap' flags are on." msgstr "" "Ei meshejä kehitettävänä. Varmista, että ne sisältävät UV2-kanavan, ja että " "'Bake Light' asetus on päällä." diff --git a/editor/translations/fil.po b/editor/translations/fil.po index 892968821b..b23a43088c 100644 --- a/editor/translations/fil.po +++ b/editor/translations/fil.po @@ -4998,8 +4998,8 @@ msgstr "" #: editor/plugins/baked_lightmap_editor_plugin.cpp msgid "" -"No meshes to bake. Make sure they contain an UV2 channel and that the 'Bake " -"Light' flag is on." +"No meshes to bake. Make sure they contain an UV2 channel and that the 'Use " +"In Baked Light' and 'Generate Lightmap' flags are on." msgstr "" #: editor/plugins/baked_lightmap_editor_plugin.cpp diff --git a/editor/translations/fr.po b/editor/translations/fr.po index 6fad70a7c2..d4ded02294 100644 --- a/editor/translations/fr.po +++ b/editor/translations/fr.po @@ -85,8 +85,8 @@ msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2021-07-01 14:33+0000\n" -"Last-Translator: Clément Topy <topy72.mine@gmail.com>\n" +"PO-Revision-Date: 2021-07-16 05:47+0000\n" +"Last-Translator: Pierre Caye <pierrecaye@laposte.net>\n" "Language-Team: French <https://hosted.weblate.org/projects/godot-engine/" "godot/fr/>\n" "Language: fr\n" @@ -94,7 +94,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n > 1;\n" -"X-Generator: Weblate 4.8-dev\n" +"X-Generator: Weblate 4.7.2-dev\n" #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp @@ -5258,7 +5258,7 @@ msgstr "Dernier" #: editor/plugins/asset_library_editor_plugin.cpp msgid "All" -msgstr "Tout" +msgstr "All" #: editor/plugins/asset_library_editor_plugin.cpp msgid "No results for \"%s\"." @@ -5314,11 +5314,12 @@ msgstr "" #: editor/plugins/baked_lightmap_editor_plugin.cpp msgid "" -"No meshes to bake. Make sure they contain an UV2 channel and that the 'Bake " -"Light' flag is on." +"No meshes to bake. Make sure they contain an UV2 channel and that the 'Use " +"In Baked Light' and 'Generate Lightmap' flags are on." msgstr "" -"Aucun maillage à transférer. Assurez-vous qu'ils contiennent un canal UV2 et " -"que l'indicateur « Bake Light » est activé." +"Aucun maillage à précalculer. Assurez-vous qu'ils contiennent un canal UV2 " +"et que les propriétés « Use In Bake Light » et « Generate Lightmap » soient " +"activées." #: editor/plugins/baked_lightmap_editor_plugin.cpp msgid "Failed creating lightmap images, make sure path is writable." diff --git a/editor/translations/ga.po b/editor/translations/ga.po index 8168c1a440..9db93e38f8 100644 --- a/editor/translations/ga.po +++ b/editor/translations/ga.po @@ -4995,8 +4995,8 @@ msgstr "" #: editor/plugins/baked_lightmap_editor_plugin.cpp msgid "" -"No meshes to bake. Make sure they contain an UV2 channel and that the 'Bake " -"Light' flag is on." +"No meshes to bake. Make sure they contain an UV2 channel and that the 'Use " +"In Baked Light' and 'Generate Lightmap' flags are on." msgstr "" #: editor/plugins/baked_lightmap_editor_plugin.cpp diff --git a/editor/translations/gl.po b/editor/translations/gl.po index 016a3ab589..68e7b47599 100644 --- a/editor/translations/gl.po +++ b/editor/translations/gl.po @@ -5162,8 +5162,8 @@ msgstr "" #: editor/plugins/baked_lightmap_editor_plugin.cpp msgid "" -"No meshes to bake. Make sure they contain an UV2 channel and that the 'Bake " -"Light' flag is on." +"No meshes to bake. Make sure they contain an UV2 channel and that the 'Use " +"In Baked Light' and 'Generate Lightmap' flags are on." msgstr "" #: editor/plugins/baked_lightmap_editor_plugin.cpp diff --git a/editor/translations/he.po b/editor/translations/he.po index 5dc30a6cc2..a989a8aad0 100644 --- a/editor/translations/he.po +++ b/editor/translations/he.po @@ -5214,9 +5214,10 @@ msgstr "" "ממאפייני BakedLightmap." #: editor/plugins/baked_lightmap_editor_plugin.cpp +#, fuzzy msgid "" -"No meshes to bake. Make sure they contain an UV2 channel and that the 'Bake " -"Light' flag is on." +"No meshes to bake. Make sure they contain an UV2 channel and that the 'Use " +"In Baked Light' and 'Generate Lightmap' flags are on." msgstr "אין רשתות לאפייה. ודא/י שהם מכילים ערוץ UV2 והדגל 'Bake Light' מאופשר." #: editor/plugins/baked_lightmap_editor_plugin.cpp diff --git a/editor/translations/hi.po b/editor/translations/hi.po index db1dcd67e6..70187feed0 100644 --- a/editor/translations/hi.po +++ b/editor/translations/hi.po @@ -5137,8 +5137,8 @@ msgstr "" #: editor/plugins/baked_lightmap_editor_plugin.cpp msgid "" -"No meshes to bake. Make sure they contain an UV2 channel and that the 'Bake " -"Light' flag is on." +"No meshes to bake. Make sure they contain an UV2 channel and that the 'Use " +"In Baked Light' and 'Generate Lightmap' flags are on." msgstr "" #: editor/plugins/baked_lightmap_editor_plugin.cpp diff --git a/editor/translations/hr.po b/editor/translations/hr.po index d737bb04b7..c62d3f3eb5 100644 --- a/editor/translations/hr.po +++ b/editor/translations/hr.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" -"PO-Revision-Date: 2021-04-11 22:02+0000\n" +"PO-Revision-Date: 2021-07-16 05:47+0000\n" "Last-Translator: LeoClose <leoclose575@gmail.com>\n" "Language-Team: Croatian <https://hosted.weblate.org/projects/godot-engine/" "godot/hr/>\n" @@ -18,7 +18,7 @@ msgstr "" "Content-Transfer-Encoding: 8-bit\n" "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" -"X-Generator: Weblate 4.6-dev\n" +"X-Generator: Weblate 4.7.2-dev\n" #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp @@ -41,7 +41,7 @@ msgstr "Neispravan unos %i (nije uspio) u izrazu" #: core/math/expression.cpp msgid "self can't be used because instance is null (not passed)" -msgstr "self nije moguće koristiti jer je jedinka null (nije uspio)" +msgstr "self se ne može koristiti jer instanca je null (nije prosljeđena)" #: core/math/expression.cpp msgid "Invalid operands to operator %s, %s and %s." @@ -1716,7 +1716,7 @@ msgstr "Novo" #: editor/editor_feature_profile.cpp editor/editor_node.cpp #: editor/project_manager.cpp msgid "Import" -msgstr "Uvoz" +msgstr "Uvezi" #: editor/editor_feature_profile.cpp editor/project_export.cpp msgid "Export" @@ -2861,7 +2861,7 @@ msgstr "Zajednica" #: editor/editor_node.cpp msgid "About" -msgstr "" +msgstr "U vezi s" #: editor/editor_node.cpp msgid "Support Godot Development" @@ -5009,8 +5009,8 @@ msgstr "" #: editor/plugins/baked_lightmap_editor_plugin.cpp msgid "" -"No meshes to bake. Make sure they contain an UV2 channel and that the 'Bake " -"Light' flag is on." +"No meshes to bake. Make sure they contain an UV2 channel and that the 'Use " +"In Baked Light' and 'Generate Lightmap' flags are on." msgstr "" #: editor/plugins/baked_lightmap_editor_plugin.cpp diff --git a/editor/translations/hu.po b/editor/translations/hu.po index 85933dc05d..7a2e35e37b 100644 --- a/editor/translations/hu.po +++ b/editor/translations/hu.po @@ -5180,9 +5180,10 @@ msgstr "" "tulajdonságaiból." #: editor/plugins/baked_lightmap_editor_plugin.cpp +#, fuzzy msgid "" -"No meshes to bake. Make sure they contain an UV2 channel and that the 'Bake " -"Light' flag is on." +"No meshes to bake. Make sure they contain an UV2 channel and that the 'Use " +"In Baked Light' and 'Generate Lightmap' flags are on." msgstr "" "Nincs mesh, amibe adatokat süthetne. Bizonyosodjon meg arról, hogy " "tartalmaznak egy UV2 csatornát, és hogy a 'Fény Besütése' opció be van " diff --git a/editor/translations/id.po b/editor/translations/id.po index e1029fc231..4dce64fd92 100644 --- a/editor/translations/id.po +++ b/editor/translations/id.po @@ -5210,9 +5210,10 @@ msgstr "" "Simpan skena Anda dan coba lagi." #: editor/plugins/baked_lightmap_editor_plugin.cpp +#, fuzzy msgid "" -"No meshes to bake. Make sure they contain an UV2 channel and that the 'Bake " -"Light' flag is on." +"No meshes to bake. Make sure they contain an UV2 channel and that the 'Use " +"In Baked Light' and 'Generate Lightmap' flags are on." msgstr "" "Tidak ada mesh-mesh untuk di bake. Pastikan mereka punya kanal UV2 dan 'Bake " "Cahaya' menyala." diff --git a/editor/translations/is.po b/editor/translations/is.po index fc1423d841..c7d7023690 100644 --- a/editor/translations/is.po +++ b/editor/translations/is.po @@ -5051,8 +5051,8 @@ msgstr "" #: editor/plugins/baked_lightmap_editor_plugin.cpp msgid "" -"No meshes to bake. Make sure they contain an UV2 channel and that the 'Bake " -"Light' flag is on." +"No meshes to bake. Make sure they contain an UV2 channel and that the 'Use " +"In Baked Light' and 'Generate Lightmap' flags are on." msgstr "" #: editor/plugins/baked_lightmap_editor_plugin.cpp diff --git a/editor/translations/it.po b/editor/translations/it.po index 60c362c63a..f1de95dac6 100644 --- a/editor/translations/it.po +++ b/editor/translations/it.po @@ -59,12 +59,13 @@ # Alessandro Mandelli <mandelli.alessandro@ngi.it>, 2021. # Jusef Azzolina <rosarioazzolina33@gmail.com>, 2021. # Daniele Basso <tiziodcaio@gmail.com>, 2021. +# Riteo Siuga <riteo@posteo.net>, 2021. msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2021-06-15 19:34+0000\n" -"Last-Translator: Riteo Siuga <lorenzocerqua@tutanota.com>\n" +"PO-Revision-Date: 2021-07-26 14:18+0000\n" +"Last-Translator: Riteo Siuga <riteo@posteo.net>\n" "Language-Team: Italian <https://hosted.weblate.org/projects/godot-engine/" "godot/it/>\n" "Language: it\n" @@ -72,7 +73,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 4.7-dev\n" +"X-Generator: Weblate 4.7.2-dev\n" #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp @@ -876,6 +877,7 @@ msgid "Deferred" msgstr "Differita" #: editor/connections_dialog.cpp +#, fuzzy msgid "" "Defers the signal, storing it in a queue and only firing it at idle time." msgstr "" @@ -1172,7 +1174,7 @@ msgstr "Grazie dalla comunità di Godot!" #: editor/editor_about.cpp editor/editor_node.cpp editor/project_manager.cpp msgid "Click to copy." -msgstr "" +msgstr "Clicca per copiare." #: editor/editor_about.cpp msgid "Godot Engine contributors" @@ -2348,7 +2350,7 @@ msgid "" msgstr "" "Questa scena non può essere salvata perché contiene un'istanziazione " "ciclica.\n" -"Riprovare ad eseguire il salvataggio dopo aver risolto il problema." +"Riprovare a eseguire il salvataggio dopo aver risolto il problema." #: editor/editor_node.cpp msgid "" @@ -2962,7 +2964,7 @@ msgstr "" #: editor/editor_node.cpp msgid "Synchronize Scene Changes" -msgstr "Sincronizza i cambi della scena" +msgstr "Sincronizza i cambiamenti delle scene" #: editor/editor_node.cpp msgid "" @@ -2978,9 +2980,10 @@ msgstr "" #: editor/editor_node.cpp msgid "Synchronize Script Changes" -msgstr "Sincronizza Modifiche Script" +msgstr "Sincronizza le modifiche degli script" #: editor/editor_node.cpp +#, fuzzy msgid "" "When this option is enabled, any script that is saved will be reloaded in " "the running project.\n" @@ -2989,7 +2992,7 @@ msgid "" msgstr "" "Quando questa opzione è abilitata, qualsiasi script salvato verrà ricaricato " "nel progetto in esecuzione.\n" -"Quando usato in remoto su un dispositivo, essa risulta più efficate " +"Quando usato in remoto su un dispositivo, essa risulta più efficace " "abilitando l'opzione \"network filesystem\"." #: editor/editor_node.cpp editor/script_create_dialog.cpp @@ -3062,6 +3065,7 @@ msgid "Report a Bug" msgstr "Segnala un problema" #: editor/editor_node.cpp +#, fuzzy msgid "Send Docs Feedback" msgstr "Valuta la documentazione" @@ -3078,6 +3082,7 @@ msgid "Support Godot Development" msgstr "Supporta lo sviluppo di Godot" #: editor/editor_node.cpp +#, fuzzy msgid "Play the project." msgstr "Esegui il progetto." @@ -3091,7 +3096,7 @@ msgstr "Metti in pausa l'esecuzione della scena per eseguire il debug." #: editor/editor_node.cpp msgid "Pause Scene" -msgstr "Pausa scena" +msgstr "Pausa la scena" #: editor/editor_node.cpp msgid "Stop the scene." @@ -3115,7 +3120,7 @@ msgstr "Avvia una scena personalizzata" #: editor/editor_node.cpp msgid "Changing the video driver requires restarting the editor." -msgstr "Il cambiamento dei driver video necessita il riavvio dell'editor." +msgstr "Il cambiamento dei driver video necessita di un riavvio dell'editor." #: editor/editor_node.cpp editor/project_settings_editor.cpp #: editor/settings_config_dialog.cpp @@ -3131,6 +3136,7 @@ msgid "Update Continuously" msgstr "Aggiorna continuamente" #: editor/editor_node.cpp +#, fuzzy msgid "Update When Changed" msgstr "Aggiorna quando modificata" @@ -3209,16 +3215,17 @@ msgid "Template Package" msgstr "Pacchetto di modelli" #: editor/editor_node.cpp +#, fuzzy msgid "Export Library" msgstr "Esporta Libreria" #: editor/editor_node.cpp msgid "Merge With Existing" -msgstr "Unisci Con Esistente" +msgstr "Unisci con una esistente" #: editor/editor_node.cpp msgid "Open & Run a Script" -msgstr "Apri ed Esegui uno Script" +msgstr "Apri ed esegui uno script" #: editor/editor_node.cpp msgid "" @@ -3244,7 +3251,7 @@ msgstr "Nuova ereditata" #: editor/editor_node.cpp msgid "Load Errors" -msgstr "Carica errori" +msgstr "Errori di caricamento" #: editor/editor_node.cpp editor/plugins/tile_map_editor_plugin.cpp msgid "Select" @@ -3252,27 +3259,28 @@ msgstr "Seleziona" #: editor/editor_node.cpp msgid "Open 2D Editor" -msgstr "Apri Editor 2D" +msgstr "Apri l'editor 2D" #: editor/editor_node.cpp msgid "Open 3D Editor" -msgstr "Apri Editor 3D" +msgstr "Apri l'editor 3D" #: editor/editor_node.cpp msgid "Open Script Editor" -msgstr "Apri Editor degli script" +msgstr "Apri l'editor degli script" #: editor/editor_node.cpp editor/project_manager.cpp +#, fuzzy msgid "Open Asset Library" -msgstr "Apri Libreria degli Asset" +msgstr "Apri la libreria degli Asset" #: editor/editor_node.cpp msgid "Open the next Editor" -msgstr "Apri l'Editor successivo" +msgstr "Apri l'editor successivo" #: editor/editor_node.cpp msgid "Open the previous Editor" -msgstr "Apri l'Editor precedente" +msgstr "Apri l'editor precedente" #: editor/editor_node.h msgid "Warning!" @@ -3284,7 +3292,7 @@ msgstr "Nessuna sottorisorsa trovata." #: editor/editor_plugin.cpp msgid "Creating Mesh Previews" -msgstr "Creazione Anteprime Mesh" +msgstr "Creando le anteprime delle mesh" #: editor/editor_plugin.cpp msgid "Thumbnail..." @@ -3292,11 +3300,11 @@ msgstr "Miniatura..." #: editor/editor_plugin_settings.cpp msgid "Main Script:" -msgstr "Script Principale:" +msgstr "Script principale:" #: editor/editor_plugin_settings.cpp msgid "Edit Plugin" -msgstr "Modifica estensione" +msgstr "Modifica l'estensione" #: editor/editor_plugin_settings.cpp msgid "Installed Plugins:" @@ -3328,32 +3336,37 @@ msgid "Measure:" msgstr "Misura:" #: editor/editor_profiler.cpp +#, fuzzy msgid "Frame Time (sec)" -msgstr "Tempo Frame (sec)" +msgstr "Tempo fotogramma (sec)" #: editor/editor_profiler.cpp +#, fuzzy msgid "Average Time (sec)" -msgstr "Tempo Medio (sec)" +msgstr "Tempo medio (sec)" #: editor/editor_profiler.cpp +#, fuzzy msgid "Frame %" -msgstr "Frame %" +msgstr "% fotogramma" #: editor/editor_profiler.cpp +#, fuzzy msgid "Physics Frame %" -msgstr "Fotogramma della Fisica %" +msgstr "% fotogramma fisico" #: editor/editor_profiler.cpp msgid "Inclusive" msgstr "Inclusivo" #: editor/editor_profiler.cpp +#, fuzzy msgid "Self" msgstr "Se stesso" #: editor/editor_profiler.cpp msgid "Frame #:" -msgstr "Frame #:" +msgstr "Fotogramma #:" #: editor/editor_profiler.cpp msgid "Time" @@ -3365,7 +3378,7 @@ msgstr "Chiamate" #: editor/editor_properties.cpp msgid "Edit Text:" -msgstr "Modifica Testo:" +msgstr "Modifica il testo:" #: editor/editor_properties.cpp editor/script_create_dialog.cpp msgid "On" @@ -3389,55 +3402,57 @@ msgstr "Assegna..." #: editor/editor_properties.cpp msgid "Invalid RID" -msgstr "RID Invalido" +msgstr "RID non valido" #: editor/editor_properties.cpp msgid "" "The selected resource (%s) does not match any type expected for this " "property (%s)." msgstr "" -"La risorsa selezionata (%s) non corrisponde ad alcun tipo atteso per questa " -"proprietà (%s)." +"La risorsa selezionata (%s) non corrisponde ad alcun tipo previsto per " +"questa proprietà (%s)." #: editor/editor_properties.cpp msgid "" "Can't create a ViewportTexture on resources saved as a file.\n" "Resource needs to belong to a scene." msgstr "" -"Impossibile creare ViewportTexture da risorse salvate come file.\n" -"La risorsa deve appartenere ad una scena." +"Impossibile creare un ViewportTexture su delle risorse salvate come file.\n" +"Esse devono appartenere a una scena." #: editor/editor_properties.cpp +#, fuzzy msgid "" "Can't create a ViewportTexture on this resource because it's not set as " "local to scene.\n" "Please switch on the 'local to scene' property on it (and all resources " "containing it up to a node)." msgstr "" -"Impossibile creare ViewportTexture da questa risorsa perché non è definita " -"localmente in una scena.\n" -"Per favore attivare la proprietà \"local to scene\" sulla risorsa (e su " -"tutte le risorse che la contengono, fino al nodo che le utilizza)." +"Impossibile creare un VieportTexture su questa risorsa perché non è stata " +"impostata come locale alla scena.\n" +"Per favore attivare la properietà \"local to scene\" su di essa (e su tutte " +"quelle che la contengono fino ad arrivare a un nodo)." #: editor/editor_properties.cpp editor/property_editor.cpp msgid "Pick a Viewport" -msgstr "Scegli una Vista" +msgstr "Selezionare una vista" #: editor/editor_properties.cpp editor/property_editor.cpp msgid "New Script" -msgstr "Nuovo Script" +msgstr "Nuovo script" #: editor/editor_properties.cpp editor/scene_tree_dock.cpp msgid "Extend Script" -msgstr "Estendi Script" +msgstr "Estendi script" #: editor/editor_properties.cpp editor/property_editor.cpp msgid "New %s" msgstr "Nuovo %s" #: editor/editor_properties.cpp editor/property_editor.cpp +#, fuzzy msgid "Make Unique" -msgstr "Rendi Unico" +msgstr "Rendi unico" #: editor/editor_properties.cpp #: editor/plugins/animation_blend_space_1d_editor.cpp @@ -3455,11 +3470,12 @@ msgstr "Incolla" #: editor/editor_properties.cpp editor/property_editor.cpp msgid "Convert To %s" -msgstr "Converti In %s" +msgstr "Converti in %s" #: editor/editor_properties.cpp editor/property_editor.cpp +#, fuzzy msgid "Selected node is not a Viewport!" -msgstr "Il nodo selezionato non è una Viewport!" +msgstr "Il nodo selezionato non è un Viewport!" #: editor/editor_properties_array_dict.cpp msgid "Size: " @@ -3472,19 +3488,19 @@ msgstr "Pagina: " #: editor/editor_properties_array_dict.cpp #: editor/plugins/theme_editor_plugin.cpp msgid "Remove Item" -msgstr "Rimuovi Elemento" +msgstr "Rimuovi l'elemento" #: editor/editor_properties_array_dict.cpp msgid "New Key:" -msgstr "Nuova Chiave:" +msgstr "Nuova chiave:" #: editor/editor_properties_array_dict.cpp msgid "New Value:" -msgstr "Nuovo Valore:" +msgstr "Nuovo valore:" #: editor/editor_properties_array_dict.cpp msgid "Add Key/Value Pair" -msgstr "Aggiungi Coppia Chiave/Valore" +msgstr "Aggiungi una coppia chiave/valore" #: editor/editor_run_native.cpp msgid "" @@ -3492,13 +3508,15 @@ msgid "" "Please add a runnable preset in the Export menu or define an existing preset " "as runnable." msgstr "" -"Nessuna esportazione eseguibile trovata per questa piattaforma.\n" -"Per favore, aggiungi un preset eseguibile nel menù Export oppure definisci " -"un preset già esistente come \"eseguibile\"." +"Nessuna preimpostazione di esportazione eseguibile trovata per questa " +"piattaforma.\n" +"Per favore, aggiungerne una nel menù di esportazione o impostarne una già " +"esistente come eseguibile." #: editor/editor_run_script.cpp +#, fuzzy msgid "Write your logic in the _run() method." -msgstr "Scrivi la logica nel metodo _run()." +msgstr "Inserire la logica dello script nel metodo _run()." #: editor/editor_run_script.cpp msgid "There is an edited scene already." @@ -4499,7 +4517,7 @@ msgstr "Rimuovi Triangolo BlendSpace2D" #: editor/plugins/animation_blend_space_2d_editor.cpp msgid "BlendSpace2D does not belong to an AnimationTree node." -msgstr "BlendSpace2D non appartiene ad un nodo AnimationTree." +msgstr "BlendSpace2D non appartiene a un nodo AnimationTree." #: editor/plugins/animation_blend_space_2d_editor.cpp msgid "No triangles exist, so no blending can take place." @@ -5292,9 +5310,10 @@ msgstr "" "Salva la scena e riprova." #: editor/plugins/baked_lightmap_editor_plugin.cpp +#, fuzzy msgid "" -"No meshes to bake. Make sure they contain an UV2 channel and that the 'Bake " -"Light' flag is on." +"No meshes to bake. Make sure they contain an UV2 channel and that the 'Use " +"In Baked Light' and 'Generate Lightmap' flags are on." msgstr "" "Nessuna mesh da preprocessare. Assicurarsi che contengano un canale UV2 e " "che la spunta \"Bake Light\" sia abilitata." @@ -6658,7 +6677,7 @@ msgstr "Spostare il giunto" #: editor/plugins/polygon_2d_editor_plugin.cpp msgid "" "The skeleton property of the Polygon2D does not point to a Skeleton2D node" -msgstr "La proprietà scheletro del Polygon2D non punta ad un nodo Skeleton2D" +msgstr "La proprietà scheletro del Polygon2D non punta a un nodo Skeleton2D" #: editor/plugins/polygon_2d_editor_plugin.cpp msgid "Sync Bones" @@ -6914,7 +6933,7 @@ msgstr "Preloader Risorsa" #: editor/plugins/root_motion_editor_plugin.cpp msgid "AnimationTree has no path set to an AnimationPlayer" -msgstr "AnimationTree non ha nessun percorso impostato ad un AnimationPlayer" +msgstr "AnimationTree non ha nessun percorso impostato a un AnimationPlayer" #: editor/plugins/root_motion_editor_plugin.cpp msgid "Path to AnimationPlayer is invalid" @@ -6982,10 +7001,11 @@ msgid "Script is not in tool mode, will not be able to run." msgstr "Lo script non è in modalità tool, non sarà possibile eseguirlo." #: editor/plugins/script_editor_plugin.cpp +#, fuzzy msgid "" "To run this script, it must inherit EditorScript and be set to tool mode." msgstr "" -"Per eseguire questo script, esso deve ereditare EditorScript ed essere " +"Per eseguire questo script, esso deve ereditare da EditorScript ed essere " "impostato in modalità tool." #: editor/plugins/script_editor_plugin.cpp @@ -9322,8 +9342,9 @@ msgid "Finds the nearest even integer to the parameter." msgstr "Trova il numero intero pari più vicino al parametro." #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "Clamps the value between 0.0 and 1.0." -msgstr "Blocca il valore tra 0.0 ed 1.0." +msgstr "Blocca il valore tra 0.0 e 1.0." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "Extracts the sign of the parameter." @@ -9342,6 +9363,7 @@ msgid "Returns the square root of the parameter." msgstr "Restituisce la radice quadrata del parametro." #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "" "SmoothStep function( scalar(edge0), scalar(edge1), scalar(x) ).\n" "\n" @@ -9353,7 +9375,7 @@ msgstr "" "\n" "Restituisce 0.0 se \"x\" è più piccolo di \"edge0\", o 1.0 se \"x\" è più " "grande di \"edge1\". Altrimenti, il valore di ritorno è interpolato tra 0.0 " -"ed 1.0 usando i polinomi di Hermite." +"e 1.0 usando i polinomi di Hermite." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" @@ -9430,6 +9452,7 @@ msgid "Transform function." msgstr "Funzione di trasformazione." #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "" "Calculate the outer product of a pair of vectors.\n" "\n" @@ -9513,6 +9536,7 @@ msgid "Calculates the dot product of two vectors." msgstr "Calcola il prodotto scalare di due vettori." #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "" "Returns the vector that points in the same direction as a reference vector. " "The function has three vector parameters : N, the vector to orient, I, the " @@ -9562,6 +9586,7 @@ msgid "Returns the vector that points in the direction of refraction." msgstr "Restituisce un vettore che punta nella direzione della refrazione." #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "" "SmoothStep function( vector(edge0), vector(edge1), vector(x) ).\n" "\n" @@ -9571,11 +9596,12 @@ msgid "" msgstr "" "SmoothStep function( vector(edge0), vector(edge1), vector(x) ).\n" "\n" -"Restituisce 0.0 se \"x\" è minore di \"edge0\", ed 1.0 se \"x\" è più grande " -"di \"edge1\". Altrimenti, il valore di ritorno è interpolato tra 0.0 ed 1.0 " +"Restituisce 0.0 se \"x\" è minore di \"edge0\", e 1.0 se \"x\" è più grande " +"di \"edge1\". Altrimenti, il valore di ritorno è interpolato tra 0.0 e 1.0 " "usando i polinomiali di Hermite." #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "" "SmoothStep function( scalar(edge0), scalar(edge1), vector(x) ).\n" "\n" @@ -9585,8 +9611,8 @@ msgid "" msgstr "" "SmoothStep function( scalar(edge0), scalar(edge1), vector(x) ).\n" "\n" -"Restituisce 0.0 se \"x\" è minore di \"edge0\", ed 1.0 se \"x\" è più grande " -"di \"edge1\". Altrimenti, il valore di ritorno è interpolato tra 0.0 ed 1.0 " +"Restituisce 0.0 se \"x\" è minore di \"edge0\", e 1.0 se \"x\" è più grande " +"di \"edge1\". Altrimenti, il valore di ritorno è interpolato tra 0.0 e 1.0 " "usando i polinomiali di Hermite." #: editor/plugins/visual_shader_editor_plugin.cpp @@ -9638,13 +9664,14 @@ msgid "Vector uniform." msgstr "Uniforme vettore." #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "" "Custom Godot Shader Language expression, with custom amount of input and " "output ports. This is a direct injection of code into the vertex/fragment/" "light function, do not use it to write the function declarations inside." msgstr "" "Una espressione del Custom Godot Shader Language, con quantità " -"personalizzabile di porte input ed output. Questa è una iniezione diretta di " +"personalizzabile di porte input e output. Questa è una iniezione diretta di " "codice nella funzione vertex/fragment/light. Non usarla per scrivere le " "dichiarazione della funzione all'interno." @@ -9654,7 +9681,7 @@ msgid "" "direction of camera (pass associated inputs to it)." msgstr "" "Restituisce il decadimento in base al prodotto scalare della normale della " -"superfice e direzione della telecamera (passa gli input associati ad essa)." +"superfice e direzione della telecamera (passa gli input associati a essa)." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "" @@ -9669,8 +9696,9 @@ msgstr "" "dichiarare varianti, uniformi e costanti." #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "A reference to an existing uniform." -msgstr "Un riferimento ad una uniform esistente." +msgstr "Un riferimento a una uniform esistente." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "(Fragment/Light mode only) Scalar derivative function." @@ -9713,20 +9741,22 @@ msgstr "" "differenziazione locale." #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "" "(Fragment/Light mode only) (Vector) Sum of absolute derivative in 'x' and " "'y'." msgstr "" "(Soltanto modalità Fragment/Light) (Vettore) Somma delle derivate assolute " -"in \"x\" ed \"y\"." +"in \"x\" e \"y\"." #: editor/plugins/visual_shader_editor_plugin.cpp +#, fuzzy msgid "" "(Fragment/Light mode only) (Scalar) Sum of absolute derivative in 'x' and " "'y'." msgstr "" "(Soltanto modalità Fragment/Light) (Scalare) Somma delle derivate assolute " -"in \"x\" ed \"y\"." +"in \"x\" e \"y\"." #: editor/plugins/visual_shader_editor_plugin.cpp msgid "VisualShader" @@ -9757,13 +9787,14 @@ msgstr "" "I template di esportazione sembrano essere mancanti o non validi." #: editor/project_export.cpp +#, fuzzy msgid "" "Failed to export the project for platform '%s'.\n" "This might be due to a configuration issue in the export preset or your " "export settings." msgstr "" "Impossibile esportare il progetto per la piattaforma \"%s\".\n" -"Questo potrebbe essere dovuto ad un problema di configurazione nel preset di " +"Questo potrebbe essere dovuto a un problema di configurazione nel preset di " "esportazione o nelle impostazioni di esportazione." #: editor/project_export.cpp @@ -12264,7 +12295,7 @@ msgstr "L'oggetto base non è un Nodo!" #: modules/visual_script/visual_script_func_nodes.cpp msgid "Path does not lead Node!" -msgstr "Il percorso non conduce ad un Nodo!" +msgstr "Il percorso non conduce a un Nodo!" #: modules/visual_script/visual_script_func_nodes.cpp msgid "Invalid index property name '%s' in node %s." @@ -12676,7 +12707,7 @@ msgid "" "CollisionObject2D derived node. Please only use it as a child of Area2D, " "StaticBody2D, RigidBody2D, KinematicBody2D, etc. to give them a shape." msgstr "" -"CollisionPolygon2D serve a fornire una forma di collisione ad un nodo " +"CollisionPolygon2D serve a fornire una forma di collisione a un nodo " "derivato di CollisionObject2D. Si prega di utilizzarlo solamente come figlio " "di Area2D, StaticBody2D, RigidBody2D, KinematicBody2D, etc. in modo da " "dargli una forma." @@ -12698,13 +12729,14 @@ msgstr "" "costruzione \"Segmenti\"." #: scene/2d/collision_shape_2d.cpp +#, fuzzy msgid "" "CollisionShape2D only serves to provide a collision shape to a " "CollisionObject2D derived node. Please only use it as a child of Area2D, " "StaticBody2D, RigidBody2D, KinematicBody2D, etc. to give them a shape." msgstr "" -"CollisionShape2D serve a fornire una forma di collisione ad un nodo derivato " -"di CollisionObject2D. Si prega di utilizzarlo solamente come figlio di " +"CollisionShape2D serve a fornire una forma di collisione a un nodo derivato " +"da CollisionObject2D. Si prega di utilizzarlo solamente come figlio di " "Area2D, StaticBody2D, RigidBody2D, KinematicBody2D, etc. in modo da dargli " "una forma." @@ -12840,9 +12872,9 @@ msgstr "" "Modifica invece la dimensione nelle forme di collisione figlie." #: scene/2d/remote_transform_2d.cpp +#, fuzzy msgid "Path property must point to a valid Node2D node to work." -msgstr "" -"La proprietà path deve puntare ad un nodo Node2D valido per funzionare." +msgstr "La proprietà path deve puntare a un nodo Node2D valido per funzionare." #: scene/2d/skeleton_2d.cpp msgid "This Bone2D chain should end at a Skeleton2D node." @@ -12888,11 +12920,12 @@ msgid "ARVRController must have an ARVROrigin node as its parent." msgstr "ARVRController deve avere un nodo ARVROrigin come genitore." #: scene/3d/arvr_nodes.cpp +#, fuzzy msgid "" "The controller ID must not be 0 or this controller won't be bound to an " "actual controller." msgstr "" -"L'id del controller non deve essere 0 o non verrà associato ad un controller " +"L'id del controller non deve essere 0 o non verrà associato a un controller " "attuale." #: scene/3d/arvr_nodes.cpp @@ -12900,11 +12933,12 @@ msgid "ARVRAnchor must have an ARVROrigin node as its parent." msgstr "ARVRAnchor deve avere un nodo ARVROrigin come genitore." #: scene/3d/arvr_nodes.cpp +#, fuzzy msgid "" "The anchor ID must not be 0 or this anchor won't be bound to an actual " "anchor." msgstr "" -"L'ID dell'ancora non deve essere 0 oppure non verrà associato ad un'ancora " +"L'ID dell'ancora non deve essere 0 oppure non verrà associato a un'ancora " "attuale." #: scene/3d/arvr_nodes.cpp @@ -12947,28 +12981,29 @@ msgstr "" "definire la sua forma." #: scene/3d/collision_polygon.cpp +#, fuzzy msgid "" "CollisionPolygon only serves to provide a collision shape to a " "CollisionObject derived node. Please only use it as a child of Area, " "StaticBody, RigidBody, KinematicBody, etc. to give them a shape." msgstr "" -"CollisionPolygon serve solamente a fornire una forma di collisione ad un " -"nodo derivato di CollisionObject. Si prega di usarlo solamente come figlio " -"di Area, StaticBody, RigidBody, KinematicBody, etc. in modo da dargli una " -"forma." +"CollisionPolygon serve solamente a fornire una forma di collisione a un nodo " +"derivato da CollisionObject. Si prega di usarlo solamente come figlio di " +"Area, StaticBody, RigidBody, KinematicBody, etc. in modo da dargli una forma." #: scene/3d/collision_polygon.cpp msgid "An empty CollisionPolygon has no effect on collision." msgstr "Un CollisionPolygon vuoto non ha effetti in collisione." #: scene/3d/collision_shape.cpp +#, fuzzy msgid "" "CollisionShape only serves to provide a collision shape to a CollisionObject " "derived node. Please only use it as a child of Area, StaticBody, RigidBody, " "KinematicBody, etc. to give them a shape." msgstr "" -"CollisionShape serve a fornire una forma di collisione ad un nodo derivato " -"di CollisionObject. Si prega di utilizzarlo solamente come figlio di Area, " +"CollisionShape serve a fornire una forma di collisione a un nodo derivato da " +"CollisionObject. Si prega di utilizzarlo solamente come figlio di Area, " "StaticBody, RigidBody, KinematicBody, etc. in modo da dargli una forma." #: scene/3d/collision_shape.cpp @@ -13288,13 +13323,14 @@ msgid "If \"Exp Edit\" is enabled, \"Min Value\" must be greater than 0." msgstr "Se \"Exp Edit\" è abilitato, \"Min Value\" deve essere maggiore di 0." #: scene/gui/scroll_container.cpp +#, fuzzy msgid "" "ScrollContainer is intended to work with a single child control.\n" "Use a container as child (VBox, HBox, etc.), or a Control and set the custom " "minimum size manually." msgstr "" "ScrollContainer è inteso per funzionare con un singolo figlio di controllo.\n" -"Usa un container come figlio (VBox, HBox, ect.), oppure un nodo Control ed " +"Usa un container come figlio (VBox, HBox, ect.), oppure un nodo Control e " "imposta la dimensione minima personalizzata manualmente." #: scene/gui/tree.cpp diff --git a/editor/translations/ja.po b/editor/translations/ja.po index 1fd770fe13..45977a890f 100644 --- a/editor/translations/ja.po +++ b/editor/translations/ja.po @@ -5214,9 +5214,10 @@ msgstr "" "シーンを保存してから再度行ってください。" #: editor/plugins/baked_lightmap_editor_plugin.cpp +#, fuzzy msgid "" -"No meshes to bake. Make sure they contain an UV2 channel and that the 'Bake " -"Light' flag is on." +"No meshes to bake. Make sure they contain an UV2 channel and that the 'Use " +"In Baked Light' and 'Generate Lightmap' flags are on." msgstr "" "ベイクするメッシュがありません。メッシュに UV2チャンネルが含まれてお" "り、'Bake Light' フラグがオンになっていることを確認してください。" diff --git a/editor/translations/ka.po b/editor/translations/ka.po index 587624651a..7a108d6f95 100644 --- a/editor/translations/ka.po +++ b/editor/translations/ka.po @@ -5176,8 +5176,8 @@ msgstr "" #: editor/plugins/baked_lightmap_editor_plugin.cpp msgid "" -"No meshes to bake. Make sure they contain an UV2 channel and that the 'Bake " -"Light' flag is on." +"No meshes to bake. Make sure they contain an UV2 channel and that the 'Use " +"In Baked Light' and 'Generate Lightmap' flags are on." msgstr "" #: editor/plugins/baked_lightmap_editor_plugin.cpp diff --git a/editor/translations/km.po b/editor/translations/km.po index fe396cf590..33e9b00daf 100644 --- a/editor/translations/km.po +++ b/editor/translations/km.po @@ -4986,8 +4986,8 @@ msgstr "" #: editor/plugins/baked_lightmap_editor_plugin.cpp msgid "" -"No meshes to bake. Make sure they contain an UV2 channel and that the 'Bake " -"Light' flag is on." +"No meshes to bake. Make sure they contain an UV2 channel and that the 'Use " +"In Baked Light' and 'Generate Lightmap' flags are on." msgstr "" #: editor/plugins/baked_lightmap_editor_plugin.cpp diff --git a/editor/translations/ko.po b/editor/translations/ko.po index ec9fed24ca..877f572f48 100644 --- a/editor/translations/ko.po +++ b/editor/translations/ko.po @@ -27,7 +27,7 @@ msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2021-06-20 13:35+0000\n" +"PO-Revision-Date: 2021-07-16 05:47+0000\n" "Last-Translator: Myeongjin Lee <aranet100@gmail.com>\n" "Language-Team: Korean <https://hosted.weblate.org/projects/godot-engine/" "godot/ko/>\n" @@ -36,7 +36,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Weblate 4.7\n" +"X-Generator: Weblate 4.7.2-dev\n" #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp @@ -5182,9 +5182,10 @@ msgstr "" "당신의 씬을 저장하고 다시 시도하세요." #: editor/plugins/baked_lightmap_editor_plugin.cpp +#, fuzzy msgid "" -"No meshes to bake. Make sure they contain an UV2 channel and that the 'Bake " -"Light' flag is on." +"No meshes to bake. Make sure they contain an UV2 channel and that the 'Use " +"In Baked Light' and 'Generate Lightmap' flags are on." msgstr "" "라이트맵을 구울 메시가 없습니다. 메시가 UV2 채널을 갖고 있고 'Bake Light' 플" "래그가 켜져 있는지 확인해주세요." diff --git a/editor/translations/lt.po b/editor/translations/lt.po index 6df1f44cfb..f4043f1de2 100644 --- a/editor/translations/lt.po +++ b/editor/translations/lt.po @@ -5145,8 +5145,8 @@ msgstr "" #: editor/plugins/baked_lightmap_editor_plugin.cpp msgid "" -"No meshes to bake. Make sure they contain an UV2 channel and that the 'Bake " -"Light' flag is on." +"No meshes to bake. Make sure they contain an UV2 channel and that the 'Use " +"In Baked Light' and 'Generate Lightmap' flags are on." msgstr "" #: editor/plugins/baked_lightmap_editor_plugin.cpp diff --git a/editor/translations/lv.po b/editor/translations/lv.po index 8c8a0011c7..a4c8d10715 100644 --- a/editor/translations/lv.po +++ b/editor/translations/lv.po @@ -5038,8 +5038,8 @@ msgstr "" #: editor/plugins/baked_lightmap_editor_plugin.cpp msgid "" -"No meshes to bake. Make sure they contain an UV2 channel and that the 'Bake " -"Light' flag is on." +"No meshes to bake. Make sure they contain an UV2 channel and that the 'Use " +"In Baked Light' and 'Generate Lightmap' flags are on." msgstr "" #: editor/plugins/baked_lightmap_editor_plugin.cpp diff --git a/editor/translations/mi.po b/editor/translations/mi.po index 36a93be0ee..5a847e6594 100644 --- a/editor/translations/mi.po +++ b/editor/translations/mi.po @@ -4978,8 +4978,8 @@ msgstr "" #: editor/plugins/baked_lightmap_editor_plugin.cpp msgid "" -"No meshes to bake. Make sure they contain an UV2 channel and that the 'Bake " -"Light' flag is on." +"No meshes to bake. Make sure they contain an UV2 channel and that the 'Use " +"In Baked Light' and 'Generate Lightmap' flags are on." msgstr "" #: editor/plugins/baked_lightmap_editor_plugin.cpp diff --git a/editor/translations/mk.po b/editor/translations/mk.po index 7e5aa06f3c..001542b888 100644 --- a/editor/translations/mk.po +++ b/editor/translations/mk.po @@ -4985,8 +4985,8 @@ msgstr "" #: editor/plugins/baked_lightmap_editor_plugin.cpp msgid "" -"No meshes to bake. Make sure they contain an UV2 channel and that the 'Bake " -"Light' flag is on." +"No meshes to bake. Make sure they contain an UV2 channel and that the 'Use " +"In Baked Light' and 'Generate Lightmap' flags are on." msgstr "" #: editor/plugins/baked_lightmap_editor_plugin.cpp diff --git a/editor/translations/ml.po b/editor/translations/ml.po index 3919011ade..f7bc8349bc 100644 --- a/editor/translations/ml.po +++ b/editor/translations/ml.po @@ -4993,8 +4993,8 @@ msgstr "" #: editor/plugins/baked_lightmap_editor_plugin.cpp msgid "" -"No meshes to bake. Make sure they contain an UV2 channel and that the 'Bake " -"Light' flag is on." +"No meshes to bake. Make sure they contain an UV2 channel and that the 'Use " +"In Baked Light' and 'Generate Lightmap' flags are on." msgstr "" #: editor/plugins/baked_lightmap_editor_plugin.cpp diff --git a/editor/translations/mr.po b/editor/translations/mr.po index 4d81595cb1..66157f77d1 100644 --- a/editor/translations/mr.po +++ b/editor/translations/mr.po @@ -4985,8 +4985,8 @@ msgstr "" #: editor/plugins/baked_lightmap_editor_plugin.cpp msgid "" -"No meshes to bake. Make sure they contain an UV2 channel and that the 'Bake " -"Light' flag is on." +"No meshes to bake. Make sure they contain an UV2 channel and that the 'Use " +"In Baked Light' and 'Generate Lightmap' flags are on." msgstr "" #: editor/plugins/baked_lightmap_editor_plugin.cpp diff --git a/editor/translations/ms.po b/editor/translations/ms.po index 6226d644a3..d8714d6196 100644 --- a/editor/translations/ms.po +++ b/editor/translations/ms.po @@ -14,7 +14,7 @@ msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2021-05-29 13:49+0000\n" +"PO-Revision-Date: 2021-07-23 12:59+0000\n" "Last-Translator: Keviindran Ramachandran <keviinx@yahoo.com>\n" "Language-Team: Malay <https://hosted.weblate.org/projects/godot-engine/godot/" "ms/>\n" @@ -23,7 +23,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Weblate 4.7-dev\n" +"X-Generator: Weblate 4.7.2-dev\n" #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp @@ -459,7 +459,7 @@ msgstr "Kunci Gerak Anim" #: editor/animation_track_editor.cpp #: modules/visual_script/visual_script_editor.cpp msgid "Clipboard is empty!" -msgstr "" +msgstr "Papan klip kosong!" #: editor/animation_track_editor.cpp msgid "Paste Tracks" @@ -1122,7 +1122,7 @@ msgstr "Terima kasih dari komuniti Godot!" #: editor/editor_about.cpp editor/editor_node.cpp editor/project_manager.cpp msgid "Click to copy." -msgstr "" +msgstr "Klik untuk salin." #: editor/editor_about.cpp msgid "Godot Engine contributors" @@ -1624,16 +1624,15 @@ msgstr "" "GLES3. Aktifkan 'Import Etc 2' atau 'Import Pvrtc' dalam Tetapan Projek." #: editor/editor_export.cpp -#, fuzzy msgid "" "Target platform requires 'PVRTC' texture compression for the driver fallback " "to GLES2.\n" "Enable 'Import Pvrtc' in Project Settings, or disable 'Driver Fallback " "Enabled'." msgstr "" -"Platform sasaran memerlukan pemampatan tekstur 'ETC' untuk sandaran pemandu " +"Platform sasaran memerlukan pemampatan tekstur 'PVRTC' untuk sandaran driver " "ke GLES2.\n" -"Aktifkan 'Import Etc' dalam Tetapan Projek, atau nyahaktifkan 'Driver " +"Aktifkan 'Import Pvrtc' dalam Tetapan Projek, atau nyahaktifkan 'Driver " "Fallback Enabled'." #: editor/editor_export.cpp platform/android/export/export.cpp @@ -2335,9 +2334,8 @@ msgid "Layout name not found!" msgstr "Nama susun atur tidak dijumpai!" #: editor/editor_node.cpp -#, fuzzy msgid "Restored the Default layout to its base settings." -msgstr "Tata letak lalai telah dipulihkan ke tetapan asas." +msgstr "Susun atur lalai telah dipulihkan ke tetapan asas." #: editor/editor_node.cpp msgid "" @@ -4501,34 +4499,34 @@ msgstr "Tetapkan kedudukan pengadunan dalam ruang" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp msgid "Select and move points, create points with RMB." -msgstr "" +msgstr "Pilih dan pindahkan titik-titik, cipta titik-titik dengan RMB." #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp scene/gui/graph_edit.cpp msgid "Enable snap and show grid." -msgstr "" +msgstr "Aktifkan snap dan tunjukkan grid." #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp msgid "Point" -msgstr "" +msgstr "Titik" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp #: editor/plugins/animation_blend_tree_editor_plugin.cpp msgid "Open Editor" -msgstr "" +msgstr "Buka Editor" #: editor/plugins/animation_blend_space_1d_editor.cpp #: editor/plugins/animation_blend_space_2d_editor.cpp #: editor/plugins/animation_blend_tree_editor_plugin.cpp #: editor/plugins/animation_state_machine_editor.cpp msgid "Open Animation Node" -msgstr "" +msgstr "Buka Nod Animasi" #: editor/plugins/animation_blend_space_2d_editor.cpp msgid "Triangle already exists." -msgstr "" +msgstr "Segi tiga sudah wujud." #: editor/plugins/animation_blend_space_2d_editor.cpp #, fuzzy @@ -4537,39 +4535,40 @@ msgstr "Anim Tambah Trek" #: editor/plugins/animation_blend_space_2d_editor.cpp msgid "Change BlendSpace2D Limits" -msgstr "" +msgstr "Tukar Had-had BlendSpace2D" #: editor/plugins/animation_blend_space_2d_editor.cpp msgid "Change BlendSpace2D Labels" -msgstr "" +msgstr "Tukar Label-label BlendSpace2D" #: editor/plugins/animation_blend_space_2d_editor.cpp msgid "Remove BlendSpace2D Point" -msgstr "" +msgstr "Keluarkan Titik BlendSpace2D" #: editor/plugins/animation_blend_space_2d_editor.cpp msgid "Remove BlendSpace2D Triangle" -msgstr "" +msgstr "Keluarkan Segi tiga BlendSpace2D" #: editor/plugins/animation_blend_space_2d_editor.cpp +#, fuzzy msgid "BlendSpace2D does not belong to an AnimationTree node." -msgstr "" +msgstr "BlendSpace2D bukan milik nod AnimationTree." #: editor/plugins/animation_blend_space_2d_editor.cpp msgid "No triangles exist, so no blending can take place." -msgstr "" +msgstr "Tiada segi tiga-segi tiga wujud, jadi tiada pengadunan boleh berlaku." #: editor/plugins/animation_blend_space_2d_editor.cpp msgid "Toggle Auto Triangles" -msgstr "" +msgstr "Togol Segi Tiga Auto" #: editor/plugins/animation_blend_space_2d_editor.cpp msgid "Create triangles by connecting points." -msgstr "" +msgstr "Cipta segi tiga dengan menhubungkan titik-titik." #: editor/plugins/animation_blend_space_2d_editor.cpp msgid "Erase points and triangles." -msgstr "" +msgstr "Padamkan titik-titik dan segi tiga-segi tiga." #: editor/plugins/animation_blend_space_2d_editor.cpp msgid "Generate blend triangles automatically (instead of manually)" @@ -5334,8 +5333,8 @@ msgstr "" #: editor/plugins/baked_lightmap_editor_plugin.cpp msgid "" -"No meshes to bake. Make sure they contain an UV2 channel and that the 'Bake " -"Light' flag is on." +"No meshes to bake. Make sure they contain an UV2 channel and that the 'Use " +"In Baked Light' and 'Generate Lightmap' flags are on." msgstr "" #: editor/plugins/baked_lightmap_editor_plugin.cpp diff --git a/editor/translations/nb.po b/editor/translations/nb.po index 042ee8d26f..c36274abba 100644 --- a/editor/translations/nb.po +++ b/editor/translations/nb.po @@ -5427,8 +5427,8 @@ msgstr "" #: editor/plugins/baked_lightmap_editor_plugin.cpp msgid "" -"No meshes to bake. Make sure they contain an UV2 channel and that the 'Bake " -"Light' flag is on." +"No meshes to bake. Make sure they contain an UV2 channel and that the 'Use " +"In Baked Light' and 'Generate Lightmap' flags are on." msgstr "" #: editor/plugins/baked_lightmap_editor_plugin.cpp diff --git a/editor/translations/nl.po b/editor/translations/nl.po index 2410cd5ad0..296291e435 100644 --- a/editor/translations/nl.po +++ b/editor/translations/nl.po @@ -46,12 +46,13 @@ # T-rex08 <ipadtriceratops@gmail.com>, 2021. # Dwarffish <hoogvlietjohan@gmail.com>, 2021. # Arthur de Roos <arthur.de.roos@gmail.com>, 2021. +# Vancha March <tjipkevdh@gmail.com>, 2021. msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2021-06-05 08:32+0000\n" -"Last-Translator: Stijn Hinlopen <f.a.hinlopen@gmail.com>\n" +"PO-Revision-Date: 2021-07-26 14:18+0000\n" +"Last-Translator: Vancha March <tjipkevdh@gmail.com>\n" "Language-Team: Dutch <https://hosted.weblate.org/projects/godot-engine/godot/" "nl/>\n" "Language: nl\n" @@ -59,7 +60,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 4.7-dev\n" +"X-Generator: Weblate 4.7.2-dev\n" #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp @@ -1162,7 +1163,7 @@ msgstr "Bedankt van de Godot gemeenschap!" #: editor/editor_about.cpp editor/editor_node.cpp editor/project_manager.cpp msgid "Click to copy." -msgstr "" +msgstr "Klik om te kopiëren." #: editor/editor_about.cpp msgid "Godot Engine contributors" @@ -5243,9 +5244,10 @@ msgstr "" "Sla uw scène op en probeer opnieuw." #: editor/plugins/baked_lightmap_editor_plugin.cpp +#, fuzzy msgid "" -"No meshes to bake. Make sure they contain an UV2 channel and that the 'Bake " -"Light' flag is on." +"No meshes to bake. Make sure they contain an UV2 channel and that the 'Use " +"In Baked Light' and 'Generate Lightmap' flags are on." msgstr "" "Geen meshes om te bakken. Zorg ervoor dat ze een UV2 kanaal bevatten en dat " "'Bake Light' vlag aan staat." diff --git a/editor/translations/or.po b/editor/translations/or.po index 87528cdac5..c1d191a4a5 100644 --- a/editor/translations/or.po +++ b/editor/translations/or.po @@ -4984,8 +4984,8 @@ msgstr "" #: editor/plugins/baked_lightmap_editor_plugin.cpp msgid "" -"No meshes to bake. Make sure they contain an UV2 channel and that the 'Bake " -"Light' flag is on." +"No meshes to bake. Make sure they contain an UV2 channel and that the 'Use " +"In Baked Light' and 'Generate Lightmap' flags are on." msgstr "" #: editor/plugins/baked_lightmap_editor_plugin.cpp diff --git a/editor/translations/pl.po b/editor/translations/pl.po index 3c51593e02..d933e8f92b 100644 --- a/editor/translations/pl.po +++ b/editor/translations/pl.po @@ -52,8 +52,8 @@ msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2021-07-05 14:32+0000\n" -"Last-Translator: Rafal Brozio <rafal.brozio@gmail.com>\n" +"PO-Revision-Date: 2021-07-16 05:47+0000\n" +"Last-Translator: Tomek <kobewi4e@gmail.com>\n" "Language-Team: Polish <https://hosted.weblate.org/projects/godot-engine/" "godot/pl/>\n" "Language: pl\n" @@ -62,7 +62,7 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 " "|| n%100>=20) ? 1 : 2;\n" -"X-Generator: Weblate 4.8-dev\n" +"X-Generator: Weblate 4.7.2-dev\n" #: core/math/expression.cpp modules/gdscript/gdscript_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp @@ -5229,9 +5229,10 @@ msgstr "" "Zapisz scenę i spróbuj ponownie." #: editor/plugins/baked_lightmap_editor_plugin.cpp +#, fuzzy msgid "" -"No meshes to bake. Make sure they contain an UV2 channel and that the 'Bake " -"Light' flag is on." +"No meshes to bake. Make sure they contain an UV2 channel and that the 'Use " +"In Baked Light' and 'Generate Lightmap' flags are on." msgstr "" "Brak siatek do cieniowania. Upewnij się, że zawierają kanał UV2 i że flaga " "\"Bake Light\" jest ustawiona." @@ -5760,7 +5761,7 @@ msgstr "Powiększ do zaznaczenia" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Preview Canvas Scale" -msgstr "Skala płótna podglądu" +msgstr "Podejrzyj skalę płótna" #: editor/plugins/canvas_item_editor_plugin.cpp msgid "Translation mask for inserting keys." diff --git a/editor/translations/pr.po b/editor/translations/pr.po index 675c9cf506..9b586ad756 100644 --- a/editor/translations/pr.po +++ b/editor/translations/pr.po @@ -5153,8 +5153,8 @@ msgstr "" #: editor/plugins/baked_lightmap_editor_plugin.cpp msgid "" -"No meshes to bake. Make sure they contain an UV2 channel and that the 'Bake " -"Light' flag is on." +"No meshes to bake. Make sure they contain an UV2 channel and that the 'Use " +"In Baked Light' and 'Generate Lightmap' flags are on." msgstr "" #: editor/plugins/baked_lightmap_editor_plugin.cpp diff --git a/editor/translations/pt.po b/editor/translations/pt.po index 17b1861821..6eb24001a5 100644 --- a/editor/translations/pt.po +++ b/editor/translations/pt.po @@ -5209,9 +5209,10 @@ msgstr "" "Guarde a sua cena e tente novamente." #: editor/plugins/baked_lightmap_editor_plugin.cpp +#, fuzzy msgid "" -"No meshes to bake. Make sure they contain an UV2 channel and that the 'Bake " -"Light' flag is on." +"No meshes to bake. Make sure they contain an UV2 channel and that the 'Use " +"In Baked Light' and 'Generate Lightmap' flags are on." msgstr "" "Não há malhas para consolidar. Assegure-se que contêm um canal UV2 e que a " "referência 'Bake Light' flag está on." diff --git a/editor/translations/pt_BR.po b/editor/translations/pt_BR.po index e79dd0fa19..01f6220bbd 100644 --- a/editor/translations/pt_BR.po +++ b/editor/translations/pt_BR.po @@ -5320,9 +5320,10 @@ msgstr "" "Salve sua cena e tente novamente." #: editor/plugins/baked_lightmap_editor_plugin.cpp +#, fuzzy msgid "" -"No meshes to bake. Make sure they contain an UV2 channel and that the 'Bake " -"Light' flag is on." +"No meshes to bake. Make sure they contain an UV2 channel and that the 'Use " +"In Baked Light' and 'Generate Lightmap' flags are on." msgstr "" "Não há malhas para preparar. Certifique-se de que elas possuem um canal UV2 " "e que a propriedade \"Preparar Luz\" está habilitada." diff --git a/editor/translations/ro.po b/editor/translations/ro.po index 7ac06fc1b1..3b5af5fe1a 100644 --- a/editor/translations/ro.po +++ b/editor/translations/ro.po @@ -5218,9 +5218,10 @@ msgstr "" "cale de salvare din proprietățile BakedLightmap." #: editor/plugins/baked_lightmap_editor_plugin.cpp +#, fuzzy msgid "" -"No meshes to bake. Make sure they contain an UV2 channel and that the 'Bake " -"Light' flag is on." +"No meshes to bake. Make sure they contain an UV2 channel and that the 'Use " +"In Baked Light' and 'Generate Lightmap' flags are on." msgstr "" "Nicio structură pentru procesare. Asigură-te că acestea conțin un canal UV2 " "și că opțiunea 'Procesează Lumina' este pornită." diff --git a/editor/translations/ru.po b/editor/translations/ru.po index 4b56d21383..e02b70b16d 100644 --- a/editor/translations/ru.po +++ b/editor/translations/ru.po @@ -97,12 +97,13 @@ # Bualma Show <appleaidar6@gmail.com>, 2021. # enderlorde <madel.laboratories@gmail.com>, 2021. # Олег Довгер <oleg.a.dovger@gmail.com>, 2021. +# Anna Malinovskaia <tacitcoast@gmail.com>, 2021. msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2021-07-13 06:13+0000\n" -"Last-Translator: Danil Alexeev <danil@alexeev.xyz>\n" +"PO-Revision-Date: 2021-07-19 09:34+0000\n" +"Last-Translator: Anna Malinovskaia <tacitcoast@gmail.com>\n" "Language-Team: Russian <https://hosted.weblate.org/projects/godot-engine/" "godot/ru/>\n" "Language: ru\n" @@ -5286,9 +5287,10 @@ msgstr "" "Сохраните сцену и попробуйте ещё раз." #: editor/plugins/baked_lightmap_editor_plugin.cpp +#, fuzzy msgid "" -"No meshes to bake. Make sure they contain an UV2 channel and that the 'Bake " -"Light' flag is on." +"No meshes to bake. Make sure they contain an UV2 channel and that the 'Use " +"In Baked Light' and 'Generate Lightmap' flags are on." msgstr "" "Нет полисеток для запекания. Убедитесь, что они содержат канал UV2 и что " "флаг «Запекание света» включён." diff --git a/editor/translations/si.po b/editor/translations/si.po index a5586af274..36abdd4774 100644 --- a/editor/translations/si.po +++ b/editor/translations/si.po @@ -5024,8 +5024,8 @@ msgstr "" #: editor/plugins/baked_lightmap_editor_plugin.cpp msgid "" -"No meshes to bake. Make sure they contain an UV2 channel and that the 'Bake " -"Light' flag is on." +"No meshes to bake. Make sure they contain an UV2 channel and that the 'Use " +"In Baked Light' and 'Generate Lightmap' flags are on." msgstr "" #: editor/plugins/baked_lightmap_editor_plugin.cpp diff --git a/editor/translations/sk.po b/editor/translations/sk.po index d97e1321ef..cb56bb037e 100644 --- a/editor/translations/sk.po +++ b/editor/translations/sk.po @@ -5183,9 +5183,10 @@ msgstr "" "na uloženie so BakedLightmap vlastností." #: editor/plugins/baked_lightmap_editor_plugin.cpp +#, fuzzy msgid "" -"No meshes to bake. Make sure they contain an UV2 channel and that the 'Bake " -"Light' flag is on." +"No meshes to bake. Make sure they contain an UV2 channel and that the 'Use " +"In Baked Light' and 'Generate Lightmap' flags are on." msgstr "" "Žiadne mesh-e na bake. Uistite sa že obsahujú UV2 channel a je na ňom 'Bake " "Light' vlajka." diff --git a/editor/translations/sl.po b/editor/translations/sl.po index 07bd33c389..42f0bfc2cb 100644 --- a/editor/translations/sl.po +++ b/editor/translations/sl.po @@ -5419,9 +5419,10 @@ msgstr "" "shranitev iz lastnosti Zapečene Svetlobne karte." #: editor/plugins/baked_lightmap_editor_plugin.cpp +#, fuzzy msgid "" -"No meshes to bake. Make sure they contain an UV2 channel and that the 'Bake " -"Light' flag is on." +"No meshes to bake. Make sure they contain an UV2 channel and that the 'Use " +"In Baked Light' and 'Generate Lightmap' flags are on." msgstr "" "Brez modelov za peko. Poskrbi, da vsebujejo kanal UV2 in da je vključena " "oznaka 'Zapeči Svetlobo'." diff --git a/editor/translations/sq.po b/editor/translations/sq.po index 49a42b5553..f054de99bd 100644 --- a/editor/translations/sq.po +++ b/editor/translations/sq.po @@ -5273,8 +5273,8 @@ msgstr "" #: editor/plugins/baked_lightmap_editor_plugin.cpp msgid "" -"No meshes to bake. Make sure they contain an UV2 channel and that the 'Bake " -"Light' flag is on." +"No meshes to bake. Make sure they contain an UV2 channel and that the 'Use " +"In Baked Light' and 'Generate Lightmap' flags are on." msgstr "" #: editor/plugins/baked_lightmap_editor_plugin.cpp diff --git a/editor/translations/sr_Cyrl.po b/editor/translations/sr_Cyrl.po index 53fb04b3e4..5d4f6cab1b 100644 --- a/editor/translations/sr_Cyrl.po +++ b/editor/translations/sr_Cyrl.po @@ -5682,8 +5682,8 @@ msgstr "" #: editor/plugins/baked_lightmap_editor_plugin.cpp #, fuzzy msgid "" -"No meshes to bake. Make sure they contain an UV2 channel and that the 'Bake " -"Light' flag is on." +"No meshes to bake. Make sure they contain an UV2 channel and that the 'Use " +"In Baked Light' and 'Generate Lightmap' flags are on." msgstr "" "Нема мрежа за печење. Провери да ли садрже UV2 канал и да је опција 'Изпеци " "Светла' укључена." diff --git a/editor/translations/sr_Latn.po b/editor/translations/sr_Latn.po index 0a90379b41..49f7cd7f3e 100644 --- a/editor/translations/sr_Latn.po +++ b/editor/translations/sr_Latn.po @@ -5048,8 +5048,8 @@ msgstr "" #: editor/plugins/baked_lightmap_editor_plugin.cpp msgid "" -"No meshes to bake. Make sure they contain an UV2 channel and that the 'Bake " -"Light' flag is on." +"No meshes to bake. Make sure they contain an UV2 channel and that the 'Use " +"In Baked Light' and 'Generate Lightmap' flags are on." msgstr "" #: editor/plugins/baked_lightmap_editor_plugin.cpp diff --git a/editor/translations/sv.po b/editor/translations/sv.po index 0c5db25a9a..79c1c4a1b9 100644 --- a/editor/translations/sv.po +++ b/editor/translations/sv.po @@ -5277,8 +5277,8 @@ msgstr "" #: editor/plugins/baked_lightmap_editor_plugin.cpp msgid "" -"No meshes to bake. Make sure they contain an UV2 channel and that the 'Bake " -"Light' flag is on." +"No meshes to bake. Make sure they contain an UV2 channel and that the 'Use " +"In Baked Light' and 'Generate Lightmap' flags are on." msgstr "" #: editor/plugins/baked_lightmap_editor_plugin.cpp diff --git a/editor/translations/ta.po b/editor/translations/ta.po index 0c9022b097..45eef9a8f6 100644 --- a/editor/translations/ta.po +++ b/editor/translations/ta.po @@ -5033,8 +5033,8 @@ msgstr "" #: editor/plugins/baked_lightmap_editor_plugin.cpp msgid "" -"No meshes to bake. Make sure they contain an UV2 channel and that the 'Bake " -"Light' flag is on." +"No meshes to bake. Make sure they contain an UV2 channel and that the 'Use " +"In Baked Light' and 'Generate Lightmap' flags are on." msgstr "" #: editor/plugins/baked_lightmap_editor_plugin.cpp diff --git a/editor/translations/te.po b/editor/translations/te.po index 8274d5520f..47338f3f28 100644 --- a/editor/translations/te.po +++ b/editor/translations/te.po @@ -4987,8 +4987,8 @@ msgstr "" #: editor/plugins/baked_lightmap_editor_plugin.cpp msgid "" -"No meshes to bake. Make sure they contain an UV2 channel and that the 'Bake " -"Light' flag is on." +"No meshes to bake. Make sure they contain an UV2 channel and that the 'Use " +"In Baked Light' and 'Generate Lightmap' flags are on." msgstr "" #: editor/plugins/baked_lightmap_editor_plugin.cpp diff --git a/editor/translations/th.po b/editor/translations/th.po index e9c2a80a49..fc38c35df9 100644 --- a/editor/translations/th.po +++ b/editor/translations/th.po @@ -5125,9 +5125,10 @@ msgstr "" "ลองบันทึกฉากของคุณแล้วลองอีกครั้ง" #: editor/plugins/baked_lightmap_editor_plugin.cpp +#, fuzzy msgid "" -"No meshes to bake. Make sure they contain an UV2 channel and that the 'Bake " -"Light' flag is on." +"No meshes to bake. Make sure they contain an UV2 channel and that the 'Use " +"In Baked Light' and 'Generate Lightmap' flags are on." msgstr "" "ไม่มีพื้นผิวให้สร้าง lightmap กรุณาตรวจสอบว่าพื้นผิวมี UV2 และได้เปิดใช้งาน 'Bake Light'" diff --git a/editor/translations/tr.po b/editor/translations/tr.po index 578d7b48d0..4f3eb3ff60 100644 --- a/editor/translations/tr.po +++ b/editor/translations/tr.po @@ -5250,9 +5250,10 @@ msgstr "" "Sahneyi kaydedip tekrar deneyin." #: editor/plugins/baked_lightmap_editor_plugin.cpp +#, fuzzy msgid "" -"No meshes to bake. Make sure they contain an UV2 channel and that the 'Bake " -"Light' flag is on." +"No meshes to bake. Make sure they contain an UV2 channel and that the 'Use " +"In Baked Light' and 'Generate Lightmap' flags are on." msgstr "" "Pişirilecek örüntüler yok. Örüntülerin UV2 kanalı içerdiğinden ve 'Bake " "Light' bayrağınının açık olduğundan emin olun." diff --git a/editor/translations/tt.po b/editor/translations/tt.po index 3e63f2369d..d5d41b7879 100644 --- a/editor/translations/tt.po +++ b/editor/translations/tt.po @@ -4987,8 +4987,8 @@ msgstr "" #: editor/plugins/baked_lightmap_editor_plugin.cpp msgid "" -"No meshes to bake. Make sure they contain an UV2 channel and that the 'Bake " -"Light' flag is on." +"No meshes to bake. Make sure they contain an UV2 channel and that the 'Use " +"In Baked Light' and 'Generate Lightmap' flags are on." msgstr "" #: editor/plugins/baked_lightmap_editor_plugin.cpp diff --git a/editor/translations/tzm.po b/editor/translations/tzm.po index 0b0ce7d01e..fdb092c6a4 100644 --- a/editor/translations/tzm.po +++ b/editor/translations/tzm.po @@ -4985,8 +4985,8 @@ msgstr "" #: editor/plugins/baked_lightmap_editor_plugin.cpp msgid "" -"No meshes to bake. Make sure they contain an UV2 channel and that the 'Bake " -"Light' flag is on." +"No meshes to bake. Make sure they contain an UV2 channel and that the 'Use " +"In Baked Light' and 'Generate Lightmap' flags are on." msgstr "" #: editor/plugins/baked_lightmap_editor_plugin.cpp diff --git a/editor/translations/uk.po b/editor/translations/uk.po index 50508c5df3..66c69938f6 100644 --- a/editor/translations/uk.po +++ b/editor/translations/uk.po @@ -5222,9 +5222,10 @@ msgstr "" "Збережіть вашу сцену і повторіть спробу." #: editor/plugins/baked_lightmap_editor_plugin.cpp +#, fuzzy msgid "" -"No meshes to bake. Make sure they contain an UV2 channel and that the 'Bake " -"Light' flag is on." +"No meshes to bake. Make sure they contain an UV2 channel and that the 'Use " +"In Baked Light' and 'Generate Lightmap' flags are on." msgstr "" "Немає полісеток для запікання. Переконайтеся, що вони містять канал UV2 і що " "прапор 'Запікання світла' включений." diff --git a/editor/translations/ur_PK.po b/editor/translations/ur_PK.po index 0a213a2bdf..5476915ea5 100644 --- a/editor/translations/ur_PK.po +++ b/editor/translations/ur_PK.po @@ -5091,8 +5091,8 @@ msgstr "" #: editor/plugins/baked_lightmap_editor_plugin.cpp msgid "" -"No meshes to bake. Make sure they contain an UV2 channel and that the 'Bake " -"Light' flag is on." +"No meshes to bake. Make sure they contain an UV2 channel and that the 'Use " +"In Baked Light' and 'Generate Lightmap' flags are on." msgstr "" #: editor/plugins/baked_lightmap_editor_plugin.cpp diff --git a/editor/translations/vi.po b/editor/translations/vi.po index 0104d05502..4267f19def 100644 --- a/editor/translations/vi.po +++ b/editor/translations/vi.po @@ -5156,8 +5156,8 @@ msgstr "" #: editor/plugins/baked_lightmap_editor_plugin.cpp msgid "" -"No meshes to bake. Make sure they contain an UV2 channel and that the 'Bake " -"Light' flag is on." +"No meshes to bake. Make sure they contain an UV2 channel and that the 'Use " +"In Baked Light' and 'Generate Lightmap' flags are on." msgstr "" #: editor/plugins/baked_lightmap_editor_plugin.cpp diff --git a/editor/translations/zh_CN.po b/editor/translations/zh_CN.po index 4393cb4e08..c5b0c34c74 100644 --- a/editor/translations/zh_CN.po +++ b/editor/translations/zh_CN.po @@ -83,7 +83,7 @@ msgid "" msgstr "" "Project-Id-Version: Chinese (Simplified) (Godot Engine)\n" "POT-Creation-Date: 2018-01-20 12:15+0200\n" -"PO-Revision-Date: 2021-07-13 06:13+0000\n" +"PO-Revision-Date: 2021-07-23 12:59+0000\n" "Last-Translator: Haoyu Qiu <timothyqiu32@gmail.com>\n" "Language-Team: Chinese (Simplified) <https://hosted.weblate.org/projects/" "godot-engine/godot/zh_Hans/>\n" @@ -1172,7 +1172,7 @@ msgstr "改变字典值" #: editor/editor_about.cpp msgid "Thanks from the Godot community!" -msgstr "Godot 社区感谢你!" +msgstr "Godot 社区感谢大家!" #: editor/editor_about.cpp editor/editor_node.cpp editor/project_manager.cpp msgid "Click to copy." @@ -5171,9 +5171,10 @@ msgstr "" "BakedLightmap 属性。" #: editor/plugins/baked_lightmap_editor_plugin.cpp +#, fuzzy msgid "" -"No meshes to bake. Make sure they contain an UV2 channel and that the 'Bake " -"Light' flag is on." +"No meshes to bake. Make sure they contain an UV2 channel and that the 'Use " +"In Baked Light' and 'Generate Lightmap' flags are on." msgstr "没有可烘焙的网格。请确保网格包含 UV2 通道并且勾选 “Bake Light” 选项。" #: editor/plugins/baked_lightmap_editor_plugin.cpp @@ -7338,7 +7339,7 @@ msgstr "顶视图。" #: editor/plugins/spatial_editor_plugin.cpp msgid "Bottom View." -msgstr "仰视图。" +msgstr "底视图。" #: editor/plugins/spatial_editor_plugin.cpp msgid "Bottom" @@ -7547,11 +7548,11 @@ msgstr "使用吸附" #: editor/plugins/spatial_editor_plugin.cpp msgid "Bottom View" -msgstr "仰视图" +msgstr "底视图" #: editor/plugins/spatial_editor_plugin.cpp msgid "Top View" -msgstr "俯视图" +msgstr "顶视图" #: editor/plugins/spatial_editor_plugin.cpp msgid "Rear View" @@ -7559,7 +7560,7 @@ msgstr "后视图" #: editor/plugins/spatial_editor_plugin.cpp msgid "Front View" -msgstr "正视图" +msgstr "前视图" #: editor/plugins/spatial_editor_plugin.cpp msgid "Left View" @@ -8240,7 +8241,7 @@ msgstr "新建自动图块" #: editor/plugins/tile_set_editor_plugin.cpp msgid "New Atlas" -msgstr "新建合集" +msgstr "新建图集" #: editor/plugins/tile_set_editor_plugin.cpp msgid "Next Coordinate" diff --git a/editor/translations/zh_HK.po b/editor/translations/zh_HK.po index 28a69ee289..69a8998437 100644 --- a/editor/translations/zh_HK.po +++ b/editor/translations/zh_HK.po @@ -5380,8 +5380,8 @@ msgstr "" #: editor/plugins/baked_lightmap_editor_plugin.cpp msgid "" -"No meshes to bake. Make sure they contain an UV2 channel and that the 'Bake " -"Light' flag is on." +"No meshes to bake. Make sure they contain an UV2 channel and that the 'Use " +"In Baked Light' and 'Generate Lightmap' flags are on." msgstr "" #: editor/plugins/baked_lightmap_editor_plugin.cpp diff --git a/editor/translations/zh_TW.po b/editor/translations/zh_TW.po index f65d628d63..2d04a07157 100644 --- a/editor/translations/zh_TW.po +++ b/editor/translations/zh_TW.po @@ -5118,9 +5118,10 @@ msgstr "" "請保存場景並重試。" #: editor/plugins/baked_lightmap_editor_plugin.cpp +#, fuzzy msgid "" -"No meshes to bake. Make sure they contain an UV2 channel and that the 'Bake " -"Light' flag is on." +"No meshes to bake. Make sure they contain an UV2 channel and that the 'Use " +"In Baked Light' and 'Generate Lightmap' flags are on." msgstr "" "無可烘焙之網格。請確保這些網格包含 UV2 通道並已開啟「Bake Light」旗標。" diff --git a/main/main_timer_sync.cpp b/main/main_timer_sync.cpp index 93448d0904..94e62bea97 100644 --- a/main/main_timer_sync.cpp +++ b/main/main_timer_sync.cpp @@ -30,7 +30,7 @@ #include "main_timer_sync.h" -void MainFrameTime::clamp_process_step(float min_process_step, float max_process_step) { +void MainFrameTime::clamp_process_step(double min_process_step, double max_process_step) { if (process_step < min_process_step) { process_step = min_process_step; } else if (process_step > max_process_step) { @@ -43,25 +43,25 @@ void MainFrameTime::clamp_process_step(float min_process_step, float max_process // returns the fraction of p_physics_step required for the timer to overshoot // before advance_core considers changing the physics_steps return from // the typical values as defined by typical_physics_steps -float MainTimerSync::get_physics_jitter_fix() { +double MainTimerSync::get_physics_jitter_fix() { return Engine::get_singleton()->get_physics_jitter_fix(); } // gets our best bet for the average number of physics steps per render frame // return value: number of frames back this data is consistent -int MainTimerSync::get_average_physics_steps(float &p_min, float &p_max) { +int MainTimerSync::get_average_physics_steps(double &p_min, double &p_max) { p_min = typical_physics_steps[0]; p_max = p_min + 1; for (int i = 1; i < CONTROL_STEPS; ++i) { - const float typical_lower = typical_physics_steps[i]; - const float current_min = typical_lower / (i + 1); + const double typical_lower = typical_physics_steps[i]; + const double current_min = typical_lower / (i + 1); if (current_min > p_max) { return i; // bail out of further restrictions would void the interval } else if (current_min > p_min) { p_min = current_min; } - const float current_max = (typical_lower + 1) / (i + 1); + const double current_max = (typical_lower + 1) / (i + 1); if (current_max < p_min) { return i; } else if (current_max < p_max) { @@ -73,7 +73,7 @@ int MainTimerSync::get_average_physics_steps(float &p_min, float &p_max) { } // advance physics clock by p_process_step, return appropriate number of steps to simulate -MainFrameTime MainTimerSync::advance_core(float p_physics_step, int p_physics_fps, float p_process_step) { +MainFrameTime MainTimerSync::advance_core(double p_physics_step, int p_physics_fps, double p_process_step) { MainFrameTime ret; ret.process_step = p_process_step; @@ -146,7 +146,7 @@ MainFrameTime MainTimerSync::advance_core(float p_physics_step, int p_physics_fp } // calls advance_core, keeps track of deficit it adds to animaption_step, make sure the deficit sum stays close to zero -MainFrameTime MainTimerSync::advance_checked(float p_physics_step, int p_physics_fps, float p_process_step) { +MainFrameTime MainTimerSync::advance_checked(double p_physics_step, int p_physics_fps, double p_process_step) { if (fixed_fps != -1) { p_process_step = 1.0 / fixed_fps; } @@ -163,7 +163,7 @@ MainFrameTime MainTimerSync::advance_checked(float p_physics_step, int p_physics // first, least important clamping: keep ret.process_step consistent with typical_physics_steps. // this smoothes out the process steps and culls small but quick variations. { - float min_average_physics_steps, max_average_physics_steps; + double min_average_physics_steps, max_average_physics_steps; int consistent_steps = get_average_physics_steps(min_average_physics_steps, max_average_physics_steps); if (consistent_steps > 3) { ret.clamp_process_step(min_average_physics_steps * p_physics_step, max_average_physics_steps * p_physics_step); @@ -171,7 +171,7 @@ MainFrameTime MainTimerSync::advance_checked(float p_physics_step, int p_physics } // second clamping: keep abs(time_deficit) < jitter_fix * frame_slise - float max_clock_deviation = get_physics_jitter_fix() * p_physics_step; + double max_clock_deviation = get_physics_jitter_fix() * p_physics_step; ret.clamp_process_step(p_process_step - max_clock_deviation, p_process_step + max_clock_deviation); // last clamping: make sure time_accum is between 0 and p_physics_step for consistency between physics and process @@ -191,7 +191,7 @@ MainFrameTime MainTimerSync::advance_checked(float p_physics_step, int p_physics } // determine wall clock step since last iteration -float MainTimerSync::get_cpu_process_step() { +double MainTimerSync::get_cpu_process_step() { uint64_t cpu_ticks_elapsed = current_cpu_ticks_usec - last_cpu_ticks_usec; last_cpu_ticks_usec = current_cpu_ticks_usec; @@ -220,8 +220,8 @@ void MainTimerSync::set_fixed_fps(int p_fixed_fps) { } // advance one physics frame, return timesteps to take -MainFrameTime MainTimerSync::advance(float p_physics_step, int p_physics_fps) { - float cpu_process_step = get_cpu_process_step(); +MainFrameTime MainTimerSync::advance(double p_physics_step, int p_physics_fps) { + double cpu_process_step = get_cpu_process_step(); return advance_checked(p_physics_step, p_physics_fps, cpu_process_step); } diff --git a/main/main_timer_sync.h b/main/main_timer_sync.h index 884978bf96..abdec18f6d 100644 --- a/main/main_timer_sync.h +++ b/main/main_timer_sync.h @@ -34,11 +34,11 @@ #include "core/config/engine.h" struct MainFrameTime { - float process_step; // delta time to advance during process() + double process_step; // delta time to advance during process() int physics_steps; // number of times to iterate the physics engine - float interpolation_fraction; // fraction through the current physics tick + double interpolation_fraction; // fraction through the current physics tick - void clamp_process_step(float min_process_step, float max_process_step); + void clamp_process_step(double min_process_step, double max_process_step); }; class MainTimerSync { @@ -47,10 +47,10 @@ class MainTimerSync { uint64_t current_cpu_ticks_usec = 0; // logical game time since last physics timestep - float time_accum = 0; + double time_accum = 0; // current difference between wall clock time and reported sum of process_steps - float time_deficit = 0; + double time_deficit = 0; // number of frames back for keeping accumulated physics steps roughly constant. // value of 12 chosen because that is what is required to make 144 Hz monitors @@ -70,20 +70,20 @@ protected: // returns the fraction of p_physics_step required for the timer to overshoot // before advance_core considers changing the physics_steps return from // the typical values as defined by typical_physics_steps - float get_physics_jitter_fix(); + double get_physics_jitter_fix(); // gets our best bet for the average number of physics steps per render frame // return value: number of frames back this data is consistent - int get_average_physics_steps(float &p_min, float &p_max); + int get_average_physics_steps(double &p_min, double &p_max); // advance physics clock by p_process_step, return appropriate number of steps to simulate - MainFrameTime advance_core(float p_physics_step, int p_physics_fps, float p_process_step); + MainFrameTime advance_core(double p_physics_step, int p_physics_fps, double p_process_step); // calls advance_core, keeps track of deficit it adds to animaption_step, make sure the deficit sum stays close to zero - MainFrameTime advance_checked(float p_physics_step, int p_physics_fps, float p_process_step); + MainFrameTime advance_checked(double p_physics_step, int p_physics_fps, double p_process_step); // determine wall clock step since last iteration - float get_cpu_process_step(); + double get_cpu_process_step(); public: MainTimerSync(); @@ -96,7 +96,7 @@ public: void set_fixed_fps(int p_fixed_fps); // advance one frame, return timesteps to take - MainFrameTime advance(float p_physics_step, int p_physics_fps); + MainFrameTime advance(double p_physics_step, int p_physics_fps); }; #endif // MAIN_TIMER_SYNC_H diff --git a/main/performance.cpp b/main/performance.cpp index 9f5be7b8c4..f9ff34c05d 100644 --- a/main/performance.cpp +++ b/main/performance.cpp @@ -77,7 +77,7 @@ void Performance::_bind_methods() { BIND_ENUM_CONSTANT(MONITOR_MAX); } -float Performance::_get_node_count() const { +int Performance::_get_node_count() const { MainLoop *ml = OS::get_singleton()->get_main_loop(); SceneTree *sml = Object::cast_to<SceneTree>(ml); if (!sml) { @@ -118,7 +118,7 @@ String Performance::get_monitor_name(Monitor p_monitor) const { return names[p_monitor]; } -float Performance::get_monitor(Monitor p_monitor) const { +double Performance::get_monitor(Monitor p_monitor) const { switch (p_monitor) { case TIME_FPS: return Engine::get_singleton()->get_frames_per_second(); @@ -207,11 +207,11 @@ Performance::MonitorType Performance::get_monitor_type(Monitor p_monitor) const return types[p_monitor]; } -void Performance::set_process_time(float p_pt) { +void Performance::set_process_time(double p_pt) { _process_time = p_pt; } -void Performance::set_physics_process_time(float p_pt) { +void Performance::set_physics_process_time(double p_pt) { _physics_process_time = p_pt; } diff --git a/main/performance.h b/main/performance.h index 174b3500d1..4653051ebb 100644 --- a/main/performance.h +++ b/main/performance.h @@ -43,10 +43,10 @@ class Performance : public Object { static Performance *singleton; static void _bind_methods(); - float _get_node_count() const; + int _get_node_count() const; - float _process_time; - float _physics_process_time; + double _process_time; + double _physics_process_time; class MonitorCall { Callable _callable; @@ -96,13 +96,13 @@ public: MONITOR_TYPE_TIME }; - float get_monitor(Monitor p_monitor) const; + double get_monitor(Monitor p_monitor) const; String get_monitor_name(Monitor p_monitor) const; MonitorType get_monitor_type(Monitor p_monitor) const; - void set_process_time(float p_pt); - void set_physics_process_time(float p_pt); + void set_process_time(double p_pt); + void set_physics_process_time(double p_pt); void add_custom_monitor(const StringName &p_id, const Callable &p_callable, const Vector<Variant> &p_args); void remove_custom_monitor(const StringName &p_id); diff --git a/modules/gdscript/gdscript.cpp b/modules/gdscript/gdscript.cpp index bcb53508ea..8957b00a1b 100644 --- a/modules/gdscript/gdscript.cpp +++ b/modules/gdscript/gdscript.cpp @@ -1804,10 +1804,10 @@ void GDScriptLanguage::reload_all_scripts() { scripts.sort_custom<GDScriptDepSort>(); //update in inheritance dependency order - for (Ref<GDScript> E : scripts) { - print_verbose("GDScript: Reloading: " + E->get_path()); - E->load_source_code(E->get_path()); - E->reload(true); + for (Ref<GDScript> &script : scripts) { + print_verbose("GDScript: Reloading: " + script->get_path()); + script->load_source_code(script->get_path()); + script->reload(true); } #endif } @@ -1836,21 +1836,21 @@ void GDScriptLanguage::reload_tool_script(const Ref<Script> &p_script, bool p_so scripts.sort_custom<GDScriptDepSort>(); //update in inheritance dependency order - for (Ref<GDScript> E : scripts) { - bool reload = E == p_script || to_reload.has(E->get_base()); + for (Ref<GDScript> &script : scripts) { + bool reload = script == p_script || to_reload.has(script->get_base()); if (!reload) { continue; } - to_reload.insert(E, Map<ObjectID, List<Pair<StringName, Variant>>>()); + to_reload.insert(script, Map<ObjectID, List<Pair<StringName, Variant>>>()); if (!p_soft_reload) { //save state and remove script from instances - Map<ObjectID, List<Pair<StringName, Variant>>> &map = to_reload[E]; + Map<ObjectID, List<Pair<StringName, Variant>>> &map = to_reload[script]; - while (E->instances.front()) { - Object *obj = E->instances.front()->get(); + while (script->instances.front()) { + Object *obj = script->instances.front()->get(); //save instance info List<Pair<StringName, Variant>> state; if (obj->get_script_instance()) { @@ -1863,8 +1863,8 @@ void GDScriptLanguage::reload_tool_script(const Ref<Script> &p_script, bool p_so //same thing for placeholders #ifdef TOOLS_ENABLED - while (E->placeholders.size()) { - Object *obj = E->placeholders.front()->get()->get_owner(); + while (script->placeholders.size()) { + Object *obj = script->placeholders.front()->get()->get_owner(); //save instance info if (obj->get_script_instance()) { @@ -1874,13 +1874,13 @@ void GDScriptLanguage::reload_tool_script(const Ref<Script> &p_script, bool p_so obj->set_script(Variant()); } else { // no instance found. Let's remove it so we don't loop forever - E->placeholders.erase(E->placeholders.front()->get()); + script->placeholders.erase(script->placeholders.front()->get()); } } #endif - for (Map<ObjectID, List<Pair<StringName, Variant>>>::Element *F = E->pending_reload_state.front(); F; F = F->next()) { + for (Map<ObjectID, List<Pair<StringName, Variant>>>::Element *F = script->pending_reload_state.front(); F; F = F->next()) { map[F->key()] = F->get(); //pending to reload, use this one instead } } diff --git a/modules/glslang/register_types.cpp b/modules/glslang/register_types.cpp index 730c6b89f7..dd545ff431 100644 --- a/modules/glslang/register_types.cpp +++ b/modules/glslang/register_types.cpp @@ -193,7 +193,7 @@ void preregister_glslang_types() { // initialize in case it's not initialized. This is done once per thread // and it's safe to call multiple times glslang::InitializeProcess(); - RenderingDevice::shader_set_compile_function(_compile_shader_glsl); + RenderingDevice::shader_set_compile_to_spirv_function(_compile_shader_glsl); RenderingDevice::shader_set_get_cache_key_function(_get_cache_key_function_glsl); } diff --git a/modules/lightmapper_rd/lightmapper_rd.cpp b/modules/lightmapper_rd/lightmapper_rd.cpp index b75cf6502e..fe941e25e7 100644 --- a/modules/lightmapper_rd/lightmapper_rd.cpp +++ b/modules/lightmapper_rd/lightmapper_rd.cpp @@ -794,7 +794,7 @@ LightmapperRD::BakeError LightmapperRD::bake(BakeQuality p_quality, bool p_use_d } ERR_FAIL_COND_V(err != OK, BAKE_ERROR_LIGHTMAP_CANT_PRE_BAKE_MESHES); - RID rasterize_shader = rd->shader_create_from_bytecode(raster_shader->get_bytecode()); + RID rasterize_shader = rd->shader_create_from_spirv(raster_shader->get_spirv_stages()); ERR_FAIL_COND_V(rasterize_shader.is_null(), BAKE_ERROR_LIGHTMAP_CANT_PRE_BAKE_MESHES); //this is a bug check, though, should not happen @@ -945,27 +945,27 @@ LightmapperRD::BakeError LightmapperRD::bake(BakeQuality p_quality, bool p_use_d ERR_FAIL_COND_V(err != OK, BAKE_ERROR_LIGHTMAP_CANT_PRE_BAKE_MESHES); // Unoccluder - RID compute_shader_unocclude = rd->shader_create_from_bytecode(compute_shader->get_bytecode("unocclude")); + RID compute_shader_unocclude = rd->shader_create_from_spirv(compute_shader->get_spirv_stages("unocclude")); ERR_FAIL_COND_V(compute_shader_unocclude.is_null(), BAKE_ERROR_LIGHTMAP_CANT_PRE_BAKE_MESHES); // internal check, should not happen RID compute_shader_unocclude_pipeline = rd->compute_pipeline_create(compute_shader_unocclude); // Direct light - RID compute_shader_primary = rd->shader_create_from_bytecode(compute_shader->get_bytecode("primary")); + RID compute_shader_primary = rd->shader_create_from_spirv(compute_shader->get_spirv_stages("primary")); ERR_FAIL_COND_V(compute_shader_primary.is_null(), BAKE_ERROR_LIGHTMAP_CANT_PRE_BAKE_MESHES); // internal check, should not happen RID compute_shader_primary_pipeline = rd->compute_pipeline_create(compute_shader_primary); // Indirect light - RID compute_shader_secondary = rd->shader_create_from_bytecode(compute_shader->get_bytecode("secondary")); + RID compute_shader_secondary = rd->shader_create_from_spirv(compute_shader->get_spirv_stages("secondary")); ERR_FAIL_COND_V(compute_shader_secondary.is_null(), BAKE_ERROR_LIGHTMAP_CANT_PRE_BAKE_MESHES); //internal check, should not happen RID compute_shader_secondary_pipeline = rd->compute_pipeline_create(compute_shader_secondary); // Dilate - RID compute_shader_dilate = rd->shader_create_from_bytecode(compute_shader->get_bytecode("dilate")); + RID compute_shader_dilate = rd->shader_create_from_spirv(compute_shader->get_spirv_stages("dilate")); ERR_FAIL_COND_V(compute_shader_dilate.is_null(), BAKE_ERROR_LIGHTMAP_CANT_PRE_BAKE_MESHES); //internal check, should not happen RID compute_shader_dilate_pipeline = rd->compute_pipeline_create(compute_shader_dilate); // Light probes - RID compute_shader_light_probes = rd->shader_create_from_bytecode(compute_shader->get_bytecode("light_probes")); + RID compute_shader_light_probes = rd->shader_create_from_spirv(compute_shader->get_spirv_stages("light_probes")); ERR_FAIL_COND_V(compute_shader_light_probes.is_null(), BAKE_ERROR_LIGHTMAP_CANT_PRE_BAKE_MESHES); //internal check, should not happen RID compute_shader_light_probes_pipeline = rd->compute_pipeline_create(compute_shader_light_probes); @@ -1506,11 +1506,11 @@ LightmapperRD::BakeError LightmapperRD::bake(BakeQuality p_quality, bool p_use_d } ERR_FAIL_COND_V(err != OK, BAKE_ERROR_LIGHTMAP_CANT_PRE_BAKE_MESHES); - RID blendseams_line_raster_shader = rd->shader_create_from_bytecode(blendseams_shader->get_bytecode("lines")); + RID blendseams_line_raster_shader = rd->shader_create_from_spirv(blendseams_shader->get_spirv_stages("lines")); ERR_FAIL_COND_V(blendseams_line_raster_shader.is_null(), BAKE_ERROR_LIGHTMAP_CANT_PRE_BAKE_MESHES); - RID blendseams_triangle_raster_shader = rd->shader_create_from_bytecode(blendseams_shader->get_bytecode("triangles")); + RID blendseams_triangle_raster_shader = rd->shader_create_from_spirv(blendseams_shader->get_spirv_stages("triangles")); ERR_FAIL_COND_V(blendseams_triangle_raster_shader.is_null(), BAKE_ERROR_LIGHTMAP_CANT_PRE_BAKE_MESHES); diff --git a/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp index b52277974f..9e8b4d38bf 100644 --- a/modules/mono/csharp_script.cpp +++ b/modules/mono/csharp_script.cpp @@ -874,7 +874,7 @@ void CSharpLanguage::reload_assemblies(bool p_soft_reload) { // As scripts are going to be reloaded, must proceed without locking here - for (Ref<CSharpScript> script : scripts) { + for (Ref<CSharpScript> &script : scripts) { to_reload.push_back(script); if (script->get_path().is_empty()) { @@ -934,7 +934,7 @@ void CSharpLanguage::reload_assemblies(bool p_soft_reload) { } // After the state of all instances is saved, clear scripts and script instances - for (Ref<CSharpScript> script : scripts) { + for (Ref<CSharpScript> &script : scripts) { while (script->instances.front()) { Object *obj = script->instances.front()->get(); obj->set_script(REF()); // Remove script and existing script instances (placeholder are not removed before domain reload) @@ -947,7 +947,7 @@ void CSharpLanguage::reload_assemblies(bool p_soft_reload) { if (gdmono->reload_scripts_domain() != OK) { // Failed to reload the scripts domain // Make sure to add the scripts back to their owners before returning - for (Ref<CSharpScript> scr : to_reload) { + for (Ref<CSharpScript> &scr : to_reload) { for (const Map<ObjectID, CSharpScript::StateBackup>::Element *F = scr->pending_reload_state.front(); F; F = F->next()) { Object *obj = ObjectDB::get_instance(F->key()); @@ -982,7 +982,7 @@ void CSharpLanguage::reload_assemblies(bool p_soft_reload) { List<Ref<CSharpScript>> to_reload_state; - for (Ref<CSharpScript> script : to_reload) { + for (Ref<CSharpScript> &script : to_reload) { #ifdef TOOLS_ENABLED script->exports_invalidated = true; #endif @@ -1087,7 +1087,7 @@ void CSharpLanguage::reload_assemblies(bool p_soft_reload) { to_reload_state.push_back(script); } - for (Ref<CSharpScript> script : to_reload_state) { + for (Ref<CSharpScript> &script : to_reload_state) { for (Set<ObjectID>::Element *F = script->pending_reload_instances.front(); F; F = F->next()) { ObjectID obj_id = F->get(); Object *obj = ObjectDB::get_instance(obj_id); diff --git a/modules/webrtc/webrtc_multiplayer_peer.cpp b/modules/webrtc/webrtc_multiplayer_peer.cpp index 77857255c1..9b08a26aed 100644 --- a/modules/webrtc/webrtc_multiplayer_peer.cpp +++ b/modules/webrtc/webrtc_multiplayer_peer.cpp @@ -154,7 +154,7 @@ void WebRTCMultiplayerPeer::_find_next_peer() { } // After last. while (E) { - for (Ref<WebRTCDataChannel> F : E->get()->channels) { + for (const Ref<WebRTCDataChannel> &F : E->get()->channels) { if (F->get_available_packet_count()) { next_packet_peer = E->key(); return; @@ -165,7 +165,7 @@ void WebRTCMultiplayerPeer::_find_next_peer() { E = peer_map.front(); // Before last while (E) { - for (Ref<WebRTCDataChannel> F : E->get()->channels) { + for (const Ref<WebRTCDataChannel> &F : E->get()->channels) { if (F->get_available_packet_count()) { next_packet_peer = E->key(); return; @@ -213,7 +213,7 @@ int WebRTCMultiplayerPeer::get_unique_id() const { void WebRTCMultiplayerPeer::_peer_to_dict(Ref<ConnectedPeer> p_connected_peer, Dictionary &r_dict) { Array channels; - for (Ref<WebRTCDataChannel> F : p_connected_peer->channels) { + for (Ref<WebRTCDataChannel> &F : p_connected_peer->channels) { channels.push_back(F); } r_dict["connection"] = p_connected_peer->connection; @@ -297,7 +297,7 @@ Error WebRTCMultiplayerPeer::get_packet(const uint8_t **r_buffer, int &r_buffer_ _find_next_peer(); ERR_FAIL_V(ERR_UNAVAILABLE); } - for (Ref<WebRTCDataChannel> E : peer_map[next_packet_peer]->channels) { + for (Ref<WebRTCDataChannel> &E : peer_map[next_packet_peer]->channels) { if (E->get_available_packet_count()) { Error err = E->get_packet(r_buffer, r_buffer_size); _find_next_peer(); @@ -357,7 +357,7 @@ int WebRTCMultiplayerPeer::get_available_packet_count() const { } int size = 0; for (Map<int, Ref<ConnectedPeer>>::Element *E = peer_map.front(); E; E = E->next()) { - for (Ref<WebRTCDataChannel> F : E->get()->channels) { + for (const Ref<WebRTCDataChannel> &F : E->get()->channels) { size += F->get_available_packet_count(); } } diff --git a/modules/websocket/wsl_server.cpp b/modules/websocket/wsl_server.cpp index 1df001f86e..c6eb3d44b4 100644 --- a/modules/websocket/wsl_server.cpp +++ b/modules/websocket/wsl_server.cpp @@ -196,7 +196,7 @@ void WSLServer::poll() { remove_ids.clear(); List<Ref<PendingPeer>> remove_peers; - for (Ref<PendingPeer> E : _pending) { + for (const Ref<PendingPeer> &E : _pending) { String resource_name; Ref<PendingPeer> ppeer = E; Error err = ppeer->do_handshake(_protocols, handshake_timeout, resource_name); @@ -224,7 +224,7 @@ void WSLServer::poll() { remove_peers.push_back(ppeer); _on_connect(id, ppeer->protocol, resource_name); } - for (Ref<PendingPeer> E : remove_peers) { + for (const Ref<PendingPeer> &E : remove_peers) { _pending.erase(E); } remove_peers.clear(); diff --git a/scene/animation/tween.cpp b/scene/animation/tween.cpp index b31c3d57f9..a57e986877 100644 --- a/scene/animation/tween.cpp +++ b/scene/animation/tween.cpp @@ -46,8 +46,8 @@ void Tween::start_tweeners() { ERR_FAIL_MSG("Tween without commands, aborting."); } - for (Ref<Tweener> E : tweeners.write[current_step]) { - E->start(); + for (Ref<Tweener> &tweener : tweeners.write[current_step]) { + tweener->start(); } } @@ -253,11 +253,11 @@ bool Tween::step(float p_delta) { float step_delta = rem_delta; step_active = false; - for (Ref<Tweener> E : tweeners.write[current_step]) { + for (Ref<Tweener> &tweener : tweeners.write[current_step]) { // Modified inside Tweener.step(). float temp_delta = rem_delta; // Turns to true if any Tweener returns true (i.e. is still not finished). - step_active = E->step(temp_delta) || step_active; + step_active = tweener->step(temp_delta) || step_active; step_delta = MIN(temp_delta, rem_delta); } diff --git a/scene/gui/menu_button.cpp b/scene/gui/menu_button.cpp index 73034dee5a..cf1f41d0fc 100644 --- a/scene/gui/menu_button.cpp +++ b/scene/gui/menu_button.cpp @@ -57,7 +57,32 @@ void MenuButton::_unhandled_key_input(Ref<InputEvent> p_event) { void MenuButton::_popup_visibility_changed(bool p_visible) { set_pressed(p_visible); - set_process_internal(p_visible); + + if (!p_visible) { + set_process_internal(false); + return; + } + + if (switch_on_hover) { + Window *window = Object::cast_to<Window>(get_viewport()); + if (window) { + mouse_pos_adjusted = window->get_position(); + + if (window->is_embedded()) { + Window *window_parent = Object::cast_to<Window>(window->get_parent()->get_viewport()); + while (window_parent) { + if (!window_parent->is_embedded()) { + mouse_pos_adjusted += window_parent->get_position(); + break; + } + + window_parent = Object::cast_to<Window>(window_parent->get_parent()->get_viewport()); + } + } + + set_process_internal(true); + } + } } void MenuButton::pressed() { @@ -106,17 +131,13 @@ void MenuButton::_notification(int p_what) { } } break; case NOTIFICATION_INTERNAL_PROCESS: { - if (switch_on_hover) { - Window *window = Object::cast_to<Window>(get_viewport()); - if (window) { - Vector2i mouse_pos = DisplayServer::get_singleton()->mouse_get_position() - window->get_position(); - MenuButton *menu_btn_other = Object::cast_to<MenuButton>(window->gui_find_control(mouse_pos)); - if (menu_btn_other && menu_btn_other != this && menu_btn_other->is_switch_on_hover() && !menu_btn_other->is_disabled() && - (get_parent()->is_ancestor_of(menu_btn_other) || menu_btn_other->get_parent()->is_ancestor_of(popup))) { - popup->hide(); - menu_btn_other->pressed(); - } - } + Vector2i mouse_pos = DisplayServer::get_singleton()->mouse_get_position() - mouse_pos_adjusted; + MenuButton *menu_btn_other = Object::cast_to<MenuButton>(get_viewport()->gui_find_control(mouse_pos)); + + if (menu_btn_other && menu_btn_other != this && menu_btn_other->is_switch_on_hover() && !menu_btn_other->is_disabled() && + (get_parent()->is_ancestor_of(menu_btn_other) || menu_btn_other->get_parent()->is_ancestor_of(popup))) { + popup->hide(); + menu_btn_other->pressed(); } } break; } diff --git a/scene/gui/menu_button.h b/scene/gui/menu_button.h index 301769b008..cc2ca117c4 100644 --- a/scene/gui/menu_button.h +++ b/scene/gui/menu_button.h @@ -42,6 +42,8 @@ class MenuButton : public Button { bool disable_shortcuts = false; PopupMenu *popup; + Vector2i mouse_pos_adjusted; + Array _get_items() const; void _set_items(const Array &p_items); diff --git a/scene/main/scene_tree.cpp b/scene/main/scene_tree.cpp index adba7f1a31..dcbbebbc55 100644 --- a/scene/main/scene_tree.cpp +++ b/scene/main/scene_tree.cpp @@ -66,11 +66,11 @@ void SceneTreeTimer::_bind_methods() { ADD_SIGNAL(MethodInfo("timeout")); } -void SceneTreeTimer::set_time_left(float p_time) { +void SceneTreeTimer::set_time_left(double p_time) { time_left = p_time; } -float SceneTreeTimer::get_time_left() const { +double SceneTreeTimer::get_time_left() const { return time_left; } @@ -403,7 +403,7 @@ void SceneTree::initialize() { MainLoop::initialize(); } -bool SceneTree::physics_process(float p_time) { +bool SceneTree::physics_process(double p_time) { root_lock++; current_frame++; @@ -432,7 +432,7 @@ bool SceneTree::physics_process(float p_time) { return _quit; } -bool SceneTree::process(float p_time) { +bool SceneTree::process(double p_time) { root_lock++; MainLoop::process(p_time); @@ -474,7 +474,7 @@ bool SceneTree::process(float p_time) { continue; } - float time_left = E->get()->get_time_left(); + double time_left = E->get()->get_time_left(); if (E->get()->is_ignore_time_scale()) { time_left -= Engine::get_singleton()->get_process_step(); } else { @@ -571,8 +571,8 @@ void SceneTree::finalize() { } // cleanup timers - for (Ref<SceneTreeTimer> E : timers) { - E->release_connections(); + for (Ref<SceneTreeTimer> &timer : timers) { + timer->release_connections(); } timers.clear(); } @@ -1124,7 +1124,7 @@ void SceneTree::add_current_scene(Node *p_current) { root->add_child(p_current); } -Ref<SceneTreeTimer> SceneTree::create_timer(float p_delay_sec, bool p_process_always) { +Ref<SceneTreeTimer> SceneTree::create_timer(double p_delay_sec, bool p_process_always) { Ref<SceneTreeTimer> stt; stt.instantiate(); stt->set_process_always(p_process_always); @@ -1146,8 +1146,8 @@ Array SceneTree::get_processed_tweens() { ret.resize(tweens.size()); int i = 0; - for (Ref<Tween> E : tweens) { - ret[i] = E; + for (const Ref<Tween> &tween : tweens) { + ret[i] = tween; i++; } diff --git a/scene/main/scene_tree.h b/scene/main/scene_tree.h index c3d59663d6..cfb95bd6b5 100644 --- a/scene/main/scene_tree.h +++ b/scene/main/scene_tree.h @@ -52,7 +52,7 @@ class Tween; class SceneTreeTimer : public RefCounted { GDCLASS(SceneTreeTimer, RefCounted); - float time_left = 0.0; + double time_left = 0.0; bool process_always = true; bool ignore_time_scale = false; @@ -60,8 +60,8 @@ protected: static void _bind_methods(); public: - void set_time_left(float p_time); - float get_time_left() const; + void set_time_left(double p_time); + double get_time_left() const; void set_process_always(bool p_process_always); bool is_process_always(); @@ -91,8 +91,8 @@ private: Window *root = nullptr; uint64_t tree_version = 1; - float physics_process_time = 1.0; - float process_time = 1.0; + double physics_process_time = 1.0; + double process_time = 1.0; bool accept_quit = true; bool quit_on_go_back = true; @@ -237,8 +237,8 @@ public: virtual void initialize() override; - virtual bool physics_process(float p_time) override; - virtual bool process(float p_time) override; + virtual bool physics_process(double p_time) override; + virtual bool process(double p_time) override; virtual void finalize() override; @@ -247,8 +247,8 @@ public: void quit(int p_exit_code = EXIT_SUCCESS); - _FORCE_INLINE_ float get_physics_process_time() const { return physics_process_time; } - _FORCE_INLINE_ float get_process_time() const { return process_time; } + _FORCE_INLINE_ double get_physics_process_time() const { return physics_process_time; } + _FORCE_INLINE_ double get_process_time() const { return process_time; } #ifdef TOOLS_ENABLED bool is_node_being_edited(const Node *p_node) const; @@ -317,7 +317,7 @@ public: Error change_scene_to(const Ref<PackedScene> &p_scene); Error reload_current_scene(); - Ref<SceneTreeTimer> create_timer(float p_delay_sec, bool p_process_always = true); + Ref<SceneTreeTimer> create_timer(double p_delay_sec, bool p_process_always = true); Ref<Tween> create_tween(); Array get_processed_tweens(); diff --git a/scene/main/timer.cpp b/scene/main/timer.cpp index ef8245076f..b5a2a30b3b 100644 --- a/scene/main/timer.cpp +++ b/scene/main/timer.cpp @@ -81,12 +81,12 @@ void Timer::_notification(int p_what) { } } -void Timer::set_wait_time(float p_time) { +void Timer::set_wait_time(double p_time) { ERR_FAIL_COND_MSG(p_time <= 0, "Time should be greater than zero."); wait_time = p_time; } -float Timer::get_wait_time() const { +double Timer::get_wait_time() const { return wait_time; } @@ -106,7 +106,7 @@ bool Timer::has_autostart() const { return autostart; } -void Timer::start(float p_time) { +void Timer::start(double p_time) { ERR_FAIL_COND_MSG(!is_inside_tree(), "Timer was not added to the SceneTree. Either add it or set autostart to true."); if (p_time > 0) { @@ -139,7 +139,7 @@ bool Timer::is_stopped() const { return get_time_left() <= 0; } -float Timer::get_time_left() const { +double Timer::get_time_left() const { return time_left > 0 ? time_left : 0; } diff --git a/scene/main/timer.h b/scene/main/timer.h index 3d9e21d7fc..2b9faddcb9 100644 --- a/scene/main/timer.h +++ b/scene/main/timer.h @@ -36,7 +36,7 @@ class Timer : public Node { GDCLASS(Timer, Node); - float wait_time = 1.0; + double wait_time = 1.0; bool one_shot = false; bool autostart = false; bool processing = false; @@ -54,8 +54,8 @@ public: TIMER_PROCESS_IDLE, }; - void set_wait_time(float p_time); - float get_wait_time() const; + void set_wait_time(double p_time); + double get_wait_time() const; void set_one_shot(bool p_one_shot); bool is_one_shot() const; @@ -63,7 +63,7 @@ public: void set_autostart(bool p_start); bool has_autostart() const; - void start(float p_time = -1); + void start(double p_time = -1); void stop(); void set_paused(bool p_paused); @@ -71,7 +71,7 @@ public: bool is_stopped() const; - float get_time_left() const; + double get_time_left() const; void set_timer_process_callback(TimerProcessCallback p_callback); TimerProcessCallback get_timer_process_callback() const; diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index 4231072ed9..27e42db1bd 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -573,7 +573,7 @@ void Viewport::_process_picking() { // if no mouse event exists, create a motion one. This is necessary because objects or camera may have moved. // while this extra event is sent, it is checked if both camera and last object and last ID did not move. If nothing changed, the event is discarded to avoid flooding with unnecessary motion events every frame bool has_mouse_event = false; - for (Ref<InputEvent> m : physics_picking_events) { + for (const Ref<InputEvent> &m : physics_picking_events) { if (m.is_valid()) { has_mouse_event = true; break; diff --git a/servers/register_server_types.cpp b/servers/register_server_types.cpp index 717b4e8d14..857f112102 100644 --- a/servers/register_server_types.cpp +++ b/servers/register_server_types.cpp @@ -205,7 +205,7 @@ void register_server_types() { GDREGISTER_CLASS(RDPipelineColorBlendStateAttachment); GDREGISTER_CLASS(RDPipelineColorBlendState); GDREGISTER_CLASS(RDShaderSource); - GDREGISTER_CLASS(RDShaderBytecode); + GDREGISTER_CLASS(RDShaderSPIRV); GDREGISTER_CLASS(RDShaderFile); GDREGISTER_CLASS(RDPipelineSpecializationConstant); diff --git a/servers/rendering/renderer_rd/cluster_builder_rd.h b/servers/rendering/renderer_rd/cluster_builder_rd.h index 797a02a978..c0c03eb26a 100644 --- a/servers/rendering/renderer_rd/cluster_builder_rd.h +++ b/servers/rendering/renderer_rd/cluster_builder_rd.h @@ -235,7 +235,7 @@ public: Transform3D xform = view_xform * p_transform; float radius = xform.basis.get_uniform_scale(); - if (radius > 0.98 && radius < 1.02) { + if (radius < 0.98 || radius > 1.02) { xform.basis.orthonormalize(); } diff --git a/servers/rendering/renderer_rd/shader_rd.cpp b/servers/rendering/renderer_rd/shader_rd.cpp index 27305cc938..1b9f54d1c8 100644 --- a/servers/rendering/renderer_rd/shader_rd.cpp +++ b/servers/rendering/renderer_rd/shader_rd.cpp @@ -116,8 +116,10 @@ void ShaderRD::setup(const char *p_vertex_code, const char *p_fragment_code, con } StringBuilder tohash; - tohash.append("[VersionKey]"); - tohash.append(RenderingDevice::get_singleton()->shader_get_cache_key()); + tohash.append("[SpirvCacheKey]"); + tohash.append(RenderingDevice::get_singleton()->shader_get_spirv_cache_key()); + tohash.append("[BinaryCacheKey]"); + tohash.append(RenderingDevice::get_singleton()->shader_get_binary_cache_key()); tohash.append("[Vertex]"); tohash.append(p_vertex_code ? p_vertex_code : ""); tohash.append("[Fragment]"); @@ -148,8 +150,8 @@ void ShaderRD::_clear_version(Version *p_version) { } memdelete_arr(p_version->variants); - if (p_version->variant_stages) { - memdelete_arr(p_version->variant_stages); + if (p_version->variant_data) { + memdelete_arr(p_version->variant_data); } p_version->variants = nullptr; } @@ -203,7 +205,7 @@ void ShaderRD::_compile_variant(uint32_t p_variant, Version *p_version) { return; //variant is disabled, return } - Vector<RD::ShaderStageData> &stages = p_version->variant_stages[p_variant]; + Vector<RD::ShaderStageSPIRVData> stages; String error; String current_source; @@ -217,8 +219,8 @@ void ShaderRD::_compile_variant(uint32_t p_variant, Version *p_version) { _build_variant_code(builder, p_variant, p_version, stage_templates[STAGE_TYPE_VERTEX]); current_source = builder.as_string(); - RD::ShaderStageData stage; - stage.spir_v = RD::get_singleton()->shader_compile_from_source(RD::SHADER_STAGE_VERTEX, current_source, RD::SHADER_LANGUAGE_GLSL, &error); + RD::ShaderStageSPIRVData stage; + stage.spir_v = RD::get_singleton()->shader_compile_spirv_from_source(RD::SHADER_STAGE_VERTEX, current_source, RD::SHADER_LANGUAGE_GLSL, &error); if (stage.spir_v.size() == 0) { build_ok = false; } else { @@ -235,8 +237,8 @@ void ShaderRD::_compile_variant(uint32_t p_variant, Version *p_version) { _build_variant_code(builder, p_variant, p_version, stage_templates[STAGE_TYPE_FRAGMENT]); current_source = builder.as_string(); - RD::ShaderStageData stage; - stage.spir_v = RD::get_singleton()->shader_compile_from_source(RD::SHADER_STAGE_FRAGMENT, current_source, RD::SHADER_LANGUAGE_GLSL, &error); + RD::ShaderStageSPIRVData stage; + stage.spir_v = RD::get_singleton()->shader_compile_spirv_from_source(RD::SHADER_STAGE_FRAGMENT, current_source, RD::SHADER_LANGUAGE_GLSL, &error); if (stage.spir_v.size() == 0) { build_ok = false; } else { @@ -254,8 +256,8 @@ void ShaderRD::_compile_variant(uint32_t p_variant, Version *p_version) { current_source = builder.as_string(); - RD::ShaderStageData stage; - stage.spir_v = RD::get_singleton()->shader_compile_from_source(RD::SHADER_STAGE_COMPUTE, current_source, RD::SHADER_LANGUAGE_GLSL, &error); + RD::ShaderStageSPIRVData stage; + stage.spir_v = RD::get_singleton()->shader_compile_spirv_from_source(RD::SHADER_STAGE_COMPUTE, current_source, RD::SHADER_LANGUAGE_GLSL, &error); if (stage.spir_v.size() == 0) { build_ok = false; } else { @@ -275,10 +277,15 @@ void ShaderRD::_compile_variant(uint32_t p_variant, Version *p_version) { return; } - RID shader = RD::get_singleton()->shader_create(stages); + Vector<uint8_t> shader_data = RD::get_singleton()->shader_compile_binary_from_spirv(stages); + + ERR_FAIL_COND(shader_data.size() == 0); + + RID shader = RD::get_singleton()->shader_create_from_bytecode(shader_data); { MutexLock lock(variant_set_mutex); p_version->variants[p_variant] = shader; + p_version->variant_data[p_variant] = shader_data; } } @@ -364,14 +371,12 @@ String ShaderRD::_version_get_sha1(Version *p_version) const { } static const char *shader_file_header = "GDSC"; -static const uint32_t cache_file_version = 1; +static const uint32_t cache_file_version = 2; bool ShaderRD::_load_from_cache(Version *p_version) { String sha1 = _version_get_sha1(p_version); String path = shader_cache_dir.plus_file(name).plus_file(base_sha256).plus_file(sha1) + ".cache"; - uint64_t time_from = OS::get_singleton()->get_ticks_usec(); - FileAccessRef f = FileAccess::open(path, FileAccess::READ); if (!f) { return false; @@ -390,76 +395,43 @@ bool ShaderRD::_load_from_cache(Version *p_version) { ERR_FAIL_COND_V(variant_count != (uint32_t)variant_defines.size(), false); //should not happen but check - bool success = true; for (uint32_t i = 0; i < variant_count; i++) { - uint32_t stage_count = f->get_32(); - p_version->variant_stages[i].resize(stage_count); - for (uint32_t j = 0; j < stage_count; j++) { - p_version->variant_stages[i].write[j].shader_stage = RD::ShaderStage(f->get_32()); - - int compression = f->get_32(); - uint32_t length = f->get_32(); - - if (compression == 0) { - Vector<uint8_t> data; - data.resize(length); - - f->get_buffer(data.ptrw(), length); - - p_version->variant_stages[i].write[j].spir_v = data; - } else { - Vector<uint8_t> data; - - if (compression == 2) { - //zstd - int smol_length = f->get_32(); - Vector<uint8_t> zstd_data; - - zstd_data.resize(smol_length); - f->get_buffer(zstd_data.ptrw(), smol_length); - - data.resize(length); - Compression::decompress(data.ptrw(), data.size(), zstd_data.ptr(), zstd_data.size(), Compression::MODE_ZSTD); - - } else { - data.resize(length); - f->get_buffer(data.ptrw(), length); - } - - Vector<uint8_t> spirv; - uint32_t spirv_size = smolv::GetDecodedBufferSize(data.ptr(), data.size()); - spirv.resize(spirv_size); - if (!smolv::Decode(data.ptr(), data.size(), spirv.ptrw(), spirv_size)) { - ERR_PRINT("Malformed smolv input uncompressing shader " + name + ", variant #" + itos(i) + " stage :" + itos(j)); - success = false; - break; - } - p_version->variant_stages[i].write[j].spir_v = spirv; - } + uint32_t variant_size = f->get_32(); + ERR_FAIL_COND_V(variant_size == 0 && variants_enabled[i], false); + if (!variants_enabled[i]) { + continue; } - } + Vector<uint8_t> variant_bytes; + variant_bytes.resize(variant_size); - if (!success) { - for (uint32_t i = 0; i < variant_count; i++) { - p_version->variant_stages[i].resize(0); - } - return false; - } + uint32_t br = f->get_buffer(variant_bytes.ptrw(), variant_size); - float time_ms = double(OS::get_singleton()->get_ticks_usec() - time_from) / 1000.0; + ERR_FAIL_COND_V(br != variant_size, false); - print_verbose("Shader cache load success '" + path + "' " + rtos(time_ms) + "ms."); + p_version->variant_data[i] = variant_bytes; + } for (uint32_t i = 0; i < variant_count; i++) { - RID shader = RD::get_singleton()->shader_create(p_version->variant_stages[i]); + if (!variants_enabled[i]) { + MutexLock lock(variant_set_mutex); + p_version->variants[i] = RID(); + continue; + } + RID shader = RD::get_singleton()->shader_create_from_bytecode(p_version->variant_data[i]); + if (shader.is_null()) { + for (uint32_t j = 0; j < i; j++) { + RD::get_singleton()->free(p_version->variants[i]); + } + ERR_FAIL_COND_V(shader.is_null(), false); + } { MutexLock lock(variant_set_mutex); p_version->variants[i] = shader; } } - memdelete_arr(p_version->variant_stages); //clear stages - p_version->variant_stages = nullptr; + memdelete_arr(p_version->variant_data); //clear stages + p_version->variant_data = nullptr; p_version->valid = true; return true; } @@ -476,49 +448,8 @@ void ShaderRD::_save_to_cache(Version *p_version) { f->store_32(variant_count); //variant count for (uint32_t i = 0; i < variant_count; i++) { - f->store_32(p_version->variant_stages[i].size()); //stage count - for (int j = 0; j < p_version->variant_stages[i].size(); j++) { - f->store_32(p_version->variant_stages[i][j].shader_stage); //stage count - Vector<uint8_t> spirv = p_version->variant_stages[i][j].spir_v; - - bool save_uncompressed = true; - if (shader_cache_save_compressed) { - smolv::ByteArray smolv; - bool strip_debug = !shader_cache_save_debug; - if (!smolv::Encode(spirv.ptr(), spirv.size(), smolv, strip_debug ? smolv::kEncodeFlagStripDebugInfo : 0)) { - ERR_PRINT("Error compressing shader " + name + ", variant #" + itos(i) + " stage :" + itos(i)); - } else { - bool compress_zstd = shader_cache_save_compressed_zstd; - - if (compress_zstd) { - Vector<uint8_t> zstd; - zstd.resize(Compression::get_max_compressed_buffer_size(smolv.size(), Compression::MODE_ZSTD)); - int dst_size = Compression::compress(zstd.ptrw(), &smolv[0], smolv.size(), Compression::MODE_ZSTD); - if (dst_size >= 0 && (uint32_t)dst_size < smolv.size()) { - f->store_32(2); //compressed zstd - f->store_32(smolv.size()); //size of smolv buffer - f->store_32(dst_size); //size of smolv buffer - f->store_buffer(zstd.ptr(), dst_size); //smolv buffer - } else { - compress_zstd = false; - } - } - - if (!compress_zstd) { - f->store_32(1); //compressed - f->store_32(smolv.size()); //size of smolv buffer - f->store_buffer(&smolv[0], smolv.size()); //smolv buffer - } - save_uncompressed = false; - } - } - - if (save_uncompressed) { - f->store_32(0); //uncompressed - f->store_32(spirv.size()); //stage count - f->store_buffer(spirv.ptr(), spirv.size()); //stage count - } - } + f->store_32(p_version->variant_data[i].size()); //stage count + f->store_buffer(p_version->variant_data[i].ptr(), p_version->variant_data[i].size()); } f->close(); @@ -531,8 +462,8 @@ void ShaderRD::_compile_version(Version *p_version) { p_version->dirty = false; p_version->variants = memnew_arr(RID, variant_defines.size()); - typedef Vector<RD::ShaderStageData> ShaderStageArray; - p_version->variant_stages = memnew_arr(ShaderStageArray, variant_defines.size()); + typedef Vector<uint8_t> ShaderStageData; + p_version->variant_data = memnew_arr(ShaderStageData, variant_defines.size()); if (shader_cache_dir_valid) { if (_load_from_cache(p_version)) { @@ -571,19 +502,19 @@ void ShaderRD::_compile_version(Version *p_version) { } } memdelete_arr(p_version->variants); - if (p_version->variant_stages) { - memdelete_arr(p_version->variant_stages); + if (p_version->variant_data) { + memdelete_arr(p_version->variant_data); } p_version->variants = nullptr; - p_version->variant_stages = nullptr; + p_version->variant_data = nullptr; return; } else if (shader_cache_dir_valid) { //save shader cache _save_to_cache(p_version); } - memdelete_arr(p_version->variant_stages); //clear stages - p_version->variant_stages = nullptr; + memdelete_arr(p_version->variant_data); //clear stages + p_version->variant_data = nullptr; p_version->valid = true; } diff --git a/servers/rendering/renderer_rd/shader_rd.h b/servers/rendering/renderer_rd/shader_rd.h index 9a68e02007..529328f0ed 100644 --- a/servers/rendering/renderer_rd/shader_rd.h +++ b/servers/rendering/renderer_rd/shader_rd.h @@ -59,7 +59,7 @@ class ShaderRD { Map<StringName, CharString> code_sections; Vector<CharString> custom_defines; - Vector<RD::ShaderStageData> *variant_stages = nullptr; + Vector<uint8_t> *variant_data = nullptr; RID *variants = nullptr; //same size as version defines bool valid; diff --git a/servers/rendering/rendering_device.cpp b/servers/rendering/rendering_device.cpp index 3594939362..b298ad193b 100644 --- a/servers/rendering/rendering_device.cpp +++ b/servers/rendering/rendering_device.cpp @@ -38,23 +38,23 @@ RenderingDevice *RenderingDevice::get_singleton() { return singleton; } -RenderingDevice::ShaderCompileFunction RenderingDevice::compile_function = nullptr; +RenderingDevice::ShaderCompileToSPIRVFunction RenderingDevice::compile_to_spirv_function = nullptr; RenderingDevice::ShaderCacheFunction RenderingDevice::cache_function = nullptr; -RenderingDevice::ShaderGetCacheKeyFunction RenderingDevice::get_cache_key_function = nullptr; +RenderingDevice::ShaderSPIRVGetCacheKeyFunction RenderingDevice::get_spirv_cache_key_function = nullptr; -void RenderingDevice::shader_set_compile_function(ShaderCompileFunction p_function) { - compile_function = p_function; +void RenderingDevice::shader_set_compile_to_spirv_function(ShaderCompileToSPIRVFunction p_function) { + compile_to_spirv_function = p_function; } -void RenderingDevice::shader_set_cache_function(ShaderCacheFunction p_function) { +void RenderingDevice::shader_set_spirv_cache_function(ShaderCacheFunction p_function) { cache_function = p_function; } -void RenderingDevice::shader_set_get_cache_key_function(ShaderGetCacheKeyFunction p_function) { - get_cache_key_function = p_function; +void RenderingDevice::shader_set_get_cache_key_function(ShaderSPIRVGetCacheKeyFunction p_function) { + get_spirv_cache_key_function = p_function; } -Vector<uint8_t> RenderingDevice::shader_compile_from_source(ShaderStage p_stage, const String &p_source_code, ShaderLanguage p_language, String *r_error, bool p_allow_cache) { +Vector<uint8_t> RenderingDevice::shader_compile_spirv_from_source(ShaderStage p_stage, const String &p_source_code, ShaderLanguage p_language, String *r_error, bool p_allow_cache) { if (p_allow_cache && cache_function) { Vector<uint8_t> cache = cache_function(p_stage, p_source_code, p_language); if (cache.size()) { @@ -62,18 +62,24 @@ Vector<uint8_t> RenderingDevice::shader_compile_from_source(ShaderStage p_stage, } } - ERR_FAIL_COND_V(!compile_function, Vector<uint8_t>()); + ERR_FAIL_COND_V(!compile_to_spirv_function, Vector<uint8_t>()); - return compile_function(p_stage, p_source_code, p_language, r_error, &device_capabilities); + return compile_to_spirv_function(p_stage, p_source_code, p_language, r_error, &device_capabilities); } -String RenderingDevice::shader_get_cache_key() const { - if (get_cache_key_function) { - return get_cache_key_function(&device_capabilities); +String RenderingDevice::shader_get_spirv_cache_key() const { + if (get_spirv_cache_key_function) { + return get_spirv_cache_key_function(&device_capabilities); } return String(); } +RID RenderingDevice::shader_create_from_spirv(const Vector<ShaderStageSPIRVData> &p_spirv) { + Vector<uint8_t> bytecode = shader_compile_binary_from_spirv(p_spirv); + ERR_FAIL_COND_V(bytecode.size() == 0, RID()); + return shader_create_from_bytecode(bytecode); +} + RID RenderingDevice::_texture_create(const Ref<RDTextureFormat> &p_format, const Ref<RDTextureView> &p_view, const TypedArray<PackedByteArray> &p_data) { ERR_FAIL_COND_V(p_format.is_null(), RID()); ERR_FAIL_COND_V(p_view.is_null(), RID()); @@ -170,40 +176,59 @@ RID RenderingDevice::_vertex_array_create(uint32_t p_vertex_count, VertexFormatI return vertex_array_create(p_vertex_count, p_vertex_format, buffers); } -Ref<RDShaderBytecode> RenderingDevice::_shader_compile_from_source(const Ref<RDShaderSource> &p_source, bool p_allow_cache) { - ERR_FAIL_COND_V(p_source.is_null(), Ref<RDShaderBytecode>()); +Ref<RDShaderSPIRV> RenderingDevice::_shader_compile_spirv_from_source(const Ref<RDShaderSource> &p_source, bool p_allow_cache) { + ERR_FAIL_COND_V(p_source.is_null(), Ref<RDShaderSPIRV>()); - Ref<RDShaderBytecode> bytecode; + Ref<RDShaderSPIRV> bytecode; bytecode.instantiate(); for (int i = 0; i < RD::SHADER_STAGE_MAX; i++) { String error; ShaderStage stage = ShaderStage(i); - Vector<uint8_t> spirv = shader_compile_from_source(stage, p_source->get_stage_source(stage), p_source->get_language(), &error, p_allow_cache); + Vector<uint8_t> spirv = shader_compile_spirv_from_source(stage, p_source->get_stage_source(stage), p_source->get_language(), &error, p_allow_cache); bytecode->set_stage_bytecode(stage, spirv); bytecode->set_stage_compile_error(stage, error); } return bytecode; } -RID RenderingDevice::shader_create_from_bytecode(const Ref<RDShaderBytecode> &p_bytecode) { - ERR_FAIL_COND_V(p_bytecode.is_null(), RID()); +Vector<uint8_t> RenderingDevice::_shader_compile_binary_from_spirv(const Ref<RDShaderSPIRV> &p_spirv) { + ERR_FAIL_COND_V(p_spirv.is_null(), Vector<uint8_t>()); - Vector<ShaderStageData> stage_data; + Vector<ShaderStageSPIRVData> stage_data; for (int i = 0; i < RD::SHADER_STAGE_MAX; i++) { ShaderStage stage = ShaderStage(i); - ShaderStageData sd; + ShaderStageSPIRVData sd; sd.shader_stage = stage; - String error = p_bytecode->get_stage_compile_error(stage); - ERR_FAIL_COND_V_MSG(error != String(), RID(), "Can't create a shader from an errored bytecode. Check errors in source bytecode."); - sd.spir_v = p_bytecode->get_stage_bytecode(stage); + String error = p_spirv->get_stage_compile_error(stage); + ERR_FAIL_COND_V_MSG(error != String(), Vector<uint8_t>(), "Can't create a shader from an errored bytecode. Check errors in source bytecode."); + sd.spir_v = p_spirv->get_stage_bytecode(stage); if (sd.spir_v.is_empty()) { continue; } stage_data.push_back(sd); } - return shader_create(stage_data); + return shader_compile_binary_from_spirv(stage_data); +} + +RID RenderingDevice::_shader_create_from_spirv(const Ref<RDShaderSPIRV> &p_spirv) { + ERR_FAIL_COND_V(p_spirv.is_null(), RID()); + + Vector<ShaderStageSPIRVData> stage_data; + for (int i = 0; i < RD::SHADER_STAGE_MAX; i++) { + ShaderStage stage = ShaderStage(i); + ShaderStageSPIRVData sd; + sd.shader_stage = stage; + String error = p_spirv->get_stage_compile_error(stage); + ERR_FAIL_COND_V_MSG(error != String(), RID(), "Can't create a shader from an errored bytecode. Check errors in source bytecode."); + sd.spir_v = p_spirv->get_stage_bytecode(stage); + if (sd.spir_v.is_empty()) { + continue; + } + stage_data.push_back(sd); + } + return shader_create_from_spirv(stage_data); } RID RenderingDevice::_uniform_set_create(const Array &p_uniforms, RID p_shader, uint32_t p_shader_set) { @@ -366,8 +391,10 @@ void RenderingDevice::_bind_methods() { ClassDB::bind_method(D_METHOD("index_buffer_create", "size_indices", "format", "data", "use_restart_indices"), &RenderingDevice::index_buffer_create, DEFVAL(Vector<uint8_t>()), DEFVAL(false)); ClassDB::bind_method(D_METHOD("index_array_create", "index_buffer", "index_offset", "index_count"), &RenderingDevice::index_array_create); - ClassDB::bind_method(D_METHOD("shader_compile_from_source", "shader_source", "allow_cache"), &RenderingDevice::_shader_compile_from_source, DEFVAL(true)); - ClassDB::bind_method(D_METHOD("shader_create", "shader_data"), &RenderingDevice::shader_create_from_bytecode); + ClassDB::bind_method(D_METHOD("shader_compile_spirv_from_source", "shader_source", "allow_cache"), &RenderingDevice::_shader_compile_spirv_from_source, DEFVAL(true)); + ClassDB::bind_method(D_METHOD("shader_compile_binary_from_spirv", "spirv_data"), &RenderingDevice::_shader_compile_binary_from_spirv); + ClassDB::bind_method(D_METHOD("shader_create_from_spirv", "spirv_data"), &RenderingDevice::_shader_compile_binary_from_spirv); + ClassDB::bind_method(D_METHOD("shader_create_from_bytecode", "binary_data"), &RenderingDevice::shader_create_from_bytecode); ClassDB::bind_method(D_METHOD("shader_get_vertex_input_attribute_mask", "shader"), &RenderingDevice::shader_get_vertex_input_attribute_mask); ClassDB::bind_method(D_METHOD("uniform_buffer_create", "size_bytes", "data"), &RenderingDevice::uniform_buffer_create, DEFVAL(Vector<uint8_t>())); diff --git a/servers/rendering/rendering_device.h b/servers/rendering/rendering_device.h index 9a154ef7e9..eaf1ace798 100644 --- a/servers/rendering/rendering_device.h +++ b/servers/rendering/rendering_device.h @@ -41,7 +41,7 @@ class RDAttachmentFormat; class RDSamplerState; class RDVertexAttribute; class RDShaderSource; -class RDShaderBytecode; +class RDShaderSPIRV; class RDUniforms; class RDPipelineRasterizationState; class RDPipelineMultisampleState; @@ -105,14 +105,14 @@ public: bool supports_multiview = false; // If true this device supports multiview options }; - typedef String (*ShaderGetCacheKeyFunction)(const Capabilities *p_capabilities); - typedef Vector<uint8_t> (*ShaderCompileFunction)(ShaderStage p_stage, const String &p_source_code, ShaderLanguage p_language, String *r_error, const Capabilities *p_capabilities); + typedef String (*ShaderSPIRVGetCacheKeyFunction)(const Capabilities *p_capabilities); + typedef Vector<uint8_t> (*ShaderCompileToSPIRVFunction)(ShaderStage p_stage, const String &p_source_code, ShaderLanguage p_language, String *r_error, const Capabilities *p_capabilities); typedef Vector<uint8_t> (*ShaderCacheFunction)(ShaderStage p_stage, const String &p_source_code, ShaderLanguage p_language); private: - static ShaderCompileFunction compile_function; + static ShaderCompileToSPIRVFunction compile_to_spirv_function; static ShaderCacheFunction cache_function; - static ShaderGetCacheKeyFunction get_cache_key_function; + static ShaderSPIRVGetCacheKeyFunction get_spirv_cache_key_function; static RenderingDevice *singleton; @@ -651,24 +651,28 @@ public: const Capabilities *get_device_capabilities() const { return &device_capabilities; }; - virtual Vector<uint8_t> shader_compile_from_source(ShaderStage p_stage, const String &p_source_code, ShaderLanguage p_language = SHADER_LANGUAGE_GLSL, String *r_error = nullptr, bool p_allow_cache = true); - virtual String shader_get_cache_key() const; + virtual Vector<uint8_t> shader_compile_spirv_from_source(ShaderStage p_stage, const String &p_source_code, ShaderLanguage p_language = SHADER_LANGUAGE_GLSL, String *r_error = nullptr, bool p_allow_cache = true); + virtual String shader_get_spirv_cache_key() const; - static void shader_set_compile_function(ShaderCompileFunction p_function); - static void shader_set_cache_function(ShaderCacheFunction p_function); - static void shader_set_get_cache_key_function(ShaderGetCacheKeyFunction p_function); + static void shader_set_compile_to_spirv_function(ShaderCompileToSPIRVFunction p_function); + static void shader_set_spirv_cache_function(ShaderCacheFunction p_function); + static void shader_set_get_cache_key_function(ShaderSPIRVGetCacheKeyFunction p_function); - struct ShaderStageData { + struct ShaderStageSPIRVData { ShaderStage shader_stage; Vector<uint8_t> spir_v; - ShaderStageData() { + ShaderStageSPIRVData() { shader_stage = SHADER_STAGE_VERTEX; } }; - RID shader_create_from_bytecode(const Ref<RDShaderBytecode> &p_bytecode); - virtual RID shader_create(const Vector<ShaderStageData> &p_stages) = 0; + virtual String shader_get_binary_cache_key() const = 0; + virtual Vector<uint8_t> shader_compile_binary_from_spirv(const Vector<ShaderStageSPIRVData> &p_spirv) = 0; + + virtual RID shader_create_from_spirv(const Vector<ShaderStageSPIRVData> &p_spirv); + virtual RID shader_create_from_bytecode(const Vector<uint8_t> &p_shader_binary) = 0; + virtual uint32_t shader_get_vertex_input_attribute_mask(RID p_shader) = 0; /******************/ @@ -1194,7 +1198,9 @@ protected: VertexFormatID _vertex_format_create(const TypedArray<RDVertexAttribute> &p_vertex_formats); RID _vertex_array_create(uint32_t p_vertex_count, VertexFormatID p_vertex_format, const TypedArray<RID> &p_src_buffers); - Ref<RDShaderBytecode> _shader_compile_from_source(const Ref<RDShaderSource> &p_source, bool p_allow_cache = true); + Ref<RDShaderSPIRV> _shader_compile_spirv_from_source(const Ref<RDShaderSource> &p_source, bool p_allow_cache = true); + Vector<uint8_t> _shader_compile_binary_from_spirv(const Ref<RDShaderSPIRV> &p_bytecode); + RID _shader_create_from_spirv(const Ref<RDShaderSPIRV> &p_spirv); RID _uniform_set_create(const Array &p_uniforms, RID p_shader, uint32_t p_shader_set); diff --git a/servers/rendering/rendering_device_binds.cpp b/servers/rendering/rendering_device_binds.cpp index 2652edb1bc..fa3f2f3895 100644 --- a/servers/rendering/rendering_device_binds.cpp +++ b/servers/rendering/rendering_device_binds.cpp @@ -172,7 +172,7 @@ Error RDShaderFile::parse_versions_from_text(const String &p_text, const String /* STEP 2, Compile the versions, add to shader file */ for (Map<StringName, String>::Element *E = version_texts.front(); E; E = E->next()) { - Ref<RDShaderBytecode> bytecode; + Ref<RDShaderSPIRV> bytecode; bytecode.instantiate(); for (int i = 0; i < RD::SHADER_STAGE_MAX; i++) { @@ -182,7 +182,7 @@ Error RDShaderFile::parse_versions_from_text(const String &p_text, const String } code = code.replace("VERSION_DEFINES", E->get()); String error; - Vector<uint8_t> spirv = RenderingDevice::get_singleton()->shader_compile_from_source(RD::ShaderStage(i), code, RD::SHADER_LANGUAGE_GLSL, &error, false); + Vector<uint8_t> spirv = RenderingDevice::get_singleton()->shader_compile_spirv_from_source(RD::ShaderStage(i), code, RD::SHADER_LANGUAGE_GLSL, &error, false); bytecode->set_stage_bytecode(RD::ShaderStage(i), spirv); if (error != "") { error += String() + "\n\nStage '" + stage_str[i] + "' source code: \n\n"; diff --git a/servers/rendering/rendering_device_binds.h b/servers/rendering/rendering_device_binds.h index 75a91d8419..ccc3e2fb39 100644 --- a/servers/rendering/rendering_device_binds.h +++ b/servers/rendering/rendering_device_binds.h @@ -263,8 +263,8 @@ protected: } }; -class RDShaderBytecode : public Resource { - GDCLASS(RDShaderBytecode, Resource) +class RDShaderSPIRV : public Resource { + GDCLASS(RDShaderSPIRV, Resource) Vector<uint8_t> bytecode[RD::SHADER_STAGE_MAX]; String compile_error[RD::SHADER_STAGE_MAX]; @@ -280,6 +280,19 @@ public: return bytecode[p_stage]; } + Vector<RD::ShaderStageSPIRVData> get_stages() const { + Vector<RD::ShaderStageSPIRVData> stages; + for (int i = 0; i < RD::SHADER_STAGE_MAX; i++) { + if (bytecode[i].size()) { + RD::ShaderStageSPIRVData stage; + stage.shader_stage = RD::ShaderStage(i); + stage.spir_v = bytecode[i]; + stages.push_back(stage); + } + } + return stages; + } + void set_stage_compile_error(RD::ShaderStage p_stage, const String &p_compile_error) { ERR_FAIL_INDEX(p_stage, RD::SHADER_STAGE_MAX); compile_error[p_stage] = p_compile_error; @@ -292,11 +305,11 @@ public: protected: static void _bind_methods() { - ClassDB::bind_method(D_METHOD("set_stage_bytecode", "stage", "bytecode"), &RDShaderBytecode::set_stage_bytecode); - ClassDB::bind_method(D_METHOD("get_stage_bytecode", "stage"), &RDShaderBytecode::get_stage_bytecode); + ClassDB::bind_method(D_METHOD("set_stage_bytecode", "stage", "bytecode"), &RDShaderSPIRV::set_stage_bytecode); + ClassDB::bind_method(D_METHOD("get_stage_bytecode", "stage"), &RDShaderSPIRV::get_stage_bytecode); - ClassDB::bind_method(D_METHOD("set_stage_compile_error", "stage", "compile_error"), &RDShaderBytecode::set_stage_compile_error); - ClassDB::bind_method(D_METHOD("get_stage_compile_error", "stage"), &RDShaderBytecode::get_stage_compile_error); + ClassDB::bind_method(D_METHOD("set_stage_compile_error", "stage", "compile_error"), &RDShaderSPIRV::set_stage_compile_error); + ClassDB::bind_method(D_METHOD("get_stage_compile_error", "stage"), &RDShaderSPIRV::get_stage_compile_error); ADD_GROUP("Bytecode", "bytecode_"); ADD_PROPERTYI(PropertyInfo(Variant::PACKED_BYTE_ARRAY, "bytecode_vertex"), "set_stage_bytecode", "get_stage_bytecode", RD::SHADER_STAGE_VERTEX); @@ -316,24 +329,29 @@ protected: class RDShaderFile : public Resource { GDCLASS(RDShaderFile, Resource) - Map<StringName, Ref<RDShaderBytecode>> versions; + Map<StringName, Ref<RDShaderSPIRV>> versions; String base_error; public: - void set_bytecode(const Ref<RDShaderBytecode> &p_bytecode, const StringName &p_version = StringName()) { + void set_bytecode(const Ref<RDShaderSPIRV> &p_bytecode, const StringName &p_version = StringName()) { ERR_FAIL_COND(p_bytecode.is_null()); versions[p_version] = p_bytecode; emit_changed(); } - Ref<RDShaderBytecode> get_bytecode(const StringName &p_version = StringName()) const { - ERR_FAIL_COND_V(!versions.has(p_version), Ref<RDShaderBytecode>()); + Ref<RDShaderSPIRV> get_spirv(const StringName &p_version = StringName()) const { + ERR_FAIL_COND_V(!versions.has(p_version), Ref<RDShaderSPIRV>()); return versions[p_version]; } + Vector<RD::ShaderStageSPIRVData> get_spirv_stages(const StringName &p_version = StringName()) const { + ERR_FAIL_COND_V(!versions.has(p_version), Vector<RD::ShaderStageSPIRVData>()); + return versions[p_version]->get_stages(); + } + Vector<StringName> get_version_list() const { Vector<StringName> vnames; - for (Map<StringName, Ref<RDShaderBytecode>>::Element *E = versions.front(); E; E = E->next()) { + for (Map<StringName, Ref<RDShaderSPIRV>>::Element *E = versions.front(); E; E = E->next()) { vnames.push_back(E->key()); } vnames.sort_custom<StringName::AlphCompare>(); @@ -353,7 +371,7 @@ public: if (base_error != "") { ERR_PRINT("Error parsing shader '" + p_file + "':\n\n" + base_error); } else { - for (Map<StringName, Ref<RDShaderBytecode>>::Element *E = versions.front(); E; E = E->next()) { + for (Map<StringName, Ref<RDShaderSPIRV>>::Element *E = versions.front(); E; E = E->next()) { for (int i = 0; i < RD::SHADER_STAGE_MAX; i++) { String error = E->get()->get_stage_compile_error(RD::ShaderStage(i)); if (error != String()) { @@ -390,7 +408,7 @@ protected: p_versions.get_key_list(&keys); for (const Variant &E : keys) { StringName name = E; - Ref<RDShaderBytecode> bc = p_versions[E]; + Ref<RDShaderSPIRV> bc = p_versions[E]; ERR_CONTINUE(bc.is_null()); versions[name] = bc; } @@ -400,7 +418,7 @@ protected: static void _bind_methods() { ClassDB::bind_method(D_METHOD("set_bytecode", "bytecode", "version"), &RDShaderFile::set_bytecode, DEFVAL(StringName())); - ClassDB::bind_method(D_METHOD("get_bytecode", "version"), &RDShaderFile::get_bytecode, DEFVAL(StringName())); + ClassDB::bind_method(D_METHOD("get_spirv", "version"), &RDShaderFile::get_spirv, DEFVAL(StringName())); ClassDB::bind_method(D_METHOD("get_version_list"), &RDShaderFile::get_version_list); ClassDB::bind_method(D_METHOD("set_base_error", "error"), &RDShaderFile::set_base_error); diff --git a/servers/rendering/shader_language.cpp b/servers/rendering/shader_language.cpp index 8f4f248276..baa5381554 100644 --- a/servers/rendering/shader_language.cpp +++ b/servers/rendering/shader_language.cpp @@ -2820,6 +2820,20 @@ bool ShaderLanguage::is_token_operator(TokenType p_type) { p_type == TK_COLON); } +bool ShaderLanguage::is_token_operator_assign(TokenType p_type) { + return (p_type == TK_OP_ASSIGN || + p_type == TK_OP_ASSIGN_ADD || + p_type == TK_OP_ASSIGN_SUB || + p_type == TK_OP_ASSIGN_MUL || + p_type == TK_OP_ASSIGN_DIV || + p_type == TK_OP_ASSIGN_MOD || + p_type == TK_OP_ASSIGN_SHIFT_LEFT || + p_type == TK_OP_ASSIGN_SHIFT_RIGHT || + p_type == TK_OP_ASSIGN_BIT_AND || + p_type == TK_OP_ASSIGN_BIT_OR || + p_type == TK_OP_ASSIGN_BIT_XOR); +} + bool ShaderLanguage::convert_constant(ConstantNode *p_constant, DataType p_to_type, ConstantNode::Value *p_value) { if (p_constant->datatype == p_to_type) { if (p_value) { @@ -4240,7 +4254,8 @@ ShaderLanguage::Node *ShaderLanguage::_parse_expression(BlockNode *p_block, cons Token next_token = _get_token(); _set_tkpos(prev_pos); String error; - if (next_token.type == TK_OP_ASSIGN) { + + if (is_token_operator_assign(next_token.type)) { if (!_validate_varying_assign(shader->varyings[identifier], &error)) { _set_error(error); return nullptr; @@ -4781,10 +4796,12 @@ ShaderLanguage::Node *ShaderLanguage::_parse_expression(BlockNode *p_block, cons String member_struct_name; if (expr->get_array_size() > 0) { - uint32_t index_constant = static_cast<ConstantNode *>(index)->values[0].uint; - if (index_constant >= (uint32_t)expr->get_array_size()) { - _set_error(vformat("Index [%s] out of range [%s..%s]", index_constant, 0, expr->get_array_size() - 1)); - return nullptr; + if (index->type == Node::TYPE_CONSTANT) { + uint32_t index_constant = static_cast<ConstantNode *>(index)->values[0].uint; + if (index_constant >= (uint32_t)expr->get_array_size()) { + _set_error(vformat("Index [%s] out of range [%s..%s]", index_constant, 0, expr->get_array_size() - 1)); + return nullptr; + } } member_type = expr->get_datatype(); if (member_type == TYPE_STRUCT) { diff --git a/servers/rendering/shader_language.h b/servers/rendering/shader_language.h index 59c6e19338..c02d6c47ec 100644 --- a/servers/rendering/shader_language.h +++ b/servers/rendering/shader_language.h @@ -766,6 +766,7 @@ public: static String get_datatype_name(DataType p_type); static bool is_token_nonvoid_datatype(TokenType p_type); static bool is_token_operator(TokenType p_type); + static bool is_token_operator_assign(TokenType p_type); static bool convert_constant(ConstantNode *p_constant, DataType p_to_type, ConstantNode::Value *p_value = nullptr); static DataType get_scalar_type(DataType p_type); diff --git a/tests/test_physics_2d.cpp b/tests/test_physics_2d.cpp index a9e2e92b34..40dc74e89c 100644 --- a/tests/test_physics_2d.cpp +++ b/tests/test_physics_2d.cpp @@ -386,7 +386,7 @@ public: //_add_plane(Vector2(-1,0).normalized(),-600); } - virtual bool process(float p_time) override { + virtual bool process(double p_time) override { return false; } virtual void finalize() override { diff --git a/tests/test_physics_3d.cpp b/tests/test_physics_3d.cpp index 4488e4bf64..ed49b60c71 100644 --- a/tests/test_physics_3d.cpp +++ b/tests/test_physics_3d.cpp @@ -313,7 +313,7 @@ public: test_fall(); quit = false; } - virtual bool physics_process(float p_time) override { + virtual bool physics_process(double p_time) override { if (mover.is_valid()) { static real_t joy_speed = 10; PhysicsServer3D *ps = PhysicsServer3D::get_singleton(); @@ -399,7 +399,7 @@ public: create_static_plane(Plane(Vector3(0, 1, 0), -1)); } - virtual bool process(float p_time) override { + virtual bool process(double p_time) override { return false; } diff --git a/tests/test_render.cpp b/tests/test_render.cpp index 00ce187847..beff86dd83 100644 --- a/tests/test_render.cpp +++ b/tests/test_render.cpp @@ -199,7 +199,7 @@ public: ofs = 0; quit = false; } - virtual bool iteration(float p_time) { + virtual bool iteration(double p_time) { RenderingServer *vs = RenderingServer::get_singleton(); //Transform3D t; //t.rotate(Vector3(0, 1, 0), ofs); @@ -223,7 +223,7 @@ public: return quit; } - virtual bool idle(float p_time) { + virtual bool idle(double p_time) { return quit; } |