summaryrefslogtreecommitdiffstats
path: root/src/video_core/shader/async_shaders.h
diff options
context:
space:
mode:
authorDavid Marcec <dmarcecguzman@gmail.com>2020-07-16 10:38:35 +0200
committerDavid Marcec <dmarcecguzman@gmail.com>2020-07-17 06:26:17 +0200
commitf48187449ed4772044da55a8a3745d578c1b8c48 (patch)
tree4dc7eea4e3e88b30b3b1af22326dc723811f2352 /src/video_core/shader/async_shaders.h
parentDrop max workers from 8->2 for testing (diff)
downloadyuzu-f48187449ed4772044da55a8a3745d578c1b8c48.tar
yuzu-f48187449ed4772044da55a8a3745d578c1b8c48.tar.gz
yuzu-f48187449ed4772044da55a8a3745d578c1b8c48.tar.bz2
yuzu-f48187449ed4772044da55a8a3745d578c1b8c48.tar.lz
yuzu-f48187449ed4772044da55a8a3745d578c1b8c48.tar.xz
yuzu-f48187449ed4772044da55a8a3745d578c1b8c48.tar.zst
yuzu-f48187449ed4772044da55a8a3745d578c1b8c48.zip
Diffstat (limited to 'src/video_core/shader/async_shaders.h')
-rw-r--r--src/video_core/shader/async_shaders.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/video_core/shader/async_shaders.h b/src/video_core/shader/async_shaders.h
index 26bc38326..2f5ee94ad 100644
--- a/src/video_core/shader/async_shaders.h
+++ b/src/video_core/shader/async_shaders.h
@@ -4,6 +4,7 @@
#pragma once
+#include <condition_variable>
#include <deque>
#include <memory>
#include <shared_mutex>
@@ -59,9 +60,6 @@ public:
// Force end all threads
void KillWorkers();
- /// Check our worker queue to see if we have any work queued already
- bool HasWorkQueued();
-
/// Check to see if any shaders have actually been compiled
bool HasCompletedWork();
@@ -81,6 +79,9 @@ public:
private:
void ShaderCompilerThread(Core::Frontend::GraphicsContext* context);
+ /// Check our worker queue to see if we have any work queued already
+ bool HasWorkQueued();
+
struct WorkerParams {
AsyncShaders::Backend backend;
OpenGL::Device device;
@@ -94,7 +95,8 @@ private:
VAddr cpu_address;
};
- std::shared_mutex queue_mutex;
+ std::condition_variable cv;
+ std::mutex queue_mutex;
std::shared_mutex completed_mutex;
std::atomic<bool> is_thread_exiting{};
std::vector<std::unique_ptr<Core::Frontend::GraphicsContext>> context_list;