aboutsummaryrefslogtreecommitdiff
path: root/src/video_core/shader_notify.h
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2020-07-18 00:48:27 -0400
committerGitHub <noreply@github.com>2020-07-18 00:48:27 -0400
commit90cbcaa44a3901a832556258b5b97d8d7de34ca9 (patch)
tree570ff95dae035757fb2831804aae4f4ca681d354 /src/video_core/shader_notify.h
parent821d295f24136b7550fde1376810ca3756a58403 (diff)
parent967307d3beb59b64e40c4b3f44ed839d87325e5c (diff)
Merge pull request #4273 from ogniK5377/async-shaders-prod
video_core: Add asynchronous shader decompilation and compilation
Diffstat (limited to 'src/video_core/shader_notify.h')
-rw-r--r--src/video_core/shader_notify.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/video_core/shader_notify.h b/src/video_core/shader_notify.h
new file mode 100644
index 000000000..a9c92d179
--- /dev/null
+++ b/src/video_core/shader_notify.h
@@ -0,0 +1,29 @@
+// Copyright 2020 yuzu Emulator Project
+// Licensed under GPLv2 or any later version
+// Refer to the license.txt file included.
+
+#pragma once
+
+#include <chrono>
+#include <shared_mutex>
+#include "common/common_types.h"
+
+namespace VideoCore {
+class ShaderNotify {
+public:
+ ShaderNotify();
+ ~ShaderNotify();
+
+ std::size_t GetShadersBuilding();
+ std::size_t GetShadersBuildingAccurate();
+
+ void MarkShaderComplete();
+ void MarkSharderBuilding();
+
+private:
+ std::size_t last_updated_count{};
+ std::size_t accurate_count{};
+ std::shared_mutex mutex;
+ std::chrono::high_resolution_clock::time_point last_update{};
+};
+} // namespace VideoCore