Merge pull request #80654 from bitsawer/fix_global_uniform_texture_set
Fix global shader uniform texture loading
This commit is contained in:
commit
9d9043a9c8
2 changed files with 12 additions and 8 deletions
|
@ -1957,15 +1957,17 @@ void MaterialStorage::global_shader_parameters_load_settings(bool p_load_texture
|
|||
if (gvtype >= RS::GLOBAL_VAR_TYPE_SAMPLER2D) {
|
||||
//textire
|
||||
if (!p_load_textures) {
|
||||
value = RID();
|
||||
continue;
|
||||
}
|
||||
|
||||
String path = value;
|
||||
if (path.is_empty()) {
|
||||
value = RID();
|
||||
} else {
|
||||
Ref<Resource> resource = ResourceLoader::load(path);
|
||||
ERR_CONTINUE(resource.is_null());
|
||||
value = resource;
|
||||
}
|
||||
}
|
||||
|
||||
if (global_shader_uniforms.variables.has(name)) {
|
||||
//has it, update it
|
||||
|
|
|
@ -1821,15 +1821,17 @@ void MaterialStorage::global_shader_parameters_load_settings(bool p_load_texture
|
|||
if (gvtype >= RS::GLOBAL_VAR_TYPE_SAMPLER2D) {
|
||||
//textire
|
||||
if (!p_load_textures) {
|
||||
value = RID();
|
||||
continue;
|
||||
}
|
||||
|
||||
String path = value;
|
||||
if (path.is_empty()) {
|
||||
value = RID();
|
||||
} else {
|
||||
Ref<Resource> resource = ResourceLoader::load(path);
|
||||
ERR_CONTINUE(resource.is_null());
|
||||
value = resource;
|
||||
}
|
||||
}
|
||||
|
||||
if (global_shader_uniforms.variables.has(name)) {
|
||||
//has it, update it
|
||||
|
|
Loading…
Reference in a new issue