summaryrefslogtreecommitdiffstats
path: root/src/video_core/shader_notify.h
blob: a9c92d179a0e7c8251f82319b8815787596efae2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// Copyright 2020 yuzu Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.

#pragma once

#include <chrono>
#include <shared_mutex>
#include "common/common_types.h"

namespace VideoCore {
class ShaderNotify {
public:
    ShaderNotify();
    ~ShaderNotify();

    std::size_t GetShadersBuilding();
    std::size_t GetShadersBuildingAccurate();

    void MarkShaderComplete();
    void MarkSharderBuilding();

private:
    std::size_t last_updated_count{};
    std::size_t accurate_count{};
    std::shared_mutex mutex;
    std::chrono::high_resolution_clock::time_point last_update{};
};
} // namespace VideoCore