diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2021-06-06 05:11:36 +0200 |
---|---|---|
committer | ameerj <52414509+ameerj@users.noreply.github.com> | 2021-07-23 03:51:35 +0200 |
commit | cffd4716c5ebf9b93505b5bfa96d9b407f349336 (patch) | |
tree | e94c3daa5420fc066695b1082b0f0af60c5cb555 /src/video_core/shader_notify.h | |
parent | vk_pipeline_cache: Add asynchronous shaders (diff) | |
download | yuzu-cffd4716c5ebf9b93505b5bfa96d9b407f349336.tar yuzu-cffd4716c5ebf9b93505b5bfa96d9b407f349336.tar.gz yuzu-cffd4716c5ebf9b93505b5bfa96d9b407f349336.tar.bz2 yuzu-cffd4716c5ebf9b93505b5bfa96d9b407f349336.tar.lz yuzu-cffd4716c5ebf9b93505b5bfa96d9b407f349336.tar.xz yuzu-cffd4716c5ebf9b93505b5bfa96d9b407f349336.tar.zst yuzu-cffd4716c5ebf9b93505b5bfa96d9b407f349336.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/shader_notify.h | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/src/video_core/shader_notify.h b/src/video_core/shader_notify.h index a9c92d179..ad363bfb5 100644 --- a/src/video_core/shader_notify.h +++ b/src/video_core/shader_notify.h @@ -4,26 +4,30 @@ #pragma once +#include <atomic> #include <chrono> -#include <shared_mutex> -#include "common/common_types.h" +#include <optional> namespace VideoCore { class ShaderNotify { public: - ShaderNotify(); - ~ShaderNotify(); + [[nodiscard]] int ShadersBuilding() noexcept; - std::size_t GetShadersBuilding(); - std::size_t GetShadersBuildingAccurate(); + void MarkShaderComplete() noexcept { + ++num_complete; + } - void MarkShaderComplete(); - void MarkSharderBuilding(); + void MarkShaderBuilding() noexcept { + ++num_building; + } 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{}; + std::atomic_int num_building{}; + std::atomic_int num_complete{}; + int report_base{}; + + bool completed{}; + int num_when_completed{}; + std::chrono::high_resolution_clock::time_point complete_time; }; } // namespace VideoCore |