Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
GrD3DResourceState.h
Go to the documentation of this file.
1/*
2 * Copyright 2020 Google LLC
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 GrD3DResourceState_DEFINED
9#define GrD3DResourceState_DEFINED
10
13
15public:
16 GrD3DResourceState(D3D12_RESOURCE_STATES state) : fState(state) {}
17
18 void setResourceState(D3D12_RESOURCE_STATES state) {
19 // Defaulting to use std::memory_order_seq_cst
20 fState.store(state);
21 }
22
23 D3D12_RESOURCE_STATES getResourceState() const {
24 // Defaulting to use std::memory_order_seq_cst
25 return fState.load();
26 }
27
28private:
29 std::atomic<D3D12_RESOURCE_STATES> fState;
30};
31
32#endif
void setResourceState(D3D12_RESOURCE_STATES state)
GrD3DResourceState(D3D12_RESOURCE_STATES state)
D3D12_RESOURCE_STATES getResourceState() const
AtkStateType state