aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/vk/GrVkImageLayout.h
blob: 8f21fa8bfbbb857f9bec3078deb461d589cc8375 (plain)
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
/*
 * Copyright 2018 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#ifndef GrVkImageLayout_DEFINED
#define GrVkImageLayout_DEFINED

#include "SkRefCnt.h"
#include "vk/GrVkTypes.h"

class GrVkImageLayout : public SkRefCnt {
public:
    GrVkImageLayout(VkImageLayout layout) : fLayout(layout) {}

    void setImageLayout(VkImageLayout layout) {
        // Defaulting to use std::memory_order_seq_cst
        fLayout.store(layout);
    }

    VkImageLayout getImageLayout() const {
        // Defaulting to use std::memory_order_seq_cst
        return fLayout.load();
    }

private:
    std::atomic<VkImageLayout> fLayout;
};

#endif