summaryrefslogtreecommitdiff
path: root/editor/plugins
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-12-22 13:29:03 +0100
committerGitHub <noreply@github.com>2021-12-22 13:29:03 +0100
commit0f6a6ca5be1d674a6dfce03684bbf469d77e5e63 (patch)
tree45dc27a0b90ad8c2fef03e456bfdb0c2f7981041 /editor/plugins
parent656f81eec729b48138354a9fa2d72076d448182a (diff)
parente8a457ba898ffde5dbc02d573103f00d626f3a5b (diff)
Merge pull request #56131 from Chaosus/shader_refactor_render_modes
Diffstat (limited to 'editor/plugins')
-rw-r--r--editor/plugins/shader_editor_plugin.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/editor/plugins/shader_editor_plugin.cpp b/editor/plugins/shader_editor_plugin.cpp
index fa23ccf200..d5ee52dfab 100644
--- a/editor/plugins/shader_editor_plugin.cpp
+++ b/editor/plugins/shader_editor_plugin.cpp
@@ -138,8 +138,18 @@ void ShaderTextEditor::_load_theme_settings() {
}
}
- for (int i = 0; i < ShaderTypes::get_singleton()->get_modes(RenderingServer::ShaderMode(shader->get_mode())).size(); i++) {
- built_ins.push_back(ShaderTypes::get_singleton()->get_modes(RenderingServer::ShaderMode(shader->get_mode()))[i]);
+ const Vector<ShaderLanguage::ModeInfo> &modes = ShaderTypes::get_singleton()->get_modes(RenderingServer::ShaderMode(shader->get_mode()));
+
+ for (int i = 0; i < modes.size(); i++) {
+ const ShaderLanguage::ModeInfo &info = modes[i];
+
+ if (!info.options.is_empty()) {
+ for (int j = 0; j < info.options.size(); j++) {
+ built_ins.push_back(String(info.name) + "_" + String(info.options[j]));
+ }
+ } else {
+ built_ins.push_back(String(info.name));
+ }
}
}