1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-18 14:21:41 +00:00

Merge pull request #107475 from beicause/fix-global-shader-texture-uniform

Fix global shader texture uniform
This commit is contained in:
Rémi Verschelde
2025-06-13 15:54:09 +02:00
2 changed files with 16 additions and 8 deletions

View File

@@ -872,10 +872,14 @@ void MaterialData::update_textures(const HashMap<StringName, Variant> &p_paramet
E->value = global_textures_pass; E->value = global_textures_pass;
} }
if (v->override.get_type() == Variant::RID && ((RID)v->override).is_valid()) { RID override_rid = v->override;
textures.push_back(v->override); if (override_rid.is_valid()) {
} else if (v->value.get_type() == Variant::RID && ((RID)v->value).is_valid()) { textures.push_back(override_rid);
textures.push_back(v->value); } else {
RID value_rid = v->value;
if (value_rid.is_valid()) {
textures.push_back(value_rid);
}
} }
} }

View File

@@ -906,10 +906,14 @@ void MaterialStorage::MaterialData::update_textures(const HashMap<StringName, Va
E->value = global_textures_pass; E->value = global_textures_pass;
} }
if (v->override.get_type() == Variant::RID && ((RID)v->override).is_valid()) { RID override_rid = v->override;
textures.push_back(v->override); if (override_rid.is_valid()) {
} else if (v->value.get_type() == Variant::RID && ((RID)v->value).is_valid()) { textures.push_back(override_rid);
textures.push_back(v->value); } else {
RID value_rid = v->value;
if (value_rid.is_valid()) {
textures.push_back(value_rid);
}
} }
} }