Flutter Engine
The Flutter Engine
GrD3DSemaphore.cpp
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
9
11
12
13std::unique_ptr<GrD3DSemaphore> GrD3DSemaphore::Make(GrD3DGpu* gpu) {
14 GrD3DFenceInfo fenceInfo;
15 gpu->device()->CreateFence(0, D3D12_FENCE_FLAG_NONE, IID_PPV_ARGS(&fenceInfo.fFence));
16 fenceInfo.fValue = 1;
17
18 return std::unique_ptr<GrD3DSemaphore>(new GrD3DSemaphore(fenceInfo));
19}
20
21std::unique_ptr<GrD3DSemaphore> GrD3DSemaphore::MakeWrapped(const GrD3DFenceInfo& fenceInfo) {
22 return std::unique_ptr<GrD3DSemaphore>(new GrD3DSemaphore(fenceInfo));
23}
24
25GrD3DSemaphore::GrD3DSemaphore(const GrD3DFenceInfo& fenceInfo) : fFenceInfo(fenceInfo) {}
26
29 backendSemaphore.initDirect3D(fFenceInfo);
30 return backendSemaphore;
31}
ID3D12Device * device() const
Definition: GrD3DGpu.h:43
static std::unique_ptr< GrD3DSemaphore > Make(GrD3DGpu *gpu)
GrBackendSemaphore backendSemaphore() const override
static std::unique_ptr< GrD3DSemaphore > MakeWrapped(const GrD3DFenceInfo &)
gr_cp< ID3D12Fence > fFence
Definition: GrD3DTypes.h:235
uint64_t fValue
Definition: GrD3DTypes.h:236