mirror of
https://github.com/godotengine/godot.git
synced 2024-12-15 10:12:40 +08:00
Merge pull request #100363 from RandomShaper/fix_mtl_mt_deadlock_4.4
Fix deadlock possibility in threaded load of materials
This commit is contained in:
commit
5527bcbfbe
@ -157,9 +157,13 @@ void CanvasItemMaterial::flush_changes() {
|
||||
}
|
||||
|
||||
void CanvasItemMaterial::_queue_shader_change() {
|
||||
if (!_is_initialized()) {
|
||||
return;
|
||||
}
|
||||
|
||||
MutexLock lock(material_mutex);
|
||||
|
||||
if (_is_initialized() && !element.in_list()) {
|
||||
if (!element.in_list()) {
|
||||
dirty_materials.add(&element);
|
||||
}
|
||||
}
|
||||
|
@ -1970,9 +1970,13 @@ void BaseMaterial3D::flush_changes() {
|
||||
}
|
||||
|
||||
void BaseMaterial3D::_queue_shader_change() {
|
||||
if (!_is_initialized()) {
|
||||
return;
|
||||
}
|
||||
|
||||
MutexLock lock(material_mutex);
|
||||
|
||||
if (_is_initialized() && !element.in_list()) {
|
||||
if (!element.in_list()) {
|
||||
dirty_materials.add(&element);
|
||||
}
|
||||
}
|
||||
|
@ -1172,9 +1172,13 @@ void ParticleProcessMaterial::flush_changes() {
|
||||
}
|
||||
|
||||
void ParticleProcessMaterial::_queue_shader_change() {
|
||||
if (!_is_initialized()) {
|
||||
return;
|
||||
}
|
||||
|
||||
MutexLock lock(material_mutex);
|
||||
|
||||
if (_is_initialized() && !element.in_list()) {
|
||||
if (!element.in_list()) {
|
||||
dirty_materials.add(&element);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user