diff options
author | Yuri Rubinsky <chaosus89@gmail.com> | 2023-04-12 08:58:59 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-12 08:58:59 +0300 |
commit | 1433c98e9f75e4ccbbb873bad0ca006b2f7937fc (patch) | |
tree | a5566f8e689bb3affc6b93c3b70d8353853b8096 /servers/rendering/shader_language.cpp | |
parent | ab7cb2a95d060a6533e6ff5111c11f71972ab43f (diff) | |
parent | 12142f2b50b2873d9d5093fce6f7e8a63b831e56 (diff) | |
download | redot-engine-1433c98e9f75e4ccbbb873bad0ca006b2f7937fc.tar.gz |
Merge pull request #75831 from Chaosus/shader_fix_texture_array_hint_completion
Diffstat (limited to 'servers/rendering/shader_language.cpp')
-rw-r--r-- | servers/rendering/shader_language.cpp | 64 |
1 files changed, 35 insertions, 29 deletions
diff --git a/servers/rendering/shader_language.cpp b/servers/rendering/shader_language.cpp index 084fb64a53..12e99ba606 100644 --- a/servers/rendering/shader_language.cpp +++ b/servers/rendering/shader_language.cpp @@ -10529,36 +10529,42 @@ Error ShaderLanguage::complete(const String &p_code, const ShaderCompileInfo &p_ r_options->push_back(option); } - } else if ((int(completion_base) > int(TYPE_MAT4) && int(completion_base) < int(TYPE_STRUCT)) && !completion_base_array) { + } else if ((int(completion_base) > int(TYPE_MAT4) && int(completion_base) < int(TYPE_STRUCT))) { Vector<String> options; - if (current_uniform_filter == FILTER_DEFAULT) { - options.push_back("filter_linear"); - options.push_back("filter_linear_mipmap"); - options.push_back("filter_linear_mipmap_anisotropic"); - options.push_back("filter_nearest"); - options.push_back("filter_nearest_mipmap"); - options.push_back("filter_nearest_mipmap_anisotropic"); - } - if (current_uniform_hint == ShaderNode::Uniform::HINT_NONE) { - options.push_back("hint_anisotropy"); - options.push_back("hint_default_black"); - options.push_back("hint_default_white"); - options.push_back("hint_default_transparent"); - options.push_back("hint_normal"); - options.push_back("hint_roughness_a"); - options.push_back("hint_roughness_b"); - options.push_back("hint_roughness_g"); - options.push_back("hint_roughness_gray"); - options.push_back("hint_roughness_normal"); - options.push_back("hint_roughness_r"); - options.push_back("hint_screen_texture"); - options.push_back("hint_normal_roughness_texture"); - options.push_back("hint_depth_texture"); - options.push_back("source_color"); - } - if (current_uniform_repeat == REPEAT_DEFAULT) { - options.push_back("repeat_enable"); - options.push_back("repeat_disable"); + if (completion_base_array) { + if (current_uniform_hint == ShaderNode::Uniform::HINT_NONE) { + options.push_back("source_color"); + } + } else { + if (current_uniform_filter == FILTER_DEFAULT) { + options.push_back("filter_linear"); + options.push_back("filter_linear_mipmap"); + options.push_back("filter_linear_mipmap_anisotropic"); + options.push_back("filter_nearest"); + options.push_back("filter_nearest_mipmap"); + options.push_back("filter_nearest_mipmap_anisotropic"); + } + if (current_uniform_hint == ShaderNode::Uniform::HINT_NONE) { + options.push_back("hint_anisotropy"); + options.push_back("hint_default_black"); + options.push_back("hint_default_white"); + options.push_back("hint_default_transparent"); + options.push_back("hint_normal"); + options.push_back("hint_roughness_a"); + options.push_back("hint_roughness_b"); + options.push_back("hint_roughness_g"); + options.push_back("hint_roughness_gray"); + options.push_back("hint_roughness_normal"); + options.push_back("hint_roughness_r"); + options.push_back("hint_screen_texture"); + options.push_back("hint_normal_roughness_texture"); + options.push_back("hint_depth_texture"); + options.push_back("source_color"); + } + if (current_uniform_repeat == REPEAT_DEFAULT) { + options.push_back("repeat_enable"); + options.push_back("repeat_disable"); + } } for (int i = 0; i < options.size(); i++) { |