Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
VkTestUtils.h
Go to the documentation of this file.
1/*
2 * Copyright 2017 Google Inc.
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 VkTestUtils_DEFINED
9#define VkTestUtils_DEFINED
10
12
13#ifdef SK_VULKAN
14
17#include <functional>
18
20
21namespace skgpu {
22struct VulkanBackendContext;
23class VulkanExtensions;
24}
25
26namespace sk_gpu_test {
27 bool LoadVkLibraryAndGetProcAddrFuncs(PFN_vkGetInstanceProcAddr*);
28
29 using CanPresentFn = std::function<bool(VkInstance, VkPhysicalDevice,
30 uint32_t queueFamilyIndex)>;
31
32 bool CreateVkBackendContext(PFN_vkGetInstanceProcAddr getInstProc,
36 VkDebugReportCallbackEXT* debugCallback,
37 uint32_t* presentQueueIndexPtr = nullptr,
38 const CanPresentFn& canPresent = CanPresentFn(),
39 bool isProtected = false);
40
41 bool CreateVkBackendContext(PFN_vkGetInstanceProcAddr getInstProc,
45 VkDebugReportCallbackEXT* debugCallback,
46 uint32_t* presentQueueIndexPtr = nullptr,
47 const CanPresentFn& canPresent = CanPresentFn(),
48 bool isProtected = false);
49
50 void FreeVulkanFeaturesStructs(const VkPhysicalDeviceFeatures2*);
51
52 void ConvertBackendContext(const skgpu::VulkanBackendContext& newStyle,
53 GrVkBackendContext* oldStyle);
54
55} // namespace sk_gpu_test
56
57#endif
58#endif
PFN_vkVoidFunction(VKAPI_PTR * PFN_vkGetInstanceProcAddr)(VkInstance instance, const char *pName)