summaryrefslogtreecommitdiff
path: root/scene/resources/particles_material.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/resources/particles_material.cpp')
-rw-r--r--scene/resources/particles_material.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/scene/resources/particles_material.cpp b/scene/resources/particles_material.cpp
index 0495a9e92c..d9ec0bfd69 100644
--- a/scene/resources/particles_material.cpp
+++ b/scene/resources/particles_material.cpp
@@ -741,7 +741,7 @@ void ParticlesMaterial::flush_changes() {
void ParticlesMaterial::_queue_shader_change() {
MutexLock lock(material_mutex);
- if (!element.in_list()) {
+ if (is_initialized && !element.in_list()) {
dirty_materials->add(&element);
}
}
@@ -1533,6 +1533,7 @@ ParticlesMaterial::ParticlesMaterial() :
current_key.invalid_key = 1;
+ is_initialized = true;
_queue_shader_change();
}