diff options
author | Yuri Roubinsky <chaosus89@gmail.com> | 2021-10-20 23:37:57 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-20 23:37:57 +0300 |
commit | dc81583fb78ae625e8ae7fe9c1cdc42ede653afa (patch) | |
tree | fdd96a80c787fa1eb3265219dcfe89fc085c3846 | |
parent | 8474bb0a3c4c231016a827e582f9bb54979911f1 (diff) | |
parent | 5a354aaf6d5afbc8f6093aac924a5e7f0a229ecb (diff) |
Merge pull request #54043 from Chaosus/fix_shader_uniform_texture_array_errors
-rw-r--r-- | servers/rendering/renderer_rd/renderer_storage_rd.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/servers/rendering/renderer_rd/renderer_storage_rd.cpp b/servers/rendering/renderer_rd/renderer_storage_rd.cpp index a7bfea455d..3e68a2b622 100644 --- a/servers/rendering/renderer_rd/renderer_storage_rd.cpp +++ b/servers/rendering/renderer_rd/renderer_storage_rd.cpp @@ -2672,9 +2672,11 @@ void RendererStorageRD::MaterialData::update_textures(const Map<StringName, Vari if (uniform_array_size > 0) { if (textures.size() < uniform_array_size) { const Map<StringName, RID>::Element *W = p_default_textures.find(uniform_name); - if (W) { - for (int j = textures.size(); j < uniform_array_size; j++) { + for (int j = textures.size(); j < uniform_array_size; j++) { + if (W) { textures.push_back(W->get()); + } else { + textures.push_back(RID()); } } } |