2 * Copyright 2020 Google LLC
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
8 #include "src/gpu/ganesh/d3d/GrD3DSemaphore.h"
10 #include "src/gpu/ganesh/d3d/GrD3DGpu.h"
13 std::unique_ptr<GrD3DSemaphore> GrD3DSemaphore::Make(GrD3DGpu* gpu) {
14 GrD3DFenceInfo fenceInfo;
15 gpu->device()->CreateFence(0, D3D12_FENCE_FLAG_NONE, IID_PPV_ARGS(&fenceInfo.fFence));
18 return std::unique_ptr<GrD3DSemaphore>(new GrD3DSemaphore(fenceInfo));
21 std::unique_ptr<GrD3DSemaphore> GrD3DSemaphore::MakeWrapped(const GrD3DFenceInfo& fenceInfo) {
22 return std::unique_ptr<GrD3DSemaphore>(new GrD3DSemaphore(fenceInfo));
25 GrD3DSemaphore::GrD3DSemaphore(const GrD3DFenceInfo& fenceInfo) : fFenceInfo(fenceInfo) {}
27 GrBackendSemaphore GrD3DSemaphore::backendSemaphore() const {
28 GrBackendSemaphore backendSemaphore;
29 backendSemaphore.initDirect3D(fFenceInfo);
30 return backendSemaphore;