38 {
40 VkDebugReportCallbackEXT debugCallback;
43
44
45
46
47
48
49
50
51
52 {
54 if (!sk_gpu_test::LoadVkLibraryAndGetProcAddrFuncs(&instProc)) {
55 return 1;
56 }
57
60 features->pNext = nullptr;
61
62
65
66 if (!sk_gpu_test::CreateVkBackendContext(instProc, &backendContext,
extensions.get(),
67 features.get(), &debugCallback)) {
68 return 1;
69 }
70 }
71
72 auto getProc = backendContext.
fGetProc;
79 }
81
82
84 if (!context) {
85 fVkDestroyDevice(backendContext.
fDevice,
nullptr);
87 fVkDestroyDebugReportCallbackEXT(backendContext.
fInstance, debugCallback,
nullptr);
88 }
89 fVkDestroyInstance(backendContext.
fInstance,
nullptr);
90 return 1;
91 }
92
94
95
96
97
98
103 fVkDestroyDevice(backendContext.
fDevice,
nullptr);
105 fVkDestroyDebugReportCallbackEXT(backendContext.
fInstance, debugCallback,
nullptr);
106 } fVkDestroyInstance(backendContext.
fInstance,
nullptr);
107 return 1;
108 }
109
111
112
113
114
117
120
121
122
123
124 fVkDestroyDevice(backendContext.
fDevice,
nullptr);
126 fVkDestroyDebugReportCallbackEXT(backendContext.
fInstance, debugCallback,
nullptr);
127 } fVkDestroyInstance(backendContext.
fInstance,
nullptr);
128 return 0;
129}
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
@ kRGBA_8888_SkColorType
pixel with 8 bits for red, green, blue, alpha; in 32-bit word
constexpr SkColor SK_ColorRED
#define ACQUIRE_INST_VK_PROC(name)
bool submit(GrSyncCpu sync=GrSyncCpu::kNo)
GrSemaphoresSubmitted flush(const GrFlushInfo &info)
void reset(T *ptr=nullptr)
SK_API sk_sp< GrDirectContext > MakeVulkan(const skgpu::VulkanBackendContext &, const GrContextOptions &)
SK_API sk_sp< SkSurface > RenderTarget(GrRecordingContext *context, skgpu::Budgeted budgeted, const SkImageInfo &imageInfo, int sampleCount, GrSurfaceOrigin surfaceOrigin, const SkSurfaceProps *surfaceProps, bool shouldCreateWithMips=false, bool isProtected=false)
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)
skgpu::VulkanGetProc fGetProc
void(VKAPI_PTR * PFN_vkDestroyDebugReportCallbackEXT)(VkInstance instance, VkDebugReportCallbackEXT callback, const VkAllocationCallbacks *pAllocator)
void(VKAPI_PTR * PFN_vkDestroyInstance)(VkInstance instance, const VkAllocationCallbacks *pAllocator)
void(VKAPI_PTR * PFN_vkDestroyDevice)(VkDevice device, const VkAllocationCallbacks *pAllocator)
PFN_vkVoidFunction(VKAPI_PTR * PFN_vkGetInstanceProcAddr)(VkInstance instance, const char *pName)
@ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2