mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-07-11 09:35:09 +02:00
Replace DrainAndBlockCompileThreads with StopThreads, and same for resuming.
This commit is contained in:
@@ -408,23 +408,6 @@ void VulkanRenderManager::StopThreads() {
|
||||
_dbg_assert_(steps_.empty());
|
||||
}
|
||||
|
||||
void VulkanRenderManager::DrainAndBlockCompileQueue() {
|
||||
runCompileThread_ = false;
|
||||
compileCond_.notify_all();
|
||||
compileThread_.join();
|
||||
|
||||
_assert_(compileQueue_.empty());
|
||||
|
||||
// At this point, no more tasks can be queued to the threadpool. So wait for them all to go away.
|
||||
CreateMultiPipelinesTask::WaitForAll();
|
||||
}
|
||||
|
||||
void VulkanRenderManager::ReleaseCompileQueue() {
|
||||
runCompileThread_ = true;
|
||||
INFO_LOG(G3D, "Restarting Vulkan compiler thread");
|
||||
compileThread_ = std::thread(&VulkanRenderManager::CompileThreadFunc, this);
|
||||
}
|
||||
|
||||
void VulkanRenderManager::DestroyBackbuffers() {
|
||||
StopThreads();
|
||||
vulkan_->WaitUntilQueueIdle();
|
||||
|
||||
@@ -529,8 +529,9 @@ public:
|
||||
}
|
||||
|
||||
void ResetStats();
|
||||
void DrainAndBlockCompileQueue();
|
||||
void ReleaseCompileQueue();
|
||||
|
||||
void StartThreads();
|
||||
void StopThreads();
|
||||
|
||||
private:
|
||||
void EndCurRenderStep();
|
||||
@@ -543,9 +544,6 @@ private:
|
||||
// Bad for performance but sometimes necessary for synchronous CPU readbacks (screenshots and whatnot).
|
||||
void FlushSync();
|
||||
|
||||
void StartThreads();
|
||||
void StopThreads();
|
||||
|
||||
void PresentWaitThreadFunc();
|
||||
void PollPresentTiming();
|
||||
|
||||
|
||||
@@ -168,7 +168,7 @@ GPU_Vulkan::~GPU_Vulkan() {
|
||||
if (draw_) {
|
||||
VulkanRenderManager *rm = (VulkanRenderManager *)draw_->GetNativeObject(Draw::NativeObject::RENDER_MANAGER);
|
||||
// This now also does a hard sync with the render thread, so that we can safely delete our pipeline layout below.
|
||||
rm->DrainAndBlockCompileQueue();
|
||||
rm->StopThreads();
|
||||
}
|
||||
|
||||
SaveCache(shaderCachePath_);
|
||||
@@ -185,7 +185,7 @@ GPU_Vulkan::~GPU_Vulkan() {
|
||||
// other managers are deleted in ~GPUCommonHW.
|
||||
if (draw_) {
|
||||
VulkanRenderManager *rm = (VulkanRenderManager *)draw_->GetNativeObject(Draw::NativeObject::RENDER_MANAGER);
|
||||
rm->ReleaseCompileQueue();
|
||||
rm->StartThreads();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -426,7 +426,7 @@ void GPU_Vulkan::DeviceLost() {
|
||||
Draw::DrawContext *draw = draw_;
|
||||
if (draw) {
|
||||
VulkanRenderManager *rm = (VulkanRenderManager *)draw->GetNativeObject(Draw::NativeObject::RENDER_MANAGER);
|
||||
rm->DrainAndBlockCompileQueue();
|
||||
rm->StopThreads();
|
||||
}
|
||||
|
||||
if (shaderCachePath_.Valid()) {
|
||||
@@ -439,7 +439,7 @@ void GPU_Vulkan::DeviceLost() {
|
||||
|
||||
if (draw) {
|
||||
VulkanRenderManager *rm = (VulkanRenderManager *)draw->GetNativeObject(Draw::NativeObject::RENDER_MANAGER);
|
||||
rm->ReleaseCompileQueue();
|
||||
rm->StartThreads();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user