summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2020-10-19 15:50:21 -0300
committerGitHub <noreply@github.com>2020-10-19 15:50:21 -0300
commit5d120f9ffb85c2edd4d648a5323a997e96284257 (patch)
tree408352c8be506c361a9d790ac5f17c3047f1d93b
parent85ebf40b6c2c08ea692b574d6221bce5e8021a31 (diff)
parentd0f85b932115b08a94b46eadaa1650a40d5fc1de (diff)
Merge pull request #42046 from Chaosus/fix_default_texture
Fix setting the default texture to shader
-rw-r--r--servers/rendering/rasterizer_rd/rasterizer_storage_rd.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/servers/rendering/rasterizer_rd/rasterizer_storage_rd.cpp b/servers/rendering/rasterizer_rd/rasterizer_storage_rd.cpp
index 90dd6af319..e723028e56 100644
--- a/servers/rendering/rasterizer_rd/rasterizer_storage_rd.cpp
+++ b/servers/rendering/rasterizer_rd/rasterizer_storage_rd.cpp
@@ -1256,6 +1256,10 @@ void RasterizerStorageRD::shader_set_code(RID p_shader, const String &p_code) {
}
material->shader_type = new_type;
}
+
+ for (Map<StringName, RID>::Element *E = shader->default_texture_parameter.front(); E; E = E->next()) {
+ shader->data->set_default_texture_param(E->key(), E->get());
+ }
}
if (shader->data) {
@@ -1292,7 +1296,9 @@ void RasterizerStorageRD::shader_set_default_texture_param(RID p_shader, const S
} else {
shader->default_texture_parameter.erase(p_name);
}
-
+ if (shader->data) {
+ shader->data->set_default_texture_param(p_name, p_texture);
+ }
for (Set<Material *>::Element *E = shader->owners.front(); E; E = E->next()) {
Material *material = E->get();
_material_queue_update(material, false, true);