shader_notify.h 649 B

12345678910111213141516171819202122232425262728293031
  1. // SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project
  2. // SPDX-License-Identifier: GPL-2.0-or-later
  3. #pragma once
  4. #include <atomic>
  5. #include <chrono>
  6. namespace VideoCore {
  7. class ShaderNotify {
  8. public:
  9. [[nodiscard]] int ShadersBuilding() noexcept;
  10. void MarkShaderComplete() noexcept {
  11. ++num_complete;
  12. }
  13. void MarkShaderBuilding() noexcept {
  14. ++num_building;
  15. }
  16. private:
  17. std::atomic_int num_building{};
  18. std::atomic_int num_complete{};
  19. int report_base{};
  20. bool completed{};
  21. int num_when_completed{};
  22. std::chrono::steady_clock::time_point complete_time;
  23. };
  24. } // namespace VideoCore