xref: /aosp_15_r20/external/skia/src/gpu/ganesh/d3d/GrD3DSemaphore.h (revision c8dee2aa9b3f27cf6c858bd81872bdeb2c07ed17)
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 GrMtlSemaphore_DEFINED
9 #define GrMtlSemaphore_DEFINED
10 
11 #include "include/gpu/ganesh/GrBackendSemaphore.h"
12 #include "include/gpu/ganesh/d3d/GrD3DTypes.h"
13 #include "include/private/gpu/ganesh/GrTypesPriv.h"
14 #include "src/gpu/ganesh/GrSemaphore.h"
15 
16 class GrD3DGpu;
17 
18 class GrD3DSemaphore : public GrSemaphore {
19 public:
20     static std::unique_ptr<GrD3DSemaphore> Make(GrD3DGpu* gpu);
21 
22     static std::unique_ptr<GrD3DSemaphore> MakeWrapped(const GrD3DFenceInfo&);
23 
~GrD3DSemaphore()24     ~GrD3DSemaphore() override {}
25 
fence()26     ID3D12Fence* fence() const { return fFenceInfo.fFence.get(); }
value()27     uint64_t value() const { return fFenceInfo.fValue; }
28 
29     GrBackendSemaphore backendSemaphore() const override;
30 
31 private:
32     GrD3DSemaphore(const GrD3DFenceInfo&);
33 
setIsOwned()34     void setIsOwned() override {}
35 
36     GrD3DFenceInfo fFenceInfo;
37 
38     using INHERITED = GrSemaphore;
39 };
40 
41 #endif
42