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 #include "vk/GrVkInterface.h" | 8 #include "vk/GrVkInterface.h" |
9 #include "vk/GrVkBackendContext.h" | 9 #include "vk/GrVkBackendContext.h" |
10 #include "vk/GrVkUtil.h" | 10 #include "vk/GrVkUtil.h" |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 GET_DEV_PROC(CmdBeginQuery); | 150 GET_DEV_PROC(CmdBeginQuery); |
151 GET_DEV_PROC(CmdEndQuery); | 151 GET_DEV_PROC(CmdEndQuery); |
152 GET_DEV_PROC(CmdResetQueryPool); | 152 GET_DEV_PROC(CmdResetQueryPool); |
153 GET_DEV_PROC(CmdWriteTimestamp); | 153 GET_DEV_PROC(CmdWriteTimestamp); |
154 GET_DEV_PROC(CmdCopyQueryPoolResults); | 154 GET_DEV_PROC(CmdCopyQueryPoolResults); |
155 GET_DEV_PROC(CmdPushConstants); | 155 GET_DEV_PROC(CmdPushConstants); |
156 GET_DEV_PROC(CmdBeginRenderPass); | 156 GET_DEV_PROC(CmdBeginRenderPass); |
157 GET_DEV_PROC(CmdNextSubpass); | 157 GET_DEV_PROC(CmdNextSubpass); |
158 GET_DEV_PROC(CmdEndRenderPass); | 158 GET_DEV_PROC(CmdEndRenderPass); |
159 GET_DEV_PROC(CmdExecuteCommands); | 159 GET_DEV_PROC(CmdExecuteCommands); |
160 // TODO: break these out with extension checks | 160 if (extensionFlags & kKHR_surface_GrVkExtensionFlag) { |
161 GET_PROC(DestroySurfaceKHR); | 161 GET_PROC(DestroySurfaceKHR); |
162 GET_PROC(GetPhysicalDeviceSurfaceSupportKHR); | 162 GET_PROC(GetPhysicalDeviceSurfaceSupportKHR); |
163 GET_PROC(GetPhysicalDeviceSurfaceCapabilitiesKHR); | 163 GET_PROC(GetPhysicalDeviceSurfaceCapabilitiesKHR); |
164 GET_PROC(GetPhysicalDeviceSurfaceFormatsKHR); | 164 GET_PROC(GetPhysicalDeviceSurfaceFormatsKHR); |
165 GET_PROC(GetPhysicalDeviceSurfacePresentModesKHR); | 165 GET_PROC(GetPhysicalDeviceSurfacePresentModesKHR); |
166 GET_DEV_PROC(CreateSwapchainKHR); | 166 } |
167 GET_DEV_PROC(DestroySwapchainKHR); | 167 if (extensionFlags & kKHR_surface_GrVkExtensionFlag) { |
168 GET_DEV_PROC(GetSwapchainImagesKHR); | 168 GET_DEV_PROC(CreateSwapchainKHR); |
169 GET_DEV_PROC(AcquireNextImageKHR); | 169 GET_DEV_PROC(DestroySwapchainKHR); |
170 GET_DEV_PROC(QueuePresentKHR); | 170 GET_DEV_PROC(GetSwapchainImagesKHR); |
171 GET_PROC(GetPhysicalDeviceDisplayPropertiesKHR); | 171 GET_DEV_PROC(AcquireNextImageKHR); |
172 GET_PROC(GetPhysicalDeviceDisplayPlanePropertiesKHR); | 172 GET_DEV_PROC(QueuePresentKHR); |
173 GET_PROC(GetDisplayPlaneSupportedDisplaysKHR); | 173 } |
174 GET_PROC(GetDisplayModePropertiesKHR); | 174 #if defined(VK_USE_PLATFORM_WIN32_KHR) |
175 GET_PROC(CreateDisplayModeKHR); | 175 if (extensionFlags & kKHR_win32_surface_GrVkExtensionFlag) { |
176 GET_PROC(GetDisplayPlaneCapabilitiesKHR); | 176 GET_PROC(CreateWin32SurfaceKHR); |
177 GET_PROC(CreateDisplayPlaneSurfaceKHR); | 177 GET_PROC(GetPhysicalDeviceWin32PresentationSupportKHR); |
178 GET_DEV_PROC(CreateSharedSwapchainsKHR); | 178 } |
| 179 #elif defined(VK_USE_PLATFORM_ANDROID_KHR) |
| 180 if (extensionFlags & kKHR_android_surface_GrVkExtensionFlag) { |
| 181 GET_PROC(CreateAndroidSurfaceKHR); |
| 182 } |
| 183 #elif defined(VK_USE_PLATFORM_XLIB_KHR) |
| 184 if (extensionFlags & kKHR_xlib_surface_GrVkExtensionFlag) { |
| 185 GET_PROC(CreateXlibSurfaceKHR); |
| 186 GET_PROC(GetPhysicalDeviceXlibPresentationSupportKHR); |
| 187 } |
| 188 #endif |
| 189 |
| 190 // We probably don't care about these, they're for consoles |
| 191 //GET_PROC(GetPhysicalDeviceDisplayPropertiesKHR); |
| 192 //GET_PROC(GetPhysicalDeviceDisplayPlanePropertiesKHR); |
| 193 //GET_PROC(GetDisplayPlaneSupportedDisplaysKHR); |
| 194 //GET_PROC(GetDisplayModePropertiesKHR); |
| 195 //GET_PROC(CreateDisplayModeKHR); |
| 196 //GET_PROC(GetDisplayPlaneCapabilitiesKHR); |
| 197 //GET_PROC(CreateDisplayPlaneSurfaceKHR); |
| 198 //GET_DEV_PROC(CreateSharedSwapchainsKHR); |
179 | 199 |
180 if (extensionFlags & kEXT_debug_report_GrVkExtensionFlag) { | 200 if (extensionFlags & kEXT_debug_report_GrVkExtensionFlag) { |
181 GET_PROC(CreateDebugReportCallbackEXT); | 201 GET_PROC(CreateDebugReportCallbackEXT); |
182 GET_PROC(DebugReportMessageEXT); | 202 GET_PROC(DebugReportMessageEXT); |
183 GET_PROC(DestroyDebugReportCallbackEXT); | 203 GET_PROC(DestroyDebugReportCallbackEXT); |
184 } | 204 } |
185 | 205 |
186 return interface; | 206 return interface; |
187 } | 207 } |
188 | 208 |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 NULL == fFunctions.fCmdPipelineBarrier || | 339 NULL == fFunctions.fCmdPipelineBarrier || |
320 NULL == fFunctions.fCmdBeginQuery || | 340 NULL == fFunctions.fCmdBeginQuery || |
321 NULL == fFunctions.fCmdEndQuery || | 341 NULL == fFunctions.fCmdEndQuery || |
322 NULL == fFunctions.fCmdResetQueryPool || | 342 NULL == fFunctions.fCmdResetQueryPool || |
323 NULL == fFunctions.fCmdWriteTimestamp || | 343 NULL == fFunctions.fCmdWriteTimestamp || |
324 NULL == fFunctions.fCmdCopyQueryPoolResults || | 344 NULL == fFunctions.fCmdCopyQueryPoolResults || |
325 NULL == fFunctions.fCmdPushConstants || | 345 NULL == fFunctions.fCmdPushConstants || |
326 NULL == fFunctions.fCmdBeginRenderPass || | 346 NULL == fFunctions.fCmdBeginRenderPass || |
327 NULL == fFunctions.fCmdNextSubpass || | 347 NULL == fFunctions.fCmdNextSubpass || |
328 NULL == fFunctions.fCmdEndRenderPass || | 348 NULL == fFunctions.fCmdEndRenderPass || |
329 NULL == fFunctions.fCmdExecuteCommands | 349 NULL == fFunctions.fCmdExecuteCommands || |
330 #ifdef VK_CHECK_ALL_FUNCTIONS | 350 NULL == fFunctions.fDestroySurfaceKHR || |
331 // || NULL == fFunctions.fDestroySurfaceKHR || | 351 NULL == fFunctions.fGetPhysicalDeviceSurfaceSupportKHR || |
332 //NULL == fFunctions.fGetPhysicalDeviceSurfaceSupportKHR || | 352 NULL == fFunctions.fGetPhysicalDeviceSurfaceCapabilitiesKHR || |
333 //NULL == fFunctions.fGetPhysicalDeviceSurfaceCapabilitiesKHR || | 353 NULL == fFunctions.fGetPhysicalDeviceSurfaceFormatsKHR || |
334 //NULL == fFunctions.fGetPhysicalDeviceSurfaceFormatsKHR || | 354 NULL == fFunctions.fGetPhysicalDeviceSurfacePresentModesKHR || |
335 //NULL == fFunctions.fGetPhysicalDeviceSurfacePresentModesKHR || | 355 NULL == fFunctions.fCreateSwapchainKHR || |
336 //NULL == fFunctions.fCreateSwapchainKHR || | 356 NULL == fFunctions.fDestroySwapchainKHR || |
337 //NULL == fFunctions.fDestroySwapchainKHR || | 357 NULL == fFunctions.fGetSwapchainImagesKHR || |
338 //NULL == fFunctions.fGetSwapchainImagesKHR || | 358 NULL == fFunctions.fAcquireNextImageKHR || |
339 //NULL == fFunctions.fAcquireNextImageKHR || | 359 NULL == fFunctions.fQueuePresentKHR || |
340 //NULL == fFunctions.fQueuePresentKHR || | |
341 //NULL == fFunctions.fGetPhysicalDeviceDisplayPropertiesKHR || | 360 //NULL == fFunctions.fGetPhysicalDeviceDisplayPropertiesKHR || |
342 //NULL == fFunctions.fGetPhysicalDeviceDisplayPlanePropertiesKHR || | 361 //NULL == fFunctions.fGetPhysicalDeviceDisplayPlanePropertiesKHR || |
343 //NULL == fFunctions.fGetDisplayPlaneSupportedDisplaysKHR || | 362 //NULL == fFunctions.fGetDisplayPlaneSupportedDisplaysKHR || |
344 //NULL == fFunctions.fGetDisplayModePropertiesKHR || | 363 //NULL == fFunctions.fGetDisplayModePropertiesKHR || |
345 //NULL == fFunctions.fCreateDisplayModeKHR || | 364 //NULL == fFunctions.fCreateDisplayModeKHR || |
346 //NULL == fFunctions.fGetDisplayPlaneCapabilitiesKHR || | 365 //NULL == fFunctions.fGetDisplayPlaneCapabilitiesKHR || |
347 //NULL == fFunctions.fCreateDisplayPlaneSurfaceKHR || | 366 //NULL == fFunctions.fCreateDisplayPlaneSurfaceKHR || |
348 //NULL == fFunctions.fCreateSharedSwapchainsKHR || | 367 //NULL == fFunctions.fCreateSharedSwapchainsKHR || |
349 //NULL == fFunctions.fCreateDebugReportCallbackEXT || | 368 NULL == fFunctions.fCreateDebugReportCallbackEXT || |
350 //NULL == fFunctions.fDebugReportMessageEXT || | 369 NULL == fFunctions.fDebugReportMessageEXT || |
351 //NULL == fFunctions.fDestroyDebugReportCallbackEXT) { | 370 NULL == fFunctions.fDestroyDebugReportCallbackEXT) { |
352 #else | 371 |
353 ) { | |
354 #endif | |
355 return false; | 372 return false; |
356 } | 373 } |
357 return true; | 374 return true; |
358 } | 375 } |
359 | 376 |
OLD | NEW |