Prevent a rendering crash and error spam for uniform texture array

This commit is contained in:
Yuri Roubinsky 2021-10-20 21:30:27 +03:00
parent af976e4834
commit 5a354aaf6d
1 changed files with 4 additions and 2 deletions

View File

@ -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());
}
}
}