diff options
author | ameerj <52414509+ameerj@users.noreply.github.com> | 2021-09-16 02:10:25 +0200 |
---|---|---|
committer | ameerj <52414509+ameerj@users.noreply.github.com> | 2021-09-16 02:49:07 +0200 |
commit | 84f7e7e91c441636b93accae6f7bd52f70a8ab99 (patch) | |
tree | f1ea78c339972670042f3b6930dff6cdde8b1ff5 /src/video_core/renderer_vulkan/vk_scheduler.h | |
parent | gpu: Use std::jthread for async gpu thread (diff) | |
download | yuzu-84f7e7e91c441636b93accae6f7bd52f70a8ab99.tar yuzu-84f7e7e91c441636b93accae6f7bd52f70a8ab99.tar.gz yuzu-84f7e7e91c441636b93accae6f7bd52f70a8ab99.tar.bz2 yuzu-84f7e7e91c441636b93accae6f7bd52f70a8ab99.tar.lz yuzu-84f7e7e91c441636b93accae6f7bd52f70a8ab99.tar.xz yuzu-84f7e7e91c441636b93accae6f7bd52f70a8ab99.tar.zst yuzu-84f7e7e91c441636b93accae6f7bd52f70a8ab99.zip |
Diffstat (limited to 'src/video_core/renderer_vulkan/vk_scheduler.h')
-rw-r--r-- | src/video_core/renderer_vulkan/vk_scheduler.h | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/video_core/renderer_vulkan/vk_scheduler.h b/src/video_core/renderer_vulkan/vk_scheduler.h index 759ed5a48..bd22e4e83 100644 --- a/src/video_core/renderer_vulkan/vk_scheduler.h +++ b/src/video_core/renderer_vulkan/vk_scheduler.h @@ -187,7 +187,7 @@ private: GraphicsPipeline* graphics_pipeline = nullptr; }; - void WorkerThread(); + void WorkerThread(std::stop_token stop_token); void AllocateWorkerCommandBuffer(); @@ -212,7 +212,7 @@ private: vk::CommandBuffer current_cmdbuf; std::unique_ptr<CommandChunk> chunk; - std::thread worker_thread; + std::jthread worker_thread; State state; @@ -224,9 +224,8 @@ private: std::vector<std::unique_ptr<CommandChunk>> chunk_reserve; std::mutex reserve_mutex; std::mutex work_mutex; - std::condition_variable work_cv; + std::condition_variable_any work_cv; std::condition_variable wait_cv; - std::atomic_bool quit{}; }; } // namespace Vulkan |