diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/gdscript/gdscript.cpp | 3 | ||||
-rw-r--r-- | modules/gdscript/gdscript_compiler.cpp | 2 | ||||
-rw-r--r-- | modules/gdscript/gdscript_parser.cpp | 11 | ||||
-rw-r--r-- | modules/glslang/register_types.cpp | 34 |
4 files changed, 33 insertions, 17 deletions
diff --git a/modules/gdscript/gdscript.cpp b/modules/gdscript/gdscript.cpp index e7aa3214b4..e74314389d 100644 --- a/modules/gdscript/gdscript.cpp +++ b/modules/gdscript/gdscript.cpp @@ -536,6 +536,9 @@ void GDScript::_update_doc() { List<PropertyInfo> props; _get_script_property_list(&props, false); for (int i = 0; i < props.size(); i++) { + if (props[i].usage & PROPERTY_USAGE_CATEGORY || props[i].usage & PROPERTY_USAGE_GROUP || props[i].usage & PROPERTY_USAGE_SUBGROUP) { + continue; + } ScriptMemberInfo scr_member_info; scr_member_info.propinfo = props[i]; scr_member_info.propinfo.usage |= PROPERTY_USAGE_NIL_IS_VARIANT; diff --git a/modules/gdscript/gdscript_compiler.cpp b/modules/gdscript/gdscript_compiler.cpp index af8e4b3746..e36252ada5 100644 --- a/modules/gdscript/gdscript_compiler.cpp +++ b/modules/gdscript/gdscript_compiler.cpp @@ -43,7 +43,7 @@ bool GDScriptCompiler::_is_class_member_property(CodeGen &codegen, const StringN return false; } - if (codegen.locals.has(p_name)) { + if (codegen.parameters.has(p_name) || codegen.locals.has(p_name)) { return false; //shadowed } diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp index 6c5d416cf1..01a672c330 100644 --- a/modules/gdscript/gdscript_parser.cpp +++ b/modules/gdscript/gdscript_parser.cpp @@ -3422,7 +3422,16 @@ void GDScriptParser::get_class_doc_comment(int p_line, String &p_brief, String & p_tutorials.append(Pair<String, String>(title, link)); break; case DONE: - return; + break; + } + } + if (current_class->members.size() > 0) { + const ClassNode::Member &m = current_class->members[0]; + int first_member_line = m.get_line(); + if (first_member_line == line) { + p_brief = ""; + p_desc = ""; + p_tutorials.clear(); } } } diff --git a/modules/glslang/register_types.cpp b/modules/glslang/register_types.cpp index 64891d9ee8..b1c2140039 100644 --- a/modules/glslang/register_types.cpp +++ b/modules/glslang/register_types.cpp @@ -38,7 +38,8 @@ #include <glslang/Public/ShaderLang.h> #include <glslang/SPIRV/GlslangToSpv.h> -static Vector<uint8_t> _compile_shader_glsl(RenderingDevice::ShaderStage p_stage, const String &p_source_code, RenderingDevice::ShaderLanguage p_language, String *r_error, const RenderingDevice::Capabilities *p_capabilities) { +static Vector<uint8_t> _compile_shader_glsl(RenderingDevice::ShaderStage p_stage, const String &p_source_code, RenderingDevice::ShaderLanguage p_language, String *r_error, const RenderingDevice *p_render_device) { + const RD::Capabilities *capabilities = p_render_device->get_device_capabilities(); Vector<uint8_t> ret; ERR_FAIL_COND_V(p_language == RenderingDevice::SHADER_LANGUAGE_HLSL, ret); @@ -58,12 +59,12 @@ static Vector<uint8_t> _compile_shader_glsl(RenderingDevice::ShaderStage p_stage glslang::EShTargetLanguageVersion TargetVersion = glslang::EShTargetSpv_1_5; glslang::TShader::ForbidIncluder includer; - if (p_capabilities->device_family == RenderingDevice::DeviceFamily::DEVICE_VULKAN) { - if (p_capabilities->version_major == 1 && p_capabilities->version_minor == 0) { + if (capabilities->device_family == RenderingDevice::DeviceFamily::DEVICE_VULKAN) { + if (capabilities->version_major == 1 && capabilities->version_minor == 0) { ClientVersion = glslang::EShTargetVulkan_1_0; TargetVersion = glslang::EShTargetSpv_1_0; check_subgroup_support = false; // subgroups are not supported in Vulkan 1.0 - } else if (p_capabilities->version_major == 1 && p_capabilities->version_minor == 1) { + } else if (capabilities->version_major == 1 && capabilities->version_minor == 1) { ClientVersion = glslang::EShTargetVulkan_1_1; TargetVersion = glslang::EShTargetSpv_1_3; } else { @@ -90,34 +91,36 @@ static Vector<uint8_t> _compile_shader_glsl(RenderingDevice::ShaderStage p_stage if (check_subgroup_support) { uint32_t stage_bit = 1 << p_stage; - if ((p_capabilities->subgroup_in_shaders & stage_bit) == stage_bit) { + uint32_t subgroup_in_shaders = uint32_t(p_render_device->limit_get(RD::LIMIT_SUBGROUP_IN_SHADERS)); + uint32_t subgroup_operations = uint32_t(p_render_device->limit_get(RD::LIMIT_SUBGROUP_OPERATIONS)); + if ((subgroup_in_shaders & stage_bit) == stage_bit) { // stage supports subgroups preamble += "#define has_GL_KHR_shader_subgroup_basic 1\n"; - if (p_capabilities->subgroup_operations & RenderingDevice::SUBGROUP_VOTE_BIT) { + if (subgroup_operations & RenderingDevice::SUBGROUP_VOTE_BIT) { preamble += "#define has_GL_KHR_shader_subgroup_vote 1\n"; } - if (p_capabilities->subgroup_operations & RenderingDevice::SUBGROUP_ARITHMETIC_BIT) { + if (subgroup_operations & RenderingDevice::SUBGROUP_ARITHMETIC_BIT) { preamble += "#define has_GL_KHR_shader_subgroup_arithmetic 1\n"; } - if (p_capabilities->subgroup_operations & RenderingDevice::SUBGROUP_BALLOT_BIT) { + if (subgroup_operations & RenderingDevice::SUBGROUP_BALLOT_BIT) { preamble += "#define has_GL_KHR_shader_subgroup_ballot 1\n"; } - if (p_capabilities->subgroup_operations & RenderingDevice::SUBGROUP_SHUFFLE_BIT) { + if (subgroup_operations & RenderingDevice::SUBGROUP_SHUFFLE_BIT) { preamble += "#define has_GL_KHR_shader_subgroup_shuffle 1\n"; } - if (p_capabilities->subgroup_operations & RenderingDevice::SUBGROUP_SHUFFLE_RELATIVE_BIT) { + if (subgroup_operations & RenderingDevice::SUBGROUP_SHUFFLE_RELATIVE_BIT) { preamble += "#define has_GL_KHR_shader_subgroup_shuffle_relative 1\n"; } - if (p_capabilities->subgroup_operations & RenderingDevice::SUBGROUP_CLUSTERED_BIT) { + if (subgroup_operations & RenderingDevice::SUBGROUP_CLUSTERED_BIT) { preamble += "#define has_GL_KHR_shader_subgroup_clustered 1\n"; } - if (p_capabilities->subgroup_operations & RenderingDevice::SUBGROUP_QUAD_BIT) { + if (subgroup_operations & RenderingDevice::SUBGROUP_QUAD_BIT) { preamble += "#define has_GL_KHR_shader_subgroup_quad 1\n"; } } } - if (p_capabilities->supports_multiview) { + if (p_render_device->has_feature(RD::SUPPORTS_MULTIVIEW)) { preamble += "#define has_VK_KHR_multiview 1\n"; } @@ -184,9 +187,10 @@ static Vector<uint8_t> _compile_shader_glsl(RenderingDevice::ShaderStage p_stage return ret; } -static String _get_cache_key_function_glsl(const RenderingDevice::Capabilities *p_capabilities) { +static String _get_cache_key_function_glsl(const RenderingDevice *p_render_device) { + const RD::Capabilities *capabilities = p_render_device->get_device_capabilities(); String version; - version = "SpirVGen=" + itos(glslang::GetSpirvGeneratorVersion()) + ", major=" + itos(p_capabilities->version_major) + ", minor=" + itos(p_capabilities->version_minor) + " , subgroup_size=" + itos(p_capabilities->subgroup_operations) + " , subgroup_ops=" + itos(p_capabilities->subgroup_operations) + " , subgroup_in_shaders=" + itos(p_capabilities->subgroup_in_shaders); + version = "SpirVGen=" + itos(glslang::GetSpirvGeneratorVersion()) + ", major=" + itos(capabilities->version_major) + ", minor=" + itos(capabilities->version_minor) + " , subgroup_size=" + itos(p_render_device->limit_get(RD::LIMIT_SUBGROUP_SIZE)) + " , subgroup_ops=" + itos(p_render_device->limit_get(RD::LIMIT_SUBGROUP_OPERATIONS)) + " , subgroup_in_shaders=" + itos(p_render_device->limit_get(RD::LIMIT_SUBGROUP_IN_SHADERS)); return version; } |