From 886c2d9681e83d8e1aed2a793f5d8136c2a98c4e Mon Sep 17 00:00:00 2001 From: Yuri Rubinsky Date: Wed, 13 Jul 2022 11:31:27 +0300 Subject: Implement shader uniform groups/subgroups --- .../forward_clustered/scene_shader_forward_clustered.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'servers/rendering/renderer_rd/forward_clustered') diff --git a/servers/rendering/renderer_rd/forward_clustered/scene_shader_forward_clustered.cpp b/servers/rendering/renderer_rd/forward_clustered/scene_shader_forward_clustered.cpp index a559241846..a2995a8902 100644 --- a/servers/rendering/renderer_rd/forward_clustered/scene_shader_forward_clustered.cpp +++ b/servers/rendering/renderer_rd/forward_clustered/scene_shader_forward_clustered.cpp @@ -407,7 +407,22 @@ void SceneShaderForwardClustered::ShaderData::get_param_list(List } } + String last_group; for (const KeyValue &E : order) { + String group = uniforms[E.value].group; + if (!uniforms[E.value].subgroup.is_empty()) { + group += "::" + uniforms[E.value].subgroup; + } + + if (group != last_group) { + PropertyInfo pi; + pi.usage = PROPERTY_USAGE_GROUP; + pi.name = group; + p_param_list->push_back(pi); + + last_group = group; + } + PropertyInfo pi = ShaderLanguage::uniform_to_property_info(uniforms[E.value]); pi.name = E.value; p_param_list->push_back(pi); -- cgit v1.2.3