diff options
Diffstat (limited to 'core/templates/command_queue_mt.h')
-rw-r--r-- | core/templates/command_queue_mt.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/core/templates/command_queue_mt.h b/core/templates/command_queue_mt.h index 2ad5d1229d..9f9b77d9d0 100644 --- a/core/templates/command_queue_mt.h +++ b/core/templates/command_queue_mt.h @@ -388,6 +388,8 @@ class CommandQueueMT { } while (sync_head != sync_head_goal); // Can't use lower-than because of wraparound. } + void _no_op() {} + public: void lock(); void unlock(); @@ -409,10 +411,15 @@ public: _flush(); } } + void flush_all() { _flush(); } + void sync() { + push_and_sync(this, &CommandQueueMT::_no_op); + } + void wait_and_flush() { ERR_FAIL_COND(pump_task_id == WorkerThreadPool::INVALID_TASK_ID); WorkerThreadPool::get_singleton()->wait_for_task_completion(pump_task_id); @@ -420,7 +427,9 @@ public: } void set_pump_task_id(WorkerThreadPool::TaskID p_task_id) { + lock(); pump_task_id = p_task_id; + unlock(); } CommandQueueMT(); |