summaryrefslogtreecommitdiff
path: root/servers/rendering/renderer_rd/forward_mobile
diff options
context:
space:
mode:
authorreduz <reduzio@gmail.com>2021-07-07 19:55:20 -0300
committerreduz <reduzio@gmail.com>2021-07-07 19:55:20 -0300
commit83addd6ee550ca338c246d1659e08029a4c588d1 (patch)
treeceb876d6cb502f414724000cdf916c6ecd3c1457 /servers/rendering/renderer_rd/forward_mobile
parentb1068f9f01f5a5382ed3f1994d1302a35e96f445 (diff)
Fix material invalidation on reimport.
* IF a texture was reimported (calling replace as an example), it would invalidate all materials using it, causing plenty of errors. * Added the possibility to get a notification when a uniform set is erased. * With this notification, materials can be queued for update properly.
Diffstat (limited to 'servers/rendering/renderer_rd/forward_mobile')
-rw-r--r--servers/rendering/renderer_rd/forward_mobile/scene_shader_forward_mobile.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/servers/rendering/renderer_rd/forward_mobile/scene_shader_forward_mobile.cpp b/servers/rendering/renderer_rd/forward_mobile/scene_shader_forward_mobile.cpp
index 5e26cbea1f..7709c8aadc 100644
--- a/servers/rendering/renderer_rd/forward_mobile/scene_shader_forward_mobile.cpp
+++ b/servers/rendering/renderer_rd/forward_mobile/scene_shader_forward_mobile.cpp
@@ -436,9 +436,7 @@ bool SceneShaderForwardMobile::MaterialData::update_parameters(const Map<StringN
}
SceneShaderForwardMobile::MaterialData::~MaterialData() {
- if (uniform_set.is_valid() && RD::get_singleton()->uniform_set_is_valid(uniform_set)) {
- RD::get_singleton()->free(uniform_set);
- }
+ free_parameters_uniform_set(uniform_set);
}
RendererStorageRD::MaterialData *SceneShaderForwardMobile::_create_material_func(ShaderData *p_shader) {