28#define ACQUIRE_INST_VK_PROC(name) \
30 fVk##name = reinterpret_cast<PFN_vk##name>(getProc("vk" #name, backendContext.fInstance, \
32 if (fVk##name == nullptr) { \
33 SkDebugf("Function ptr for vk%s could not be acquired\n", #name); \
40 VkDebugReportCallbackEXT debugCallback;
54 if (!sk_gpu_test::LoadVkLibraryAndGetProcAddrFuncs(&instProc)) {
60 features->pNext =
nullptr;
66 if (!sk_gpu_test::CreateVkBackendContext(instProc, &backendContext,
extensions.get(),
67 features.get(), &debugCallback)) {
72 auto getProc = backendContext.
fGetProc;
85 fVkDestroyDevice(backendContext.
fDevice,
nullptr);
87 fVkDestroyDebugReportCallbackEXT(backendContext.
fInstance, debugCallback,
nullptr);
89 fVkDestroyInstance(backendContext.
fInstance,
nullptr);
103 fVkDestroyDevice(backendContext.
fDevice,
nullptr);
105 fVkDestroyDebugReportCallbackEXT(backendContext.
fInstance, debugCallback,
nullptr);
106 } fVkDestroyInstance(backendContext.
fInstance,
nullptr);
124 fVkDestroyDevice(backendContext.
fDevice,
nullptr);
126 fVkDestroyDebugReportCallbackEXT(backendContext.
fInstance, debugCallback,
nullptr);
127 } fVkDestroyInstance(backendContext.
fInstance,
nullptr);
@ 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
int main(int argc, char **argv)
#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