OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 GrRadInterface_DEFINED | 8 #ifndef GrRadInterface_DEFINED |
9 #define GrRadInterface_DEFINED | 9 #define GrRadInterface_DEFINED |
10 | 10 |
11 #include "SkRefCnt.h" | 11 #include "SkRefCnt.h" |
12 | 12 |
| 13 #include "GrVkExtensions.h" |
| 14 |
13 #include "vulkan/vulkan.h" | 15 #include "vulkan/vulkan.h" |
14 | 16 |
15 //////////////////////////////////////////////////////////////////////////////// | 17 //////////////////////////////////////////////////////////////////////////////// |
16 | 18 |
17 /** | 19 /** |
18 * The default interface is returned by GrVkDefaultInterface. This function's | 20 * The default interface is returned by GrVkDefaultInterface. This function's |
19 * implementation is platform-specific. | 21 * implementation is platform-specific. |
20 */ | 22 */ |
21 | 23 |
22 struct GrVkInterface; | 24 struct GrVkInterface; |
(...skipping 24 matching lines...) Expand all Loading... |
47 | 49 |
48 typedef SkRefCnt INHERITED; | 50 typedef SkRefCnt INHERITED; |
49 | 51 |
50 public: | 52 public: |
51 GrVkInterface(); | 53 GrVkInterface(); |
52 | 54 |
53 // Validates that the GrVkInterface supports its advertised standard. This m
eans the necessary | 55 // Validates that the GrVkInterface supports its advertised standard. This m
eans the necessary |
54 // function pointers have been initialized for Vulkan version. | 56 // function pointers have been initialized for Vulkan version. |
55 bool validate() const; | 57 bool validate() const; |
56 | 58 |
| 59 GrVkExtensions fExtensions; |
| 60 |
| 61 bool hasInstanceExtension(const char ext[]) const { |
| 62 return fExtensions.hasInstanceExtension(ext); |
| 63 } |
| 64 bool hasDeviceExtension(const char ext[]) const { |
| 65 return fExtensions.hasDeviceExtension(ext); |
| 66 } |
| 67 bool hasInstanceLayer(const char ext[]) const { |
| 68 return fExtensions.hasInstanceLayer(ext); |
| 69 } |
| 70 bool hasDeviceLayer(const char ext[]) const { |
| 71 return fExtensions.hasDeviceLayer(ext); |
| 72 } |
| 73 |
57 /** | 74 /** |
58 * The function pointers are in a struct so that we can have a compiler gene
rated assignment | 75 * The function pointers are in a struct so that we can have a compiler gene
rated assignment |
59 * operator. | 76 * operator. |
60 */ | 77 */ |
61 struct Functions { | 78 struct Functions { |
62 VkPtr<PFN_vkCreateInstance> fCreateInstance; | 79 VkPtr<PFN_vkCreateInstance> fCreateInstance; |
63 VkPtr<PFN_vkDestroyInstance> fDestroyInstance; | 80 VkPtr<PFN_vkDestroyInstance> fDestroyInstance; |
64 VkPtr<PFN_vkEnumeratePhysicalDevices> fEnumeratePhysicalDevices; | 81 VkPtr<PFN_vkEnumeratePhysicalDevices> fEnumeratePhysicalDevices; |
65 VkPtr<PFN_vkGetPhysicalDeviceFeatures> fGetPhysicalDeviceFeatures; | 82 VkPtr<PFN_vkGetPhysicalDeviceFeatures> fGetPhysicalDeviceFeatures; |
66 VkPtr<PFN_vkGetPhysicalDeviceFormatProperties> fGetPhysicalDeviceFormatP
roperties; | 83 VkPtr<PFN_vkGetPhysicalDeviceFormatProperties> fGetPhysicalDeviceFormatP
roperties; |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 VkPtr<PFN_vkAcquireNextImageKHR> fAcquireNextImageKHR; | 222 VkPtr<PFN_vkAcquireNextImageKHR> fAcquireNextImageKHR; |
206 VkPtr<PFN_vkQueuePresentKHR> fQueuePresentKHR; | 223 VkPtr<PFN_vkQueuePresentKHR> fQueuePresentKHR; |
207 VkPtr<PFN_vkGetPhysicalDeviceDisplayPropertiesKHR> fGetPhysicalDeviceDis
playPropertiesKHR; | 224 VkPtr<PFN_vkGetPhysicalDeviceDisplayPropertiesKHR> fGetPhysicalDeviceDis
playPropertiesKHR; |
208 VkPtr<PFN_vkGetPhysicalDeviceDisplayPlanePropertiesKHR> fGetPhysicalDevi
ceDisplayPlanePropertiesKHR; | 225 VkPtr<PFN_vkGetPhysicalDeviceDisplayPlanePropertiesKHR> fGetPhysicalDevi
ceDisplayPlanePropertiesKHR; |
209 VkPtr<PFN_vkGetDisplayPlaneSupportedDisplaysKHR> fGetDisplayPlaneSupport
edDisplaysKHR; | 226 VkPtr<PFN_vkGetDisplayPlaneSupportedDisplaysKHR> fGetDisplayPlaneSupport
edDisplaysKHR; |
210 VkPtr<PFN_vkGetDisplayModePropertiesKHR> fGetDisplayModePropertiesKHR; | 227 VkPtr<PFN_vkGetDisplayModePropertiesKHR> fGetDisplayModePropertiesKHR; |
211 VkPtr<PFN_vkCreateDisplayModeKHR> fCreateDisplayModeKHR; | 228 VkPtr<PFN_vkCreateDisplayModeKHR> fCreateDisplayModeKHR; |
212 VkPtr<PFN_vkGetDisplayPlaneCapabilitiesKHR> fGetDisplayPlaneCapabilities
KHR; | 229 VkPtr<PFN_vkGetDisplayPlaneCapabilitiesKHR> fGetDisplayPlaneCapabilities
KHR; |
213 VkPtr<PFN_vkCreateDisplayPlaneSurfaceKHR> fCreateDisplayPlaneSurfaceKHR; | 230 VkPtr<PFN_vkCreateDisplayPlaneSurfaceKHR> fCreateDisplayPlaneSurfaceKHR; |
214 VkPtr<PFN_vkCreateSharedSwapchainsKHR> fCreateSharedSwapchainsKHR; | 231 VkPtr<PFN_vkCreateSharedSwapchainsKHR> fCreateSharedSwapchainsKHR; |
| 232 VkPtr<PFN_vkCreateDebugReportCallbackEXT> fCreateDebugReportCallbackEXT; |
| 233 VkPtr<PFN_vkDebugReportMessageEXT> fDebugReportMessageEXT; |
| 234 VkPtr<PFN_vkDestroyDebugReportCallbackEXT> fDestroyDebugReportCallbackEX
T; |
215 } fFunctions; | 235 } fFunctions; |
| 236 |
216 }; | 237 }; |
217 | 238 |
218 #endif | 239 #endif |
OLD | NEW |