diff options
author | Yuri Rubinsky <chaosus89@gmail.com> | 2024-07-26 12:19:13 +0300 |
---|---|---|
committer | Yuri Rubinsky <chaosus89@gmail.com> | 2024-07-29 09:19:09 +0300 |
commit | e41048e16e51fd74bec7aeaca6bb30d3f568f29a (patch) | |
tree | 420e3551be15e8fed3be8dedc46974d8bc8db64f /drivers | |
parent | 88d9325065a3e00e9e168ffad4ff93e12455a357 (diff) | |
download | redot-engine-e41048e16e51fd74bec7aeaca6bb30d3f568f29a.tar.gz |
Fix texture samplers to not being last in the property list
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gles3/storage/material_storage.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/gles3/storage/material_storage.cpp b/drivers/gles3/storage/material_storage.cpp index 41c23fc3ec..25af7ff691 100644 --- a/drivers/gles3/storage/material_storage.cpp +++ b/drivers/gles3/storage/material_storage.cpp @@ -586,11 +586,7 @@ void ShaderData::get_shader_uniform_list(List<PropertyInfo> *p_param_list) const if (E.value.scope != ShaderLanguage::ShaderNode::Uniform::SCOPE_LOCAL) { continue; } - if (E.value.texture_order >= 0) { - filtered_uniforms.push_back(Pair<StringName, int>(E.key, E.value.texture_order + 100000)); - } else { - filtered_uniforms.push_back(Pair<StringName, int>(E.key, E.value.order)); - } + filtered_uniforms.push_back(Pair<StringName, int>(E.key, E.value.prop_order)); } int uniform_count = filtered_uniforms.size(); sorter.sort(filtered_uniforms.ptr(), uniform_count); @@ -640,7 +636,7 @@ bool ShaderData::is_parameter_texture(const StringName &p_param) const { return false; } - return uniforms[p_param].texture_order >= 0; + return uniforms[p_param].is_texture(); } /////////////////////////////////////////////////////////////////////////// @@ -719,7 +715,7 @@ void MaterialData::update_uniform_buffer(const HashMap<StringName, ShaderLanguag bool uses_global_buffer = false; for (const KeyValue<StringName, ShaderLanguage::ShaderNode::Uniform> &E : p_uniforms) { - if (E.value.order < 0) { + if (E.value.is_texture()) { continue; // texture, does not go here } |