OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef GrVkBackendContext_DEFINED | 8 #ifndef GrVkBackendContext_DEFINED |
9 #define GrVkBackendContext_DEFINED | 9 #define GrVkBackendContext_DEFINED |
10 | 10 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 VkInstance fInstance; | 44 VkInstance fInstance; |
45 VkPhysicalDevice fPhysicalDevice; | 45 VkPhysicalDevice fPhysicalDevice; |
46 VkDevice fDevice; | 46 VkDevice fDevice; |
47 VkQueue fQueue; | 47 VkQueue fQueue; |
48 uint32_t fGraphicsQueueIndex; | 48 uint32_t fGraphicsQueueIndex; |
49 uint32_t fMinAPIVersion; | 49 uint32_t fMinAPIVersion; |
50 uint32_t fExtensions; | 50 uint32_t fExtensions; |
51 uint32_t fFeatures; | 51 uint32_t fFeatures; |
52 SkAutoTUnref<const GrVkInterface> fInterface; | 52 SkAutoTUnref<const GrVkInterface> fInterface; |
53 | 53 |
| 54 using CanPresentFn = std::function<bool(VkInstance, VkPhysicalDevice, |
| 55 uint32_t queueFamilyIndex)>; |
| 56 |
54 // Helper function to create the default Vulkan objects needed by the GrVkGp
u object | 57 // Helper function to create the default Vulkan objects needed by the GrVkGp
u object |
55 // If presentQueueIndex is non-NULL, will try to set up presentQueue as part
of device | 58 // If presentQueueIndex is non-NULL, will try to set up presentQueue as part
of device |
56 // creation. canPresent() is a device-dependent function. | 59 // creation using the platform-specific canPresent() function. |
57 static const GrVkBackendContext* Create(uint32_t* presentQueueIndex = nullpt
r, | 60 static const GrVkBackendContext* Create(uint32_t* presentQueueIndex = nullpt
r, |
58 bool(*canPresent)(VkInstance, VkPhysicalDevice, uint32_t que
ueIndex, | 61 CanPresentFn = CanPresentFn()); |
59 void* platformData) = nullptr, | |
60 void* platformData = nullptr); | |
61 | 62 |
62 ~GrVkBackendContext() override; | 63 ~GrVkBackendContext() override; |
63 }; | 64 }; |
64 | 65 |
65 #endif | 66 #endif |
OLD | NEW |