• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
11 #include "include/core/SkTypes.h"
12 
13 #ifdef SK_VULKAN
14 
15 #include "include/gpu/vk/GrVkBackendContext.h"
16 #include "include/gpu/vk/GrVkTypes.h"
17 #include "tools/gpu/vk/GrVulkanDefines.h"
18 #include <functional>
19 
20 class GrVkExtensions;
21 struct GrVkBackendContext;
22 
23 namespace sk_gpu_test {
24     bool LoadVkLibraryAndGetProcAddrFuncs(PFN_vkGetInstanceProcAddr*, PFN_vkGetDeviceProcAddr*);
25 
26     using CanPresentFn = std::function<bool(VkInstance, VkPhysicalDevice,
27                                             uint32_t queueFamilyIndex)>;
28 
29     bool CreateVkBackendContext(GrVkGetProc getProc,
30                                 GrVkBackendContext* ctx,
31                                 GrVkExtensions*,
32                                 VkPhysicalDeviceFeatures2*,
33                                 VkDebugReportCallbackEXT* debugCallback,
34                                 uint32_t* presentQueueIndexPtr = nullptr,
35                                 CanPresentFn canPresent = CanPresentFn(),
36                                 bool isProtected = false);
37 
38     void FreeVulkanFeaturesStructs(const VkPhysicalDeviceFeatures2*);
39 }  // namespace sk_gpu_test
40 
41 #endif
42 #endif
43 
44