2022-04-23 09:59:50 +01:00
|
|
|
// SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project
|
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2020-07-10 04:36:38 +01:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2021-06-06 04:11:36 +01:00
|
|
|
#include <atomic>
|
2020-07-10 04:36:38 +01:00
|
|
|
#include <chrono>
|
|
|
|
|
|
|
|
namespace VideoCore {
|
|
|
|
class ShaderNotify {
|
|
|
|
public:
|
2021-06-06 04:11:36 +01:00
|
|
|
[[nodiscard]] int ShadersBuilding() noexcept;
|
2020-07-10 04:36:38 +01:00
|
|
|
|
2021-06-06 04:11:36 +01:00
|
|
|
void MarkShaderComplete() noexcept {
|
|
|
|
++num_complete;
|
|
|
|
}
|
2020-07-10 04:36:38 +01:00
|
|
|
|
2021-06-06 04:11:36 +01:00
|
|
|
void MarkShaderBuilding() noexcept {
|
|
|
|
++num_building;
|
|
|
|
}
|
2020-07-10 04:36:38 +01:00
|
|
|
|
|
|
|
private:
|
2021-06-06 04:11:36 +01:00
|
|
|
std::atomic_int num_building{};
|
|
|
|
std::atomic_int num_complete{};
|
|
|
|
int report_base{};
|
|
|
|
|
|
|
|
bool completed{};
|
|
|
|
int num_when_completed{};
|
2021-12-02 19:20:43 +00:00
|
|
|
std::chrono::steady_clock::time_point complete_time;
|
2020-07-10 04:36:38 +01:00
|
|
|
};
|
|
|
|
} // namespace VideoCore
|