This repository has been archived on 2024-03-23. You can view files and clone it, but cannot push or open issues or pull requests.
2020-07-10 03:36:38 +00:00
|
|
|
// Copyright 2020 yuzu Emulator Project
|
|
|
|
// Licensed under GPLv2 or any later version
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2021-06-06 03:11:36 +00:00
|
|
|
#include <atomic>
|
2020-07-10 03:36:38 +00:00
|
|
|
#include <chrono>
|
2021-06-06 03:11:36 +00:00
|
|
|
#include <optional>
|
2020-07-10 03:36:38 +00:00
|
|
|
|
|
|
|
namespace VideoCore {
|
|
|
|
class ShaderNotify {
|
|
|
|
public:
|
2021-06-06 03:11:36 +00:00
|
|
|
[[nodiscard]] int ShadersBuilding() noexcept;
|
2020-07-10 03:36:38 +00:00
|
|
|
|
2021-06-06 03:11:36 +00:00
|
|
|
void MarkShaderComplete() noexcept {
|
|
|
|
++num_complete;
|
|
|
|
}
|
2020-07-10 03:36:38 +00:00
|
|
|
|
2021-06-06 03:11:36 +00:00
|
|
|
void MarkShaderBuilding() noexcept {
|
|
|
|
++num_building;
|
|
|
|
}
|
2020-07-10 03:36:38 +00:00
|
|
|
|
|
|
|
private:
|
2021-06-06 03:11:36 +00:00
|
|
|
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;
|
2020-07-10 03:36:38 +00:00
|
|
|
};
|
|
|
|
} // namespace VideoCore
|