From 5a354aaf6d5afbc8f6093aac924a5e7f0a229ecb Mon Sep 17 00:00:00 2001 From: Yuri Roubinsky Date: Wed, 20 Oct 2021 21:30:27 +0300 Subject: Prevent a rendering crash and error spam for uniform texture array --- servers/rendering/renderer_rd/renderer_storage_rd.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'servers/rendering') 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 0) { if (textures.size() < uniform_array_size) { const Map::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()); } } } -- cgit v1.2.3