summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_vulkan/vk_pipeline.h
blob: b0628840357bf8ef58d3d70664075fc19e83ae29 (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
30
31
32
33
34
35
36
// Copyright 2019 yuzu Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.

#pragma once

#include <cstddef>

#include "video_core/vulkan_common/vulkan_wrapper.h"

namespace Vulkan {

class Pipeline {
public:
    /// Add a reference count to the pipeline
    void AddRef() noexcept {
        ++ref_count;
    }

    [[nodiscard]] bool RemoveRef() noexcept {
        --ref_count;
        return ref_count == 0;
    }

    [[nodiscard]] u64 UsageTick() const noexcept {
        return usage_tick;
    }

protected:
    u64 usage_tick{};

private:
    size_t ref_count{};
};

} // namespace Vulkan