blob: 154c21fb3679bf128b2cac9bdb834e1cedf3865d [file] [log] [blame]
Greg Daniel52e16d92018-04-10 09:34:07 -04001/*
2 * Copyright 2018 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8#ifndef GrVkImageLayout_DEFINED
9#define GrVkImageLayout_DEFINED
10
Mike Kleinc0bd9f92019-04-23 12:05:21 -050011#include "include/core/SkRefCnt.h"
12#include "include/gpu/vk/GrVkTypes.h"
Greg Daniel52e16d92018-04-10 09:34:07 -040013
14class GrVkImageLayout : public SkRefCnt {
15public:
16 GrVkImageLayout(VkImageLayout layout) : fLayout(layout) {}
17
18 void setImageLayout(VkImageLayout layout) {
19 // Defaulting to use std::memory_order_seq_cst
20 fLayout.store(layout);
21 }
22
23 VkImageLayout getImageLayout() const {
24 // Defaulting to use std::memory_order_seq_cst
25 return fLayout.load();
26 }
27
28private:
29 std::atomic<VkImageLayout> fLayout;
30};
31
32#endif