| 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" |
| 11 | 11 |
| 12 GrVkInterface::GrVkInterface() { | 12 GrVkInterface::GrVkInterface() { |
| 13 } | 13 } |
| 14 | 14 |
| 15 #define GET_PROC(F) functions->f ## F = (PFN_vk ## F) vkGetInstanceProcAddr(inst
ance, "vk" #F) | 15 #define GET_PROC(F) functions->f ## F = (PFN_vk ## F) vkGetInstanceProcAddr(inst
ance, "vk" #F) |
| 16 #define GET_PROC_LOCAL(inst, F) PFN_vk ## F F = (PFN_vk ## F) vkGetInstanceProcA
ddr(inst, "vk" #F) | 16 #define GET_PROC_LOCAL(inst, F) PFN_vk ## F F = (PFN_vk ## F) vkGetInstanceProcA
ddr(inst, "vk" #F) |
| 17 #define GET_DEV_PROC(F) functions->f ## F = (PFN_vk ## F) vkGetDeviceProcAddr(de
vice, "vk" #F) | 17 #define GET_DEV_PROC(F) functions->f ## F = (PFN_vk ## F) vkGetDeviceProcAddr(de
vice, "vk" #F) |
| 18 | 18 |
| 19 const GrVkInterface* GrVkCreateInterface(VkInstance instance, VkDevice device, | 19 const GrVkInterface* GrVkCreateInterface(VkInstance instance, VkDevice device, |
| 20 uint32_t extensionFlags) { | 20 uint32_t extensionFlags) { |
| 21 | 21 |
| 22 GrVkInterface* interface = new GrVkInterface(); | 22 GrVkInterface* interface = new GrVkInterface(); |
| 23 GrVkInterface::Functions* functions = &interface->fFunctions; | 23 GrVkInterface::Functions* functions = &interface->fFunctions; |
| 24 | 24 |
| 25 GET_PROC(CreateInstance); | 25 GET_PROC(CreateInstance); |
| 26 GET_PROC(DestroyInstance); | 26 GET_PROC(DestroyInstance); |
| 27 GET_PROC(EnumeratePhysicalDevices); | 27 GET_PROC(EnumeratePhysicalDevices); |
| 28 GET_PROC(GetPhysicalDeviceFeatures); | 28 GET_PROC(GetPhysicalDeviceFeatures); |
| 29 GET_PROC(GetPhysicalDeviceFormatProperties); | 29 GET_PROC(GetPhysicalDeviceFormatProperties); |
| (...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 366 //NULL == fFunctions.fCreateDisplayPlaneSurfaceKHR || | 366 //NULL == fFunctions.fCreateDisplayPlaneSurfaceKHR || |
| 367 //NULL == fFunctions.fCreateSharedSwapchainsKHR || | 367 //NULL == fFunctions.fCreateSharedSwapchainsKHR || |
| 368 NULL == fFunctions.fCreateDebugReportCallbackEXT || | 368 NULL == fFunctions.fCreateDebugReportCallbackEXT || |
| 369 NULL == fFunctions.fDebugReportMessageEXT || | 369 NULL == fFunctions.fDebugReportMessageEXT || |
| 370 NULL == fFunctions.fDestroyDebugReportCallbackEXT) { | 370 NULL == fFunctions.fDestroyDebugReportCallbackEXT) { |
| 371 | 371 |
| 372 return false; | 372 return false; |
| 373 } | 373 } |
| 374 return true; | 374 return true; |
| 375 } | 375 } |
| 376 | |
| OLD | NEW |