diff options
author | Yuri Roubinsky <chaosus89@gmail.com> | 2021-10-20 21:30:27 +0300 |
---|---|---|
committer | Yuri Roubinsky <chaosus89@gmail.com> | 2021-10-20 21:30:27 +0300 |
commit | 5a354aaf6d5afbc8f6093aac924a5e7f0a229ecb (patch) | |
tree | 68bb448fc791a86579d4ada9c110c58128f0a775 /servers/rendering | |
parent | af976e4834abcf3c5e252bfeab1583568d32272e (diff) |
Prevent a rendering crash and error spam for uniform texture array
Diffstat (limited to 'servers/rendering')
-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()); } } } |