shader_notify.h 665 B

1234567891011121314151617181920212223242526272829
  1. // Copyright 2020 yuzu Emulator Project
  2. // Licensed under GPLv2 or any later version
  3. // Refer to the license.txt file included.
  4. #pragma once
  5. #include <chrono>
  6. #include <shared_mutex>
  7. #include "common/common_types.h"
  8. namespace VideoCore {
  9. class ShaderNotify {
  10. public:
  11. ShaderNotify();
  12. ~ShaderNotify();
  13. std::size_t GetShadersBuilding();
  14. std::size_t GetShadersBuildingAccurate();
  15. void MarkShaderComplete();
  16. void MarkSharderBuilding();
  17. private:
  18. std::size_t last_updated_count{};
  19. std::size_t accurate_count{};
  20. std::shared_mutex mutex;
  21. std::chrono::high_resolution_clock::time_point last_update{};
  22. };
  23. } // namespace VideoCore