diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-02-12 10:22:40 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-12 10:22:40 +0100 |
commit | 93710edb60edf1e0d69dcfa1356a67dce1524112 (patch) | |
tree | fff050d628e658c8515856b638ba2184ee9c3c41 | |
parent | 3f759f03c3dce6745bdd076d1dbfe00117a455ea (diff) | |
parent | 2fe43a3bd80da0fe843010e55519a19ac6112ff2 (diff) |
Merge pull request #57319 from IgorKordiukiewicz/sprite3d-error-message
-rw-r--r-- | scene/resources/material.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp index f3e5ece1f9..b74f44c52f 100644 --- a/scene/resources/material.cpp +++ b/scene/resources/material.cpp @@ -2215,7 +2215,9 @@ BaseMaterial3D::EmissionOperator BaseMaterial3D::get_emission_operator() const { RID BaseMaterial3D::get_shader_rid() const { MutexLock lock(material_mutex); - ((BaseMaterial3D *)this)->_update_shader(); + if (element.in_list()) { // _is_shader_dirty() would create anoder mutex lock + ((BaseMaterial3D *)this)->_update_shader(); + } ERR_FAIL_COND_V(!shader_map.has(current_key), RID()); return shader_map[current_key].shader; } |