Explorar o código

Merge pull request #54043 from Chaosus/fix_shader_uniform_texture_array_errors

Yuri Roubinsky %!s(int64=4) %!d(string=hai) anos
pai
achega
dc81583fb7
Modificáronse 1 ficheiros con 4 adicións e 2 borrados
  1. 4 2
      servers/rendering/renderer_rd/renderer_storage_rd.cpp

+ 4 - 2
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 (uniform_array_size > 0) {
 				if (textures.size() < uniform_array_size) {
 				if (textures.size() < uniform_array_size) {
 					const Map<StringName, RID>::Element *W = p_default_textures.find(uniform_name);
 					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());
 							textures.push_back(W->get());
+						} else {
+							textures.push_back(RID());
 						}
 						}
 					}
 					}
 				}
 				}