Skip to content

Commit

Permalink
Merge pull request #80654 from bitsawer/fix_global_uniform_texture_set
Browse files Browse the repository at this point in the history
Fix global shader uniform texture loading
  • Loading branch information
akien-mga committed Aug 16, 2023
2 parents 623156a + 41def37 commit 9d9043a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
10 changes: 6 additions & 4 deletions drivers/gles3/storage/material_storage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1957,14 +1957,16 @@ 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;
Ref<Resource> resource = ResourceLoader::load(path);
ERR_CONTINUE(resource.is_null());
value = resource;
if (path.is_empty()) {
value = RID();
} else {
Ref<Resource> resource = ResourceLoader::load(path);
value = resource;
}
}

if (global_shader_uniforms.variables.has(name)) {
Expand Down
10 changes: 6 additions & 4 deletions servers/rendering/renderer_rd/storage_rd/material_storage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1821,14 +1821,16 @@ 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;
Ref<Resource> resource = ResourceLoader::load(path);
ERR_CONTINUE(resource.is_null());
value = resource;
if (path.is_empty()) {
value = RID();
} else {
Ref<Resource> resource = ResourceLoader::load(path);
value = resource;
}
}

if (global_shader_uniforms.variables.has(name)) {
Expand Down

0 comments on commit 9d9043a

Please sign in to comment.