8 #ifndef GrBackendSemaphore_DEFINED
9 #define GrBackendSemaphore_DEFINED
12 #include "include/private/base/SkAPI.h"
13 #include "include/private/base/SkAnySubclass.h"
16 #include "include/gpu/mtl/GrMtlTypes.h"
20 #include "include/private/gpu/vk/SkiaVulkan.h"
24 #include "include/private/gpu/ganesh/GrD3DTypesMinimal.h"
29 class GrBackendSemaphoreData;
44 void initVulkan(VkSemaphore semaphore) {
46 fVkSemaphore = semaphore;
48 fIsInitialized =
true;
51 VkSemaphore vkSemaphore()
const {
53 return VK_NULL_HANDLE;
62 void initMetal(GrMTLHandle event, uint64_t value) {
67 fIsInitialized =
true;
70 GrMTLHandle mtlSemaphore()
const {
77 uint64_t mtlValue()
const {
87 void initDirect3D(
const GrD3DFenceInfo& info) {
89 this->assignD3DFenceInfo(info);
90 fIsInitialized =
true;
98 bool getD3DFenceInfo(GrD3DFenceInfo* outInfo)
const;
102 friend class GrBackendSemaphorePriv;
103 friend class GrBackendSemaphoreData;
107 inline constexpr
static size_t kMaxSubclassSize = 16;
108 using AnySemaphoreData = SkAnySubclass<GrBackendSemaphoreData, kMaxSubclassSize>;
110 template <
typename SemaphoreData>
112 fSemaphoreData.emplace<SemaphoreData>(data);
116 void assignD3DFenceInfo(
const GrD3DFenceInfo& info);
120 AnySemaphoreData fSemaphoreData;
125 VkSemaphore fVkSemaphore;
128 GrMTLHandle fMtlEvent;
131 GrD3DFenceInfo* fD3DFenceInfo;
GrBackendApi
Possible 3D APIs that may be used by Ganesh.
Definition: GrTypes.h:96
Wrapper class for passing into and receiving data from Ganesh about a backend semaphore object.
Definition: GrBackendSemaphore.h:34
void * fPlaceholder
Definition: GrBackendSemaphore.h:123
GrBackendSemaphore(const GrBackendSemaphore &)
GrBackendApi backend() const
Definition: GrBackendSemaphore.h:95
bool isInitialized() const
Definition: GrBackendSemaphore.h:94
GrBackendSemaphore & operator=(const GrBackendSemaphore &)