suyu/src/video_core/shader_notify.h

34 lines
697 B
C++
Raw Normal View History

2020-07-09 23:36:38 -04:00
// Copyright 2020 yuzu Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#pragma once
#include <atomic>
2020-07-09 23:36:38 -04:00
#include <chrono>
#include <optional>
2020-07-09 23:36:38 -04:00
namespace VideoCore {
class ShaderNotify {
public:
[[nodiscard]] int ShadersBuilding() noexcept;
2020-07-09 23:36:38 -04:00
void MarkShaderComplete() noexcept {
++num_complete;
}
2020-07-09 23:36:38 -04:00
void MarkShaderBuilding() noexcept {
++num_building;
}
2020-07-09 23:36:38 -04:00
private:
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-09 23:36:38 -04:00
};
} // namespace VideoCore