// the ICDs.
#define ICD_VER_SUPPORTS_ICD_SURFACE_KHR 3
-void wsi_create_instance(struct loader_instance *ptr_instance, const VkInstanceCreateInfo *pCreateInfo) {
+void wsi_create_instance(struct loader_instance *loader_inst, const VkInstanceCreateInfo *pCreateInfo) {
for (uint32_t i = 0; i < pCreateInfo->enabledExtensionCount; i++) {
if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_KHR_SURFACE_EXTENSION_NAME) == 0) {
- ptr_instance->wsi_surface_enabled = true;
+ loader_inst->wsi_surface_enabled = true;
continue;
}
#ifdef VK_USE_PLATFORM_WIN32_KHR
if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_KHR_WIN32_SURFACE_EXTENSION_NAME) == 0) {
- ptr_instance->wsi_win32_surface_enabled = true;
+ loader_inst->wsi_win32_surface_enabled = true;
continue;
}
#endif // VK_USE_PLATFORM_WIN32_KHR
#ifdef VK_USE_PLATFORM_WAYLAND_KHR
if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME) == 0) {
- ptr_instance->wsi_wayland_surface_enabled = true;
+ loader_inst->wsi_wayland_surface_enabled = true;
continue;
}
#endif // VK_USE_PLATFORM_WAYLAND_KHR
#ifdef VK_USE_PLATFORM_XCB_KHR
if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_KHR_XCB_SURFACE_EXTENSION_NAME) == 0) {
- ptr_instance->wsi_xcb_surface_enabled = true;
+ loader_inst->wsi_xcb_surface_enabled = true;
continue;
}
#endif // VK_USE_PLATFORM_XCB_KHR
#ifdef VK_USE_PLATFORM_XLIB_KHR
if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_KHR_XLIB_SURFACE_EXTENSION_NAME) == 0) {
- ptr_instance->wsi_xlib_surface_enabled = true;
+ loader_inst->wsi_xlib_surface_enabled = true;
continue;
}
#endif // VK_USE_PLATFORM_XLIB_KHR
#ifdef VK_USE_PLATFORM_DIRECTFB_EXT
if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_EXT_DIRECTFB_SURFACE_EXTENSION_NAME) == 0) {
- ptr_instance->wsi_directfb_surface_enabled = true;
+ loader_inst->wsi_directfb_surface_enabled = true;
continue;
}
#endif // VK_USE_PLATFORM_DIRECTFB_EXT
#ifdef VK_USE_PLATFORM_ANDROID_KHR
if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_KHR_ANDROID_SURFACE_EXTENSION_NAME) == 0) {
- ptr_instance->wsi_android_surface_enabled = true;
+ loader_inst->wsi_android_surface_enabled = true;
continue;
}
#endif // VK_USE_PLATFORM_ANDROID_KHR
#ifdef VK_USE_PLATFORM_MACOS_MVK
if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_MVK_MACOS_SURFACE_EXTENSION_NAME) == 0) {
- ptr_instance->wsi_macos_surface_enabled = true;
+ loader_inst->wsi_macos_surface_enabled = true;
continue;
}
#endif // VK_USE_PLATFORM_MACOS_MVK
#ifdef VK_USE_PLATFORM_IOS_MVK
if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_MVK_IOS_SURFACE_EXTENSION_NAME) == 0) {
- ptr_instance->wsi_ios_surface_enabled = true;
+ loader_inst->wsi_ios_surface_enabled = true;
continue;
}
#endif // VK_USE_PLATFORM_IOS_MVK
#ifdef VK_USE_PLATFORM_GGP
if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_GGP_STREAM_DESCRIPTOR_SURFACE_EXTENSION_NAME) == 0) {
- ptr_instance->wsi_ggp_surface_enabled = true;
+ loader_inst->wsi_ggp_surface_enabled = true;
continue;
}
#endif // VK_USE_PLATFORM_GGP
#ifdef VK_USE_PLATFORM_FUCHSIA
if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_FUCHSIA_IMAGEPIPE_SURFACE_EXTENSION_NAME) == 0) {
- ptr_instance->wsi_imagepipe_surface_enabled = true;
+ loader_inst->wsi_imagepipe_surface_enabled = true;
continue;
}
#endif // VK_USE_PLATFORM_FUCHSIA
if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_EXT_HEADLESS_SURFACE_EXTENSION_NAME) == 0) {
- ptr_instance->wsi_headless_surface_enabled = true;
+ loader_inst->wsi_headless_surface_enabled = true;
continue;
}
#if defined(VK_USE_PLATFORM_METAL_EXT)
if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_EXT_METAL_SURFACE_EXTENSION_NAME) == 0) {
- ptr_instance->wsi_metal_surface_enabled = true;
+ loader_inst->wsi_metal_surface_enabled = true;
continue;
}
#endif
#if defined(VK_USE_PLATFORM_SCREEN_QNX)
if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_QNX_SCREEN_SURFACE_EXTENSION_NAME) == 0) {
- ptr_instance->wsi_screen_surface_enabled = true;
+ loader_inst->wsi_screen_surface_enabled = true;
continue;
}
#endif // VK_USE_PLATFORM_SCREEN_QNX
if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_KHR_DISPLAY_EXTENSION_NAME) == 0) {
- ptr_instance->wsi_display_enabled = true;
+ loader_inst->wsi_display_enabled = true;
continue;
}
if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_KHR_GET_DISPLAY_PROPERTIES_2_EXTENSION_NAME) == 0) {
- ptr_instance->wsi_display_props2_enabled = true;
+ loader_inst->wsi_display_props2_enabled = true;
continue;
}
}
// This is the trampoline entrypoint for DestroySurfaceKHR
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroySurfaceKHR(VkInstance instance, VkSurfaceKHR surface,
const VkAllocationCallbacks *pAllocator) {
- const VkLayerInstanceDispatchTable *disp;
- if (NULL == loader_get_instance(instance)) {
+ struct loader_instance *loader_inst = loader_get_instance(instance);
+ if (NULL == loader_inst) {
loader_log(NULL, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0,
"vkDestroySurfaceKHR: Invalid instance [VUID-vkDestroySurfaceKHR-instance-parameter]");
abort(); /* Intentionally fail so user can correct issue. */
}
- disp = loader_get_instance_layer_dispatch(instance);
- disp->DestroySurfaceKHR(instance, surface, pAllocator);
+ loader_inst->disp->layer_inst_disp.DestroySurfaceKHR(loader_inst->instance, surface, pAllocator);
}
// TODO probably need to lock around all the loader_get_instance() calls.
// This is the instance chain terminator function for DestroySurfaceKHR
VKAPI_ATTR void VKAPI_CALL terminator_DestroySurfaceKHR(VkInstance instance, VkSurfaceKHR surface,
const VkAllocationCallbacks *pAllocator) {
- struct loader_instance *ptr_instance = loader_get_instance(instance);
+ struct loader_instance *loader_inst = loader_get_instance(instance);
VkIcdSurface *icd_surface = (VkIcdSurface *)(uintptr_t)surface;
if (NULL != icd_surface) {
if (NULL != icd_surface->real_icd_surfaces) {
uint32_t i = 0;
- for (struct loader_icd_term *icd_term = ptr_instance->icd_terms; icd_term != NULL; icd_term = icd_term->next, i++) {
+ for (struct loader_icd_term *icd_term = loader_inst->icd_terms; icd_term != NULL; icd_term = icd_term->next, i++) {
if (icd_term->scanned_icd->interface_version >= ICD_VER_SUPPORTS_ICD_SURFACE_KHR) {
if (NULL != icd_term->dispatch.DestroySurfaceKHR && (VkSurfaceKHR)NULL != icd_surface->real_icd_surfaces[i]) {
icd_term->dispatch.DestroySurfaceKHR(icd_term->instance, icd_surface->real_icd_surfaces[i], pAllocator);
assert((VkSurfaceKHR)NULL == icd_surface->real_icd_surfaces[i]);
}
}
- loader_instance_heap_free(ptr_instance, icd_surface->real_icd_surfaces);
+ loader_instance_heap_free(loader_inst, icd_surface->real_icd_surfaces);
}
- loader_instance_heap_free(ptr_instance, (void *)(uintptr_t)surface);
+ loader_instance_heap_free(loader_inst, (void *)(uintptr_t)surface);
}
}
// First, check to ensure the appropriate extension was enabled:
struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice;
struct loader_icd_term *icd_term = phys_dev_term->this_icd_term;
- struct loader_instance *ptr_instance = (struct loader_instance *)icd_term->this_instance;
- if (!ptr_instance->wsi_surface_enabled) {
- loader_log(ptr_instance, VULKAN_LOADER_ERROR_BIT, 0,
+ struct loader_instance *loader_inst = (struct loader_instance *)icd_term->this_instance;
+ if (!loader_inst->wsi_surface_enabled) {
+ loader_log(loader_inst, VULKAN_LOADER_ERROR_BIT, 0,
"VK_KHR_surface extension not enabled. vkGetPhysicalDeviceSurfaceSupportKHR not executed!\n");
return VK_SUCCESS;
}
if (NULL == pSupported) {
- loader_log(ptr_instance, VULKAN_LOADER_ERROR_BIT, 0,
+ loader_log(loader_inst, VULKAN_LOADER_ERROR_BIT, 0,
"NULL pointer passed into vkGetPhysicalDeviceSurfaceSupportKHR for pSupported!\n");
abort();
}
*pSupported = false;
if (NULL == icd_term->dispatch.GetPhysicalDeviceSurfaceSupportKHR) {
- loader_log(ptr_instance, VULKAN_LOADER_ERROR_BIT, 0,
+ loader_log(loader_inst, VULKAN_LOADER_ERROR_BIT, 0,
"ICD for selected physical device is not exporting vkGetPhysicalDeviceSurfaceSupportKHR!\n");
abort();
}
// First, check to ensure the appropriate extension was enabled:
struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice;
struct loader_icd_term *icd_term = phys_dev_term->this_icd_term;
- struct loader_instance *ptr_instance = (struct loader_instance *)icd_term->this_instance;
- if (!ptr_instance->wsi_surface_enabled) {
- loader_log(ptr_instance, VULKAN_LOADER_ERROR_BIT, 0,
+ struct loader_instance *loader_inst = (struct loader_instance *)icd_term->this_instance;
+ if (!loader_inst->wsi_surface_enabled) {
+ loader_log(loader_inst, VULKAN_LOADER_ERROR_BIT, 0,
"VK_KHR_surface extension not enabled. vkGetPhysicalDeviceSurfaceCapabilitiesKHR not executed!\n");
return VK_SUCCESS;
}
if (NULL == pSurfaceCapabilities) {
- loader_log(ptr_instance, VULKAN_LOADER_ERROR_BIT, 0,
+ loader_log(loader_inst, VULKAN_LOADER_ERROR_BIT, 0,
"NULL pointer passed into vkGetPhysicalDeviceSurfaceCapabilitiesKHR for pSurfaceCapabilities!\n");
abort();
}
if (NULL == icd_term->dispatch.GetPhysicalDeviceSurfaceCapabilitiesKHR) {
- loader_log(ptr_instance, VULKAN_LOADER_ERROR_BIT, 0,
+ loader_log(loader_inst, VULKAN_LOADER_ERROR_BIT, 0,
"ICD for selected physical device is not exporting vkGetPhysicalDeviceSurfaceCapabilitiesKHR!\n");
abort();
}
// First, check to ensure the appropriate extension was enabled:
struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice;
struct loader_icd_term *icd_term = phys_dev_term->this_icd_term;
- struct loader_instance *ptr_instance = (struct loader_instance *)icd_term->this_instance;
- if (!ptr_instance->wsi_surface_enabled) {
- loader_log(ptr_instance, VULKAN_LOADER_ERROR_BIT, 0,
+ struct loader_instance *loader_inst = (struct loader_instance *)icd_term->this_instance;
+ if (!loader_inst->wsi_surface_enabled) {
+ loader_log(loader_inst, VULKAN_LOADER_ERROR_BIT, 0,
"VK_KHR_surface extension not enabled. vkGetPhysicalDeviceSurfaceFormatsKHR not executed!\n");
return VK_SUCCESS;
}
if (NULL == pSurfaceFormatCount) {
- loader_log(ptr_instance, VULKAN_LOADER_ERROR_BIT, 0,
+ loader_log(loader_inst, VULKAN_LOADER_ERROR_BIT, 0,
"NULL pointer passed into vkGetPhysicalDeviceSurfaceFormatsKHR for pSurfaceFormatCount!\n");
abort();
}
if (NULL == icd_term->dispatch.GetPhysicalDeviceSurfaceFormatsKHR) {
- loader_log(ptr_instance, VULKAN_LOADER_ERROR_BIT, 0,
+ loader_log(loader_inst, VULKAN_LOADER_ERROR_BIT, 0,
"ICD for selected physical device is not exporting vkGetPhysicalDeviceSurfaceCapabilitiesKHR!\n");
abort();
}
// First, check to ensure the appropriate extension was enabled:
struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice;
struct loader_icd_term *icd_term = phys_dev_term->this_icd_term;
- struct loader_instance *ptr_instance = (struct loader_instance *)icd_term->this_instance;
- if (!ptr_instance->wsi_surface_enabled) {
- loader_log(ptr_instance, VULKAN_LOADER_ERROR_BIT, 0,
+ struct loader_instance *loader_inst = (struct loader_instance *)icd_term->this_instance;
+ if (!loader_inst->wsi_surface_enabled) {
+ loader_log(loader_inst, VULKAN_LOADER_ERROR_BIT, 0,
"VK_KHR_surface extension not enabled. vkGetPhysicalDeviceSurfacePresentModesKHR not executed!\n");
return VK_SUCCESS;
}
if (NULL == pPresentModeCount) {
- loader_log(ptr_instance, VULKAN_LOADER_ERROR_BIT, 0,
+ loader_log(loader_inst, VULKAN_LOADER_ERROR_BIT, 0,
"NULL pointer passed into vkGetPhysicalDeviceSurfacePresentModesKHR for pPresentModeCount!\n");
abort();
}
if (NULL == icd_term->dispatch.GetPhysicalDeviceSurfacePresentModesKHR) {
- loader_log(ptr_instance, VULKAN_LOADER_ERROR_BIT, 0,
+ loader_log(loader_inst, VULKAN_LOADER_ERROR_BIT, 0,
"ICD for selected physical device is not exporting vkGetPhysicalDeviceSurfacePresentModesKHR!\n");
abort();
}
const VkWin32SurfaceCreateInfoKHR *pCreateInfo,
const VkAllocationCallbacks *pAllocator,
VkSurfaceKHR *pSurface) {
- const VkLayerInstanceDispatchTable *disp;
- if (NULL == loader_get_instance(instance)) {
+ struct loader_instance *loader_inst = loader_get_instance(instance);
+ if (NULL == loader_inst) {
loader_log(NULL, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0,
"vkCreateWin32SurfaceKHR: Invalid instance [VUID-vkCreateWin32SurfaceKHR-instance-parameter]");
abort(); /* Intentionally fail so user can correct issue. */
}
- disp = loader_get_instance_layer_dispatch(instance);
- VkResult res;
-
- res = disp->CreateWin32SurfaceKHR(instance, pCreateInfo, pAllocator, pSurface);
- return res;
+ return loader_inst->disp->layer_inst_disp.CreateWin32SurfaceKHR(loader_inst->instance, pCreateInfo, pAllocator, pSurface);
}
// This is the instance chain terminator function for CreateWin32SurfaceKHR
// Initialize pSurface to NULL just to be safe.
*pSurface = VK_NULL_HANDLE;
// First, check to ensure the appropriate extension was enabled:
- struct loader_instance *ptr_instance = loader_get_instance(instance);
- if (!ptr_instance->wsi_win32_surface_enabled) {
- loader_log(ptr_instance, VULKAN_LOADER_ERROR_BIT, 0,
+ struct loader_instance *loader_inst = loader_get_instance(instance);
+ if (!loader_inst->wsi_win32_surface_enabled) {
+ loader_log(loader_inst, VULKAN_LOADER_ERROR_BIT, 0,
"VK_KHR_win32_surface extension not enabled. vkCreateWin32SurfaceKHR not executed!\n");
vkRes = VK_ERROR_EXTENSION_NOT_PRESENT;
goto out;
}
// Next, if so, proceed with the implementation of this function:
- pIcdSurface = AllocateIcdSurfaceStruct(ptr_instance, sizeof(pIcdSurface->win_surf.base), sizeof(pIcdSurface->win_surf));
+ pIcdSurface = AllocateIcdSurfaceStruct(loader_inst, sizeof(pIcdSurface->win_surf.base), sizeof(pIcdSurface->win_surf));
if (pIcdSurface == NULL) {
vkRes = VK_ERROR_OUT_OF_HOST_MEMORY;
goto out;
pIcdSurface->win_surf.hwnd = pCreateInfo->hwnd;
// Loop through each ICD and determine if they need to create a surface
- for (struct loader_icd_term *icd_term = ptr_instance->icd_terms; icd_term != NULL; icd_term = icd_term->next, i++) {
+ for (struct loader_icd_term *icd_term = loader_inst->icd_terms; icd_term != NULL; icd_term = icd_term->next, i++) {
if (icd_term->scanned_icd->interface_version >= ICD_VER_SUPPORTS_ICD_SURFACE_KHR) {
if (NULL != icd_term->dispatch.CreateWin32SurfaceKHR) {
vkRes = icd_term->dispatch.CreateWin32SurfaceKHR(icd_term->instance, pCreateInfo, pAllocator,
if (VK_SUCCESS != vkRes && NULL != pIcdSurface) {
if (NULL != pIcdSurface->real_icd_surfaces) {
i = 0;
- for (struct loader_icd_term *icd_term = ptr_instance->icd_terms; icd_term != NULL; icd_term = icd_term->next, i++) {
+ for (struct loader_icd_term *icd_term = loader_inst->icd_terms; icd_term != NULL; icd_term = icd_term->next, i++) {
if ((VkSurfaceKHR)NULL != pIcdSurface->real_icd_surfaces[i] && NULL != icd_term->dispatch.DestroySurfaceKHR) {
icd_term->dispatch.DestroySurfaceKHR(icd_term->instance, pIcdSurface->real_icd_surfaces[i], pAllocator);
}
}
- loader_instance_heap_free(ptr_instance, pIcdSurface->real_icd_surfaces);
+ loader_instance_heap_free(loader_inst, pIcdSurface->real_icd_surfaces);
}
- loader_instance_heap_free(ptr_instance, pIcdSurface);
+ loader_instance_heap_free(loader_inst, pIcdSurface);
}
return vkRes;
abort(); /* Intentionally fail so user can correct issue. */
}
disp = loader_get_instance_layer_dispatch(physicalDevice);
- VkBool32 res = disp->GetPhysicalDeviceWin32PresentationSupportKHR(unwrapped_phys_dev, queueFamilyIndex);
- return res;
+ return disp->GetPhysicalDeviceWin32PresentationSupportKHR(unwrapped_phys_dev, queueFamilyIndex);
}
// This is the instance chain terminator function for
// First, check to ensure the appropriate extension was enabled:
struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice;
struct loader_icd_term *icd_term = phys_dev_term->this_icd_term;
- struct loader_instance *ptr_instance = (struct loader_instance *)icd_term->this_instance;
- if (!ptr_instance->wsi_win32_surface_enabled) {
- loader_log(ptr_instance, VULKAN_LOADER_ERROR_BIT, 0,
+ struct loader_instance *loader_inst = (struct loader_instance *)icd_term->this_instance;
+ if (!loader_inst->wsi_win32_surface_enabled) {
+ loader_log(loader_inst, VULKAN_LOADER_ERROR_BIT, 0,
"VK_KHR_win32_surface extension not enabled. vkGetPhysicalDeviceWin32PresentationSupportKHR not executed!\n");
return VK_SUCCESS;
}
if (NULL == icd_term->dispatch.GetPhysicalDeviceWin32PresentationSupportKHR) {
- loader_log(ptr_instance, VULKAN_LOADER_ERROR_BIT, 0,
+ loader_log(loader_inst, VULKAN_LOADER_ERROR_BIT, 0,
"ICD for selected physical device is not exporting vkGetPhysicalDeviceWin32PresentationSupportKHR!\n");
abort();
}
const VkWaylandSurfaceCreateInfoKHR *pCreateInfo,
const VkAllocationCallbacks *pAllocator,
VkSurfaceKHR *pSurface) {
- const VkLayerInstanceDispatchTable *disp;
- if (NULL == loader_get_instance(instance)) {
+ struct loader_instance *loader_inst = loader_get_instance(instance);
+ if (NULL == loader_inst) {
loader_log(NULL, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0,
"vkCreateWaylandSurfaceKHR: Invalid instance [VUID-vkCreateWaylandSurfaceKHR-instance-parameter]");
abort(); /* Intentionally fail so user can correct issue. */
}
- disp = loader_get_instance_layer_dispatch(instance);
- VkResult res;
-
- res = disp->CreateWaylandSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface);
- return res;
+ return loader_inst->disp->layer_inst_disp.CreateWaylandSurfaceKHR(loader_inst->instance, pCreateInfo, pAllocator, pSurface);
}
// This is the instance chain terminator function for CreateWaylandSurfaceKHR
uint32_t i = 0;
// First, check to ensure the appropriate extension was enabled:
- struct loader_instance *ptr_instance = loader_get_instance(instance);
- if (!ptr_instance->wsi_wayland_surface_enabled) {
- loader_log(ptr_instance, VULKAN_LOADER_ERROR_BIT, 0,
+ struct loader_instance *loader_inst = loader_get_instance(instance);
+ if (!loader_inst->wsi_wayland_surface_enabled) {
+ loader_log(loader_inst, VULKAN_LOADER_ERROR_BIT, 0,
"VK_KHR_wayland_surface extension not enabled. vkCreateWaylandSurfaceKHR not executed!\n");
vkRes = VK_ERROR_EXTENSION_NOT_PRESENT;
goto out;
}
// Next, if so, proceed with the implementation of this function:
- pIcdSurface = AllocateIcdSurfaceStruct(ptr_instance, sizeof(pIcdSurface->wayland_surf.base), sizeof(pIcdSurface->wayland_surf));
+ pIcdSurface = AllocateIcdSurfaceStruct(loader_inst, sizeof(pIcdSurface->wayland_surf.base), sizeof(pIcdSurface->wayland_surf));
if (pIcdSurface == NULL) {
vkRes = VK_ERROR_OUT_OF_HOST_MEMORY;
goto out;
pIcdSurface->wayland_surf.surface = pCreateInfo->surface;
// Loop through each ICD and determine if they need to create a surface
- for (struct loader_icd_term *icd_term = ptr_instance->icd_terms; icd_term != NULL; icd_term = icd_term->next, i++) {
+ for (struct loader_icd_term *icd_term = loader_inst->icd_terms; icd_term != NULL; icd_term = icd_term->next, i++) {
if (icd_term->scanned_icd->interface_version >= ICD_VER_SUPPORTS_ICD_SURFACE_KHR) {
if (NULL != icd_term->dispatch.CreateWaylandSurfaceKHR) {
vkRes = icd_term->dispatch.CreateWaylandSurfaceKHR(icd_term->instance, pCreateInfo, pAllocator,
if (VK_SUCCESS != vkRes && NULL != pIcdSurface) {
if (NULL != pIcdSurface->real_icd_surfaces) {
i = 0;
- for (struct loader_icd_term *icd_term = ptr_instance->icd_terms; icd_term != NULL; icd_term = icd_term->next, i++) {
+ for (struct loader_icd_term *icd_term = loader_inst->icd_terms; icd_term != NULL; icd_term = icd_term->next, i++) {
if ((VkSurfaceKHR)NULL != pIcdSurface->real_icd_surfaces[i] && NULL != icd_term->dispatch.DestroySurfaceKHR) {
icd_term->dispatch.DestroySurfaceKHR(icd_term->instance, pIcdSurface->real_icd_surfaces[i], pAllocator);
}
}
- loader_instance_heap_free(ptr_instance, pIcdSurface->real_icd_surfaces);
+ loader_instance_heap_free(loader_inst, pIcdSurface->real_icd_surfaces);
}
- loader_instance_heap_free(ptr_instance, pIcdSurface);
+ loader_instance_heap_free(loader_inst, pIcdSurface);
}
return vkRes;
abort(); /* Intentionally fail so user can correct issue. */
}
disp = loader_get_instance_layer_dispatch(physicalDevice);
- VkBool32 res = disp->GetPhysicalDeviceWaylandPresentationSupportKHR(unwrapped_phys_dev, queueFamilyIndex, display);
- return res;
+ return disp->GetPhysicalDeviceWaylandPresentationSupportKHR(unwrapped_phys_dev, queueFamilyIndex, display);
}
// This is the instance chain terminator function for
// First, check to ensure the appropriate extension was enabled:
struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice;
struct loader_icd_term *icd_term = phys_dev_term->this_icd_term;
- struct loader_instance *ptr_instance = (struct loader_instance *)icd_term->this_instance;
- if (!ptr_instance->wsi_wayland_surface_enabled) {
+ struct loader_instance *loader_inst = (struct loader_instance *)icd_term->this_instance;
+ if (!loader_inst->wsi_wayland_surface_enabled) {
loader_log(
- ptr_instance, VULKAN_LOADER_ERROR_BIT, 0,
+ loader_inst, VULKAN_LOADER_ERROR_BIT, 0,
"VK_KHR_wayland_surface extension not enabled. vkGetPhysicalDeviceWaylandPresentationSupportKHR not executed!\n");
return VK_SUCCESS;
}
if (NULL == icd_term->dispatch.GetPhysicalDeviceWaylandPresentationSupportKHR) {
- loader_log(ptr_instance, VULKAN_LOADER_ERROR_BIT, 0,
+ loader_log(loader_inst, VULKAN_LOADER_ERROR_BIT, 0,
"ICD for selected physical device is not exporting vkGetPhysicalDeviceWaylandPresentationSupportKHR!\n");
abort();
}
const VkXcbSurfaceCreateInfoKHR *pCreateInfo,
const VkAllocationCallbacks *pAllocator,
VkSurfaceKHR *pSurface) {
- const VkLayerInstanceDispatchTable *disp;
- if (NULL == loader_get_instance(instance)) {
+ struct loader_instance *loader_inst = loader_get_instance(instance);
+ if (NULL == loader_inst) {
loader_log(NULL, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0,
"vkCreateXcbSurfaceKHR: Invalid instance [VUID-vkCreateXcbSurfaceKHR-instance-parameter]");
abort(); /* Intentionally fail so user can correct issue. */
}
- disp = loader_get_instance_layer_dispatch(instance);
- VkResult res;
-
- res = disp->CreateXcbSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface);
- return res;
+ return loader_inst->disp->layer_inst_disp.CreateXcbSurfaceKHR(loader_inst->instance, pCreateInfo, pAllocator, pSurface);
}
// This is the instance chain terminator function for CreateXcbSurfaceKHR
uint32_t i = 0;
// First, check to ensure the appropriate extension was enabled:
- struct loader_instance *ptr_instance = loader_get_instance(instance);
- if (!ptr_instance->wsi_xcb_surface_enabled) {
- loader_log(ptr_instance, VULKAN_LOADER_ERROR_BIT, 0,
+ struct loader_instance *loader_inst = loader_get_instance(instance);
+ if (!loader_inst->wsi_xcb_surface_enabled) {
+ loader_log(loader_inst, VULKAN_LOADER_ERROR_BIT, 0,
"VK_KHR_xcb_surface extension not enabled. vkCreateXcbSurfaceKHR not executed!\n");
vkRes = VK_ERROR_EXTENSION_NOT_PRESENT;
goto out;
}
// Next, if so, proceed with the implementation of this function:
- pIcdSurface = AllocateIcdSurfaceStruct(ptr_instance, sizeof(pIcdSurface->xcb_surf.base), sizeof(pIcdSurface->xcb_surf));
+ pIcdSurface = AllocateIcdSurfaceStruct(loader_inst, sizeof(pIcdSurface->xcb_surf.base), sizeof(pIcdSurface->xcb_surf));
if (pIcdSurface == NULL) {
vkRes = VK_ERROR_OUT_OF_HOST_MEMORY;
goto out;
pIcdSurface->xcb_surf.window = pCreateInfo->window;
// Loop through each ICD and determine if they need to create a surface
- for (struct loader_icd_term *icd_term = ptr_instance->icd_terms; icd_term != NULL; icd_term = icd_term->next, i++) {
+ for (struct loader_icd_term *icd_term = loader_inst->icd_terms; icd_term != NULL; icd_term = icd_term->next, i++) {
if (icd_term->scanned_icd->interface_version >= ICD_VER_SUPPORTS_ICD_SURFACE_KHR) {
if (NULL != icd_term->dispatch.CreateXcbSurfaceKHR) {
vkRes = icd_term->dispatch.CreateXcbSurfaceKHR(icd_term->instance, pCreateInfo, pAllocator,
if (VK_SUCCESS != vkRes && NULL != pIcdSurface) {
if (NULL != pIcdSurface->real_icd_surfaces) {
i = 0;
- for (struct loader_icd_term *icd_term = ptr_instance->icd_terms; icd_term != NULL; icd_term = icd_term->next, i++) {
+ for (struct loader_icd_term *icd_term = loader_inst->icd_terms; icd_term != NULL; icd_term = icd_term->next, i++) {
if ((VkSurfaceKHR)NULL != pIcdSurface->real_icd_surfaces[i] && NULL != icd_term->dispatch.DestroySurfaceKHR) {
icd_term->dispatch.DestroySurfaceKHR(icd_term->instance, pIcdSurface->real_icd_surfaces[i], pAllocator);
}
}
- loader_instance_heap_free(ptr_instance, pIcdSurface->real_icd_surfaces);
+ loader_instance_heap_free(loader_inst, pIcdSurface->real_icd_surfaces);
}
- loader_instance_heap_free(ptr_instance, pIcdSurface);
+ loader_instance_heap_free(loader_inst, pIcdSurface);
}
return vkRes;
abort(); /* Intentionally fail so user can correct issue. */
}
disp = loader_get_instance_layer_dispatch(physicalDevice);
- VkBool32 res = disp->GetPhysicalDeviceXcbPresentationSupportKHR(unwrapped_phys_dev, queueFamilyIndex, connection, visual_id);
- return res;
+ return disp->GetPhysicalDeviceXcbPresentationSupportKHR(unwrapped_phys_dev, queueFamilyIndex, connection, visual_id);
}
// This is the instance chain terminator function for
// First, check to ensure the appropriate extension was enabled:
struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice;
struct loader_icd_term *icd_term = phys_dev_term->this_icd_term;
- struct loader_instance *ptr_instance = (struct loader_instance *)icd_term->this_instance;
- if (!ptr_instance->wsi_xcb_surface_enabled) {
- loader_log(ptr_instance, VULKAN_LOADER_ERROR_BIT, 0,
+ struct loader_instance *loader_inst = (struct loader_instance *)icd_term->this_instance;
+ if (!loader_inst->wsi_xcb_surface_enabled) {
+ loader_log(loader_inst, VULKAN_LOADER_ERROR_BIT, 0,
"VK_KHR_xcb_surface extension not enabled. vkGetPhysicalDeviceXcbPresentationSupportKHR not executed!\n");
return VK_SUCCESS;
}
if (NULL == icd_term->dispatch.GetPhysicalDeviceXcbPresentationSupportKHR) {
- loader_log(ptr_instance, VULKAN_LOADER_ERROR_BIT, 0,
+ loader_log(loader_inst, VULKAN_LOADER_ERROR_BIT, 0,
"ICD for selected physical device is not exporting vkGetPhysicalDeviceXcbPresentationSupportKHR!\n");
abort();
}
const VkXlibSurfaceCreateInfoKHR *pCreateInfo,
const VkAllocationCallbacks *pAllocator,
VkSurfaceKHR *pSurface) {
- const VkLayerInstanceDispatchTable *disp;
- if (NULL == loader_get_instance(instance)) {
+ struct loader_instance *loader_inst = loader_get_instance(instance);
+ if (NULL == loader_inst) {
loader_log(NULL, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0,
"vkCreateXlibSurfaceKHR: Invalid instance [VUID-vkCreateXlibSurfaceKHR-instance-parameter]");
abort(); /* Intentionally fail so user can correct issue. */
}
- disp = loader_get_instance_layer_dispatch(instance);
- VkResult res;
-
- res = disp->CreateXlibSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface);
- return res;
+ return loader_inst->disp->layer_inst_disp.CreateXlibSurfaceKHR(loader_inst->instance, pCreateInfo, pAllocator, pSurface);
}
// This is the instance chain terminator function for CreateXlibSurfaceKHR
uint32_t i = 0;
// First, check to ensure the appropriate extension was enabled:
- struct loader_instance *ptr_instance = loader_get_instance(instance);
- if (!ptr_instance->wsi_xlib_surface_enabled) {
- loader_log(ptr_instance, VULKAN_LOADER_ERROR_BIT, 0,
+ struct loader_instance *loader_inst = loader_get_instance(instance);
+ if (!loader_inst->wsi_xlib_surface_enabled) {
+ loader_log(loader_inst, VULKAN_LOADER_ERROR_BIT, 0,
"VK_KHR_xlib_surface extension not enabled. vkCreateXlibSurfaceKHR not executed!\n");
vkRes = VK_ERROR_EXTENSION_NOT_PRESENT;
goto out;
}
// Next, if so, proceed with the implementation of this function:
- pIcdSurface = AllocateIcdSurfaceStruct(ptr_instance, sizeof(pIcdSurface->xlib_surf.base), sizeof(pIcdSurface->xlib_surf));
+ pIcdSurface = AllocateIcdSurfaceStruct(loader_inst, sizeof(pIcdSurface->xlib_surf.base), sizeof(pIcdSurface->xlib_surf));
if (pIcdSurface == NULL) {
vkRes = VK_ERROR_OUT_OF_HOST_MEMORY;
goto out;
pIcdSurface->xlib_surf.window = pCreateInfo->window;
// Loop through each ICD and determine if they need to create a surface
- for (struct loader_icd_term *icd_term = ptr_instance->icd_terms; icd_term != NULL; icd_term = icd_term->next, i++) {
+ for (struct loader_icd_term *icd_term = loader_inst->icd_terms; icd_term != NULL; icd_term = icd_term->next, i++) {
if (icd_term->scanned_icd->interface_version >= ICD_VER_SUPPORTS_ICD_SURFACE_KHR) {
if (NULL != icd_term->dispatch.CreateXlibSurfaceKHR) {
vkRes = icd_term->dispatch.CreateXlibSurfaceKHR(icd_term->instance, pCreateInfo, pAllocator,
if (VK_SUCCESS != vkRes && NULL != pIcdSurface) {
if (NULL != pIcdSurface->real_icd_surfaces) {
i = 0;
- for (struct loader_icd_term *icd_term = ptr_instance->icd_terms; icd_term != NULL; icd_term = icd_term->next, i++) {
+ for (struct loader_icd_term *icd_term = loader_inst->icd_terms; icd_term != NULL; icd_term = icd_term->next, i++) {
if ((VkSurfaceKHR)NULL != pIcdSurface->real_icd_surfaces[i] && NULL != icd_term->dispatch.DestroySurfaceKHR) {
icd_term->dispatch.DestroySurfaceKHR(icd_term->instance, pIcdSurface->real_icd_surfaces[i], pAllocator);
}
}
- loader_instance_heap_free(ptr_instance, pIcdSurface->real_icd_surfaces);
+ loader_instance_heap_free(loader_inst, pIcdSurface->real_icd_surfaces);
}
- loader_instance_heap_free(ptr_instance, pIcdSurface);
+ loader_instance_heap_free(loader_inst, pIcdSurface);
}
return vkRes;
abort(); /* Intentionally fail so user can correct issue. */
}
disp = loader_get_instance_layer_dispatch(physicalDevice);
- VkBool32 res = disp->GetPhysicalDeviceXlibPresentationSupportKHR(unwrapped_phys_dev, queueFamilyIndex, dpy, visualID);
- return res;
+ return disp->GetPhysicalDeviceXlibPresentationSupportKHR(unwrapped_phys_dev, queueFamilyIndex, dpy, visualID);
}
// This is the instance chain terminator function for
// First, check to ensure the appropriate extension was enabled:
struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice;
struct loader_icd_term *icd_term = phys_dev_term->this_icd_term;
- struct loader_instance *ptr_instance = (struct loader_instance *)icd_term->this_instance;
- if (!ptr_instance->wsi_xlib_surface_enabled) {
- loader_log(ptr_instance, VULKAN_LOADER_ERROR_BIT, 0,
+ struct loader_instance *loader_inst = (struct loader_instance *)icd_term->this_instance;
+ if (!loader_inst->wsi_xlib_surface_enabled) {
+ loader_log(loader_inst, VULKAN_LOADER_ERROR_BIT, 0,
"VK_KHR_xlib_surface extension not enabled. vkGetPhysicalDeviceXlibPresentationSupportKHR not executed!\n");
return VK_SUCCESS;
}
if (NULL == icd_term->dispatch.GetPhysicalDeviceXlibPresentationSupportKHR) {
- loader_log(ptr_instance, VULKAN_LOADER_ERROR_BIT, 0,
+ loader_log(loader_inst, VULKAN_LOADER_ERROR_BIT, 0,
"ICD for selected physical device is not exporting vkGetPhysicalDeviceXlibPresentationSupportKHR!\n");
abort();
}
const VkDirectFBSurfaceCreateInfoEXT *pCreateInfo,
const VkAllocationCallbacks *pAllocator,
VkSurfaceKHR *pSurface) {
- const VkLayerInstanceDispatchTable *disp;
- if (NULL == loader_get_instance(instance)) {
+ struct loader_instance *loader_inst = loader_get_instance(instance);
+ if (NULL == loader_inst) {
loader_log(NULL, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0,
"vkCreateDirectFBSurfaceEXT: Invalid instance [VUID-vkCreateDirectFBSurfaceEXT-instance-parameter]");
abort(); /* Intentionally fail so user can correct issue. */
}
- disp = loader_get_instance_layer_dispatch(instance);
- VkResult res;
-
- res = disp->CreateDirectFBSurfaceEXT(instance, pCreateInfo, pAllocator, pSurface);
- return res;
+ return loader_inst->disp->layer_inst_disp.CreateDirectFBSurfaceEXT(loader_inst->instance, pCreateInfo, pAllocator, pSurface);
}
// This is the instance chain terminator function for CreateDirectFBSurfaceEXT
uint32_t i = 0;
// First, check to ensure the appropriate extension was enabled:
- struct loader_instance *ptr_instance = loader_get_instance(instance);
- if (!ptr_instance->wsi_directfb_surface_enabled) {
- loader_log(ptr_instance, VULKAN_LOADER_ERROR_BIT, 0,
+ struct loader_instance *loader_inst = loader_get_instance(instance);
+ if (!loader_inst->wsi_directfb_surface_enabled) {
+ loader_log(loader_inst, VULKAN_LOADER_ERROR_BIT, 0,
"VK_EXT_directfb_surface extension not enabled. vkCreateDirectFBSurfaceEXT not executed!\n");
vkRes = VK_ERROR_EXTENSION_NOT_PRESENT;
goto out;
// Next, if so, proceed with the implementation of this function:
pIcdSurface =
- AllocateIcdSurfaceStruct(ptr_instance, sizeof(pIcdSurface->directfb_surf.base), sizeof(pIcdSurface->directfb_surf));
+ AllocateIcdSurfaceStruct(loader_inst, sizeof(pIcdSurface->directfb_surf.base), sizeof(pIcdSurface->directfb_surf));
if (pIcdSurface == NULL) {
vkRes = VK_ERROR_OUT_OF_HOST_MEMORY;
goto out;
pIcdSurface->directfb_surf.surface = pCreateInfo->surface;
// Loop through each ICD and determine if they need to create a surface
- for (struct loader_icd_term *icd_term = ptr_instance->icd_terms; icd_term != NULL; icd_term = icd_term->next, i++) {
+ for (struct loader_icd_term *icd_term = loader_inst->icd_terms; icd_term != NULL; icd_term = icd_term->next, i++) {
if (icd_term->scanned_icd->interface_version >= ICD_VER_SUPPORTS_ICD_SURFACE_KHR) {
if (NULL != icd_term->dispatch.CreateDirectFBSurfaceEXT) {
vkRes = icd_term->dispatch.CreateDirectFBSurfaceEXT(icd_term->instance, pCreateInfo, pAllocator,
if (VK_SUCCESS != vkRes && NULL != pIcdSurface) {
if (NULL != pIcdSurface->real_icd_surfaces) {
i = 0;
- for (struct loader_icd_term *icd_term = ptr_instance->icd_terms; icd_term != NULL; icd_term = icd_term->next, i++) {
+ for (struct loader_icd_term *icd_term = loader_inst->icd_terms; icd_term != NULL; icd_term = icd_term->next, i++) {
if ((VkSurfaceKHR)NULL != pIcdSurface->real_icd_surfaces[i] && NULL != icd_term->dispatch.DestroySurfaceKHR) {
icd_term->dispatch.DestroySurfaceKHR(icd_term->instance, pIcdSurface->real_icd_surfaces[i], pAllocator);
}
}
- loader_instance_heap_free(ptr_instance, pIcdSurface->real_icd_surfaces);
+ loader_instance_heap_free(loader_inst, pIcdSurface->real_icd_surfaces);
}
- loader_instance_heap_free(ptr_instance, pIcdSurface);
+ loader_instance_heap_free(loader_inst, pIcdSurface);
}
return vkRes;
abort(); /* Intentionally fail so user can correct issue. */
}
disp = loader_get_instance_layer_dispatch(physicalDevice);
- VkBool32 res = disp->GetPhysicalDeviceDirectFBPresentationSupportEXT(unwrapped_phys_dev, queueFamilyIndex, dfb);
- return res;
+ return disp->GetPhysicalDeviceDirectFBPresentationSupportEXT(unwrapped_phys_dev, queueFamilyIndex, dfb);
}
// This is the instance chain terminator function for
// First, check to ensure the appropriate extension was enabled:
struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice;
struct loader_icd_term *icd_term = phys_dev_term->this_icd_term;
- struct loader_instance *ptr_instance = (struct loader_instance *)icd_term->this_instance;
- if (!ptr_instance->wsi_directfb_surface_enabled) {
+ struct loader_instance *loader_inst = (struct loader_instance *)icd_term->this_instance;
+ if (!loader_inst->wsi_directfb_surface_enabled) {
loader_log(
- ptr_instance, VULKAN_LOADER_ERROR_BIT, 0,
+ loader_inst, VULKAN_LOADER_ERROR_BIT, 0,
"VK_EXT_directfb_surface extension not enabled. vkGetPhysicalDeviceWaylandPresentationSupportKHR not executed!\n");
return VK_SUCCESS;
}
if (NULL == icd_term->dispatch.GetPhysicalDeviceDirectFBPresentationSupportEXT) {
- loader_log(ptr_instance, VULKAN_LOADER_ERROR_BIT, 0,
+ loader_log(loader_inst, VULKAN_LOADER_ERROR_BIT, 0,
"ICD for selected physical device is not exporting vkGetPhysicalDeviceDirectFBPresentationSupportEXT!\n");
abort();
}
return icd_term->dispatch.GetPhysicalDeviceDirectFBPresentationSupportEXT(phys_dev_term->phys_dev, queueFamilyIndex, dfb);
}
+
#endif // VK_USE_PLATFORM_DIRECTFB_EXT
#ifdef VK_USE_PLATFORM_ANDROID_KHR
const VkAndroidSurfaceCreateInfoKHR *pCreateInfo,
const VkAllocationCallbacks *pAllocator,
VkSurfaceKHR *pSurface) {
- const VkLayerInstanceDispatchTable *disp;
- if (NULL == loader_get_instance(instance)) {
+ struct loader_instance *loader_inst = loader_get_instance(instance);
+ if (NULL == loader_inst) {
loader_log(NULL, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0,
"vkCreateAndroidSurfaceKHR: Invalid instance [VUID-vkCreateAndroidSurfaceKHR-instance-parameter]");
abort(); /* Intentionally fail so user can correct issue. */
}
- disp = loader_get_instance_layer_dispatch(instance);
- VkResult res;
-
- res = disp->CreateAndroidSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface);
- return res;
+ return loader_inst->disp->layer_inst_disp.CreateAndroidSurfaceKHR(loader_inst->instance, pCreateInfo, pAllocator, pSurface);
}
// This is the instance chain terminator function for CreateAndroidSurfaceKHR
const VkAndroidSurfaceCreateInfoKHR *pCreateInfo,
const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface) {
// First, check to ensure the appropriate extension was enabled:
- struct loader_instance *ptr_instance = loader_get_instance(instance);
- if (!ptr_instance->wsi_display_enabled) {
- loader_log(ptr_instance, VULKAN_LOADER_ERROR_BIT, 0,
+ struct loader_instance *loader_inst = loader_get_instance(instance);
+ if (!loader_inst->wsi_display_enabled) {
+ loader_log(loader_inst, VULKAN_LOADER_ERROR_BIT, 0,
"VK_KHR_display extension not enabled. vkCreateAndroidSurfaceKHR not executed!\n");
return VK_ERROR_EXTENSION_NOT_PRESENT;
}
// Next, if so, proceed with the implementation of this function:
VkIcdSurfaceAndroid *pIcdSurface =
- loader_instance_heap_alloc(ptr_instance, sizeof(VkIcdSurfaceAndroid), VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
+ loader_instance_heap_alloc(loader_inst, sizeof(VkIcdSurfaceAndroid), VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if (pIcdSurface == NULL) {
return VK_ERROR_OUT_OF_HOST_MEMORY;
}
const VkHeadlessSurfaceCreateInfoEXT *pCreateInfo,
const VkAllocationCallbacks *pAllocator,
VkSurfaceKHR *pSurface) {
- const VkLayerInstanceDispatchTable *disp;
- if (NULL == loader_get_instance(instance)) {
+ struct loader_instance *loader_inst = loader_get_instance(instance);
+ if (NULL == loader_inst) {
loader_log(NULL, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0,
"vkCreateHeadlessSurfaceEXT: Invalid instance [VUID-vkCreateHeadlessSurfaceEXT-instance-parameter]");
abort(); /* Intentionally fail so user can correct issue. */
}
- disp = loader_get_instance_layer_dispatch(instance);
- VkResult res;
-
- res = disp->CreateHeadlessSurfaceEXT(instance, pCreateInfo, pAllocator, pSurface);
- return res;
+ return loader_inst->disp->layer_inst_disp.CreateHeadlessSurfaceEXT(loader_inst->instance, pCreateInfo, pAllocator, pSurface);
}
VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateHeadlessSurfaceEXT(VkInstance instance,
const VkMacOSSurfaceCreateInfoMVK *pCreateInfo,
const VkAllocationCallbacks *pAllocator,
VkSurfaceKHR *pSurface) {
- const VkLayerInstanceDispatchTable *disp;
- if (NULL == loader_get_instance(instance)) {
+ struct loader_instance *loader_inst = loader_get_instance(instance);
+ if (NULL == loader_inst) {
loader_log(NULL, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0,
"vkCreateMacOSSurfaceMVK: Invalid instance [VUID-vkCreateMacOSSurfaceMVK-instance-parameter]");
abort(); /* Intentionally fail so user can correct issue. */
}
- disp = loader_get_instance_layer_dispatch(instance);
- VkResult res;
-
- res = disp->CreateMacOSSurfaceMVK(instance, pCreateInfo, pAllocator, pSurface);
- return res;
+ return loader_inst->disp->layer_inst_disp.CreateMacOSSurfaceMVK(loader_inst->instance, pCreateInfo, pAllocator, pSurface);
}
// This is the instance chain terminator function for CreateMacOSSurfaceKHR
uint32_t i = 0;
// First, check to ensure the appropriate extension was enabled:
- struct loader_instance *ptr_instance = loader_get_instance(instance);
- if (!ptr_instance->wsi_macos_surface_enabled) {
- loader_log(ptr_instance, VULKAN_LOADER_ERROR_BIT, 0,
+ struct loader_instance *loader_inst = loader_get_instance(instance);
+ if (!loader_inst->wsi_macos_surface_enabled) {
+ loader_log(loader_inst, VULKAN_LOADER_ERROR_BIT, 0,
"VK_MVK_macos_surface extension not enabled. vkCreateMacOSSurfaceMVK not executed!\n");
vkRes = VK_ERROR_EXTENSION_NOT_PRESENT;
goto out;
}
// Next, if so, proceed with the implementation of this function:
- pIcdSurface = AllocateIcdSurfaceStruct(ptr_instance, sizeof(pIcdSurface->macos_surf.base), sizeof(pIcdSurface->macos_surf));
+ pIcdSurface = AllocateIcdSurfaceStruct(loader_inst, sizeof(pIcdSurface->macos_surf.base), sizeof(pIcdSurface->macos_surf));
if (pIcdSurface == NULL) {
vkRes = VK_ERROR_OUT_OF_HOST_MEMORY;
goto out;
pIcdSurface->macos_surf.pView = pCreateInfo->pView;
// Loop through each ICD and determine if they need to create a surface
- for (struct loader_icd_term *icd_term = ptr_instance->icd_terms; icd_term != NULL; icd_term = icd_term->next, i++) {
+ for (struct loader_icd_term *icd_term = loader_inst->icd_terms; icd_term != NULL; icd_term = icd_term->next, i++) {
if (icd_term->scanned_icd->interface_version >= ICD_VER_SUPPORTS_ICD_SURFACE_KHR) {
if (NULL != icd_term->dispatch.CreateMacOSSurfaceMVK) {
vkRes = icd_term->dispatch.CreateMacOSSurfaceMVK(icd_term->instance, pCreateInfo, pAllocator,
if (VK_SUCCESS != vkRes && NULL != pIcdSurface) {
if (NULL != pIcdSurface->real_icd_surfaces) {
i = 0;
- for (struct loader_icd_term *icd_term = ptr_instance->icd_terms; icd_term != NULL; icd_term = icd_term->next, i++) {
+ for (struct loader_icd_term *icd_term = loader_inst->icd_terms; icd_term != NULL; icd_term = icd_term->next, i++) {
if ((VkSurfaceKHR)NULL != pIcdSurface->real_icd_surfaces[i] && NULL != icd_term->dispatch.DestroySurfaceKHR) {
icd_term->dispatch.DestroySurfaceKHR(icd_term->instance, pIcdSurface->real_icd_surfaces[i], pAllocator);
}
}
- loader_instance_heap_free(ptr_instance, pIcdSurface->real_icd_surfaces);
+ loader_instance_heap_free(loader_inst, pIcdSurface->real_icd_surfaces);
}
- loader_instance_heap_free(ptr_instance, pIcdSurface);
+ loader_instance_heap_free(loader_inst, pIcdSurface);
}
return vkRes;
const VkIOSSurfaceCreateInfoMVK *pCreateInfo,
const VkAllocationCallbacks *pAllocator,
VkSurfaceKHR *pSurface) {
- const VkLayerInstanceDispatchTable *disp;
- if (NULL == loader_get_instance(instance)) {
+ struct loader_instance *loader_inst = loader_get_instance(instance);
+ if (NULL == loader_inst) {
loader_log(NULL, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0,
"vkCreateIOSSurfaceMVK: Invalid instance [VUID-vkCreateIOSSurfaceMVK-instance-parameter]");
abort(); /* Intentionally fail so user can correct issue. */
}
- disp = loader_get_instance_layer_dispatch(instance);
- VkResult res;
-
- res = disp->CreateIOSSurfaceMVK(instance, pCreateInfo, pAllocator, pSurface);
- return res;
+ return loader_inst->disp->layer_inst_disp.CreateIOSSurfaceMVK(loader_inst->instance, pCreateInfo, pAllocator, pSurface);
}
// This is the instance chain terminator function for CreateIOSSurfaceKHR
VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateIOSSurfaceMVK(VkInstance instance, const VkIOSSurfaceCreateInfoMVK *pCreateInfo,
const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface) {
// First, check to ensure the appropriate extension was enabled:
- struct loader_instance *ptr_instance = loader_get_instance(instance);
- if (!ptr_instance->wsi_ios_surface_enabled) {
- loader_log(ptr_instance, VULKAN_LOADER_ERROR_BIT, 0,
+ struct loader_instance *loader_inst = loader_get_instance(instance);
+ if (!loader_inst->wsi_ios_surface_enabled) {
+ loader_log(loader_inst, VULKAN_LOADER_ERROR_BIT, 0,
"VK_MVK_ios_surface extension not enabled. vkCreateIOSSurfaceMVK not executed!\n");
return VK_ERROR_EXTENSION_NOT_PRESENT;
}
// Next, if so, proceed with the implementation of this function:
VkIcdSurfaceIOS *pIcdSurface =
- loader_instance_heap_alloc(ptr_instance, sizeof(VkIcdSurfaceIOS), VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
+ loader_instance_heap_alloc(loader_inst, sizeof(VkIcdSurfaceIOS), VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if (pIcdSurface == NULL) {
return VK_ERROR_OUT_OF_HOST_MEMORY;
}
LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
vkCreateStreamDescriptorSurfaceGGP(VkInstance instance, const VkStreamDescriptorSurfaceCreateInfoGGP *pCreateInfo,
const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface) {
- const VkLayerInstanceDispatchTable *disp;
- if (NULL == loader_get_instance(instance)) {
+ struct loader_instance *loader_inst = loader_get_instance(instance);
+ if (NULL == loader_inst) {
loader_log(
NULL, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0,
"vkCreateStreamDescriptorSurfaceGGP: Invalid instance [VUID-vkCreateStreamDescriptorSurfaceGGP-instance-parameter]");
abort(); /* Intentionally fail so user can correct issue. */
}
- disp = loader_get_instance_layer_dispatch(instance);
- VkResult res;
-
- res = disp->CreateStreamDescriptorSurfaceGGP(instance, pCreateInfo, pAllocator, pSurface);
- return res;
+ return loader_inst->disp->layer_inst_disp.CreateStreamDescriptorSurfaceGGP(loader_inst->instance, pCreateInfo, pAllocator,
+ pSurface);
}
// This is the instance chain terminator function for CreateStreamDescriptorSurfaceGGP
uint32_t i = 0;
// First, check to ensure the appropriate extension was enabled:
- struct loader_instance *ptr_instance = loader_get_instance(instance);
- if (!ptr_instance->wsi_ggp_surface_enabled) {
- loader_log(ptr_instance, VULKAN_LOADER_ERROR_BIT, 0,
+ struct loader_instance *loader_inst = loader_get_instance(instance);
+ if (!loader_inst->wsi_ggp_surface_enabled) {
+ loader_log(loader_inst, VULKAN_LOADER_ERROR_BIT, 0,
"VK_GGP_stream_descriptor_surface extension not enabled. vkCreateStreamDescriptorSurfaceGGP not executed!\n");
vkRes = VK_ERROR_EXTENSION_NOT_PRESENT;
goto out;
}
// Next, if so, proceed with the implementation of this function:
- pIcdSurface = AllocateIcdSurfaceStruct(ptr_instance, sizeof(pIcdSurface->ggp_surf.base), sizeof(pIcdSurface->ggp_surf));
+ pIcdSurface = AllocateIcdSurfaceStruct(loader_inst, sizeof(pIcdSurface->ggp_surf.base), sizeof(pIcdSurface->ggp_surf));
if (pIcdSurface == NULL) {
vkRes = VK_ERROR_OUT_OF_HOST_MEMORY;
goto out;
pIcdSurface->ggp_surf.streamDescriptor = pCreateInfo->streamDescriptor;
// Loop through each ICD and determine if they need to create a surface
- for (struct loader_icd_term *icd_term = ptr_instance->icd_terms; icd_term != NULL; icd_term = icd_term->next, i++) {
+ for (struct loader_icd_term *icd_term = loader_inst->icd_terms; icd_term != NULL; icd_term = icd_term->next, i++) {
if (icd_term->scanned_icd->interface_version >= ICD_VER_SUPPORTS_ICD_SURFACE_KHR) {
if (NULL != icd_term->dispatch.CreateStreamDescriptorSurfaceGGP) {
vkRes = icd_term->dispatch.CreateStreamDescriptorSurfaceGGP(icd_term->instance, pCreateInfo, pAllocator,
if (VK_SUCCESS != vkRes && NULL != pIcdSurface) {
if (NULL != pIcdSurface->real_icd_surfaces) {
i = 0;
- for (struct loader_icd_term *icd_term = ptr_instance->icd_terms; icd_term != NULL; icd_term = icd_term->next, i++) {
+ for (struct loader_icd_term *icd_term = loader_inst->icd_terms; icd_term != NULL; icd_term = icd_term->next, i++) {
if ((VkSurfaceKHR)NULL != pIcdSurface->real_icd_surfaces[i] && NULL != icd_term->dispatch.DestroySurfaceKHR) {
icd_term->dispatch.DestroySurfaceKHR(icd_term->instance, pIcdSurface->real_icd_surfaces[i], pAllocator);
}
}
- loader_instance_heap_free(ptr_instance, pIcdSurface->real_icd_surfaces);
+ loader_instance_heap_free(loader_inst, pIcdSurface->real_icd_surfaces);
}
- loader_instance_heap_free(ptr_instance, pIcdSurface);
+ loader_instance_heap_free(loader_inst, pIcdSurface);
}
return vkRes;
}
const VkMetalSurfaceCreateInfoEXT *pCreateInfo,
const VkAllocationCallbacks *pAllocator,
VkSurfaceKHR *pSurface) {
- const VkLayerInstanceDispatchTable *disp;
- if (NULL == loader_get_instance(instance)) {
+ struct loader_instance *loader_inst = loader_get_instance(instance);
+ if (NULL == loader_inst) {
loader_log(NULL, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0,
"vkCreateMetalSurfaceEXT: Invalid instance [VUID-vkCreateMetalSurfaceEXT-instance-parameter]");
abort(); /* Intentionally fail so user can correct issue. */
}
- disp = loader_get_instance_layer_dispatch(instance);
- return disp->CreateMetalSurfaceEXT(instance, pCreateInfo, pAllocator, pSurface);
+ return loader_inst->disp->layer_inst_disp.CreateMetalSurfaceEXT(loader_inst->instance, pCreateInfo, pAllocator, pSurface);
}
VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateMetalSurfaceEXT(VkInstance instance, const VkMetalSurfaceCreateInfoEXT *pCreateInfo,
uint32_t i;
// First, check to ensure the appropriate extension was enabled:
- struct loader_instance *ptr_instance = loader_get_instance(instance);
- if (!ptr_instance->wsi_metal_surface_enabled) {
- loader_log(ptr_instance, VULKAN_LOADER_ERROR_BIT, 0,
+ struct loader_instance *loader_inst = loader_get_instance(instance);
+ if (!loader_inst->wsi_metal_surface_enabled) {
+ loader_log(loader_inst, VULKAN_LOADER_ERROR_BIT, 0,
"VK_EXT_metal_surface extension not enabled. vkCreateMetalSurfaceEXT will not be executed.\n");
}
// Next, if so, proceed with the implementation of this function:
- icd_surface = AllocateIcdSurfaceStruct(ptr_instance, sizeof(icd_surface->metal_surf.base), sizeof(icd_surface->metal_surf));
+ icd_surface = AllocateIcdSurfaceStruct(loader_inst, sizeof(icd_surface->metal_surf.base), sizeof(icd_surface->metal_surf));
if (icd_surface == NULL) {
result = VK_ERROR_OUT_OF_HOST_MEMORY;
goto out;
// Loop through each ICD and determine if they need to create a surface
i = 0;
- for (struct loader_icd_term *icd_term = ptr_instance->icd_terms; icd_term != NULL; icd_term = icd_term->next, ++i) {
+ for (struct loader_icd_term *icd_term = loader_inst->icd_terms; icd_term != NULL; icd_term = icd_term->next, ++i) {
if (icd_term->scanned_icd->interface_version >= ICD_VER_SUPPORTS_ICD_SURFACE_KHR) {
if (icd_term->dispatch.CreateMetalSurfaceEXT != NULL) {
result = icd_term->dispatch.CreateMetalSurfaceEXT(icd_term->instance, pCreateInfo, pAllocator,
if (result != VK_SUCCESS && icd_surface != NULL) {
if (icd_surface->real_icd_surfaces != NULL) {
i = 0;
- for (struct loader_icd_term *icd_term = ptr_instance->icd_terms; icd_term != NULL; icd_term = icd_term->next, ++i) {
+ for (struct loader_icd_term *icd_term = loader_inst->icd_terms; icd_term != NULL; icd_term = icd_term->next, ++i) {
if (icd_surface->real_icd_surfaces[i] == VK_NULL_HANDLE && icd_term->dispatch.DestroySurfaceKHR != NULL) {
icd_term->dispatch.DestroySurfaceKHR(icd_term->instance, icd_surface->real_icd_surfaces[i], pAllocator);
}
}
- loader_instance_heap_free(ptr_instance, icd_surface->real_icd_surfaces);
+ loader_instance_heap_free(loader_inst, icd_surface->real_icd_surfaces);
}
- loader_instance_heap_free(ptr_instance, icd_surface);
+ loader_instance_heap_free(loader_inst, icd_surface);
}
return result;
}
-#endif
+#endif // VK_USE_PLATFORM_METAL_EXT
#ifdef VK_USE_PLATFORM_SCREEN_QNX
const VkScreenSurfaceCreateInfoQNX *pCreateInfo,
const VkAllocationCallbacks *pAllocator,
VkSurfaceKHR *pSurface) {
- if (NULL == loader_get_instance(instance)) {
+ struct loader_instance *loader_inst = loader_get_instance(instance);
+ if (NULL == loader_inst) {
loader_log(NULL, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0,
"vkCreateScreenSurfaceQNX: Invalid instance [VUID-vkCreateScreenSurfaceQNX-instance-parameter]");
abort(); /* Intentionally fail so user can correct issue. */
}
- const VkLayerInstanceDispatchTable *disp = loader_get_instance_layer_dispatch(instance);
- VkResult res;
-
- res = disp->CreateScreenSurfaceQNX(instance, pCreateInfo, pAllocator, pSurface);
- return res;
+ return loader_inst->disp->layer_inst_disp.CreateScreenSurfaceQNX(loader_inst->instance, pCreateInfo, pAllocator, pSurface);
}
// This is the instance chain terminator function for CreateScreenSurfaceQNX
uint32_t i = 0;
// First, check to ensure the appropriate extension was enabled:
- struct loader_instance *ptr_instance = loader_get_instance(instance);
- if (!ptr_instance->wsi_screen_surface_enabled) {
- loader_log(ptr_instance, VULKAN_LOADER_ERROR_BIT, 0,
+ struct loader_instance *loader_inst = loader_get_instance(instance);
+ if (!loader_inst->wsi_screen_surface_enabled) {
+ loader_log(loader_inst, VULKAN_LOADER_ERROR_BIT, 0,
"VK_QNX_screen_surface extension not enabled. vkCreateScreenSurfaceQNX not executed!\n");
vkRes = VK_ERROR_EXTENSION_NOT_PRESENT;
goto out;
}
// Next, if so, proceed with the implementation of this function:
- pIcdSurface = AllocateIcdSurfaceStruct(ptr_instance, sizeof(pIcdSurface->screen_surf.base), sizeof(pIcdSurface->screen_surf));
+ pIcdSurface = AllocateIcdSurfaceStruct(loader_inst, sizeof(pIcdSurface->screen_surf.base), sizeof(pIcdSurface->screen_surf));
if (pIcdSurface == NULL) {
vkRes = VK_ERROR_OUT_OF_HOST_MEMORY;
goto out;
pIcdSurface->screen_surf.window = pCreateInfo->window;
// Loop through each ICD and determine if they need to create a surface
- for (struct loader_icd_term *icd_term = ptr_instance->icd_terms; icd_term != NULL; icd_term = icd_term->next, i++) {
+ for (struct loader_icd_term *icd_term = loader_inst->icd_terms; icd_term != NULL; icd_term = icd_term->next, i++) {
if (icd_term->scanned_icd->interface_version >= ICD_VER_SUPPORTS_ICD_SURFACE_KHR) {
if (NULL != icd_term->dispatch.CreateScreenSurfaceQNX) {
vkRes = icd_term->dispatch.CreateScreenSurfaceQNX(icd_term->instance, pCreateInfo, pAllocator,
if (VK_SUCCESS != vkRes && NULL != pIcdSurface) {
if (NULL != pIcdSurface->real_icd_surfaces) {
i = 0;
- for (struct loader_icd_term *icd_term = ptr_instance->icd_terms; icd_term != NULL; icd_term = icd_term->next, i++) {
+ for (struct loader_icd_term *icd_term = loader_inst->icd_terms; icd_term != NULL; icd_term = icd_term->next, i++) {
if ((VkSurfaceKHR)NULL != pIcdSurface->real_icd_surfaces[i] && NULL != icd_term->dispatch.DestroySurfaceKHR) {
icd_term->dispatch.DestroySurfaceKHR(icd_term->instance, pIcdSurface->real_icd_surfaces[i], pAllocator);
}
}
- loader_instance_heap_free(ptr_instance, pIcdSurface->real_icd_surfaces);
+ loader_instance_heap_free(loader_inst, pIcdSurface->real_icd_surfaces);
}
- loader_instance_heap_free(ptr_instance, pIcdSurface);
+ loader_instance_heap_free(loader_inst, pIcdSurface);
}
return vkRes;
// First, check to ensure the appropriate extension was enabled:
struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice;
struct loader_icd_term *icd_term = phys_dev_term->this_icd_term;
- struct loader_instance *ptr_instance = (struct loader_instance *)icd_term->this_instance;
- if (!ptr_instance->wsi_screen_surface_enabled) {
- loader_log(ptr_instance, VULKAN_LOADER_ERROR_BIT, 0,
+ struct loader_instance *loader_inst = (struct loader_instance *)icd_term->this_instance;
+ if (!loader_inst->wsi_screen_surface_enabled) {
+ loader_log(loader_inst, VULKAN_LOADER_ERROR_BIT, 0,
"VK_QNX_screen_surface extension not enabled. vkGetPhysicalDeviceScreenPresentationSupportQNX not executed!\n");
return VK_SUCCESS;
}
if (NULL == icd_term->dispatch.GetPhysicalDeviceScreenPresentationSupportQNX) {
- loader_log(ptr_instance, VULKAN_LOADER_ERROR_BIT, 0,
+ loader_log(loader_inst, VULKAN_LOADER_ERROR_BIT, 0,
"ICD for selected physical device is not exporting vkGetPhysicalDeviceScreenPresentationSupportQNX!\n");
abort();
}
// First, check to ensure the appropriate extension was enabled:
struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice;
struct loader_icd_term *icd_term = phys_dev_term->this_icd_term;
- struct loader_instance *ptr_instance = (struct loader_instance *)icd_term->this_instance;
- if (!ptr_instance->wsi_display_enabled) {
- loader_log(ptr_instance, VULKAN_LOADER_ERROR_BIT, 0,
+ struct loader_instance *loader_inst = (struct loader_instance *)icd_term->this_instance;
+ if (!loader_inst->wsi_display_enabled) {
+ loader_log(loader_inst, VULKAN_LOADER_ERROR_BIT, 0,
"VK_KHR_display extension not enabled. vkGetPhysicalDeviceDisplayPropertiesKHR not executed!\n");
return VK_SUCCESS;
}
// First, check to ensure the appropriate extension was enabled:
struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice;
struct loader_icd_term *icd_term = phys_dev_term->this_icd_term;
- struct loader_instance *ptr_instance = (struct loader_instance *)icd_term->this_instance;
- if (!ptr_instance->wsi_display_enabled) {
- loader_log(ptr_instance, VULKAN_LOADER_ERROR_BIT, 0,
+ struct loader_instance *loader_inst = (struct loader_instance *)icd_term->this_instance;
+ if (!loader_inst->wsi_display_enabled) {
+ loader_log(loader_inst, VULKAN_LOADER_ERROR_BIT, 0,
"VK_KHR_display extension not enabled. vkGetPhysicalDeviceDisplayPlanePropertiesKHR not executed!\n");
return VK_SUCCESS;
}
// First, check to ensure the appropriate extension was enabled:
struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice;
struct loader_icd_term *icd_term = phys_dev_term->this_icd_term;
- struct loader_instance *ptr_instance = (struct loader_instance *)icd_term->this_instance;
- if (!ptr_instance->wsi_display_enabled) {
- loader_log(ptr_instance, VULKAN_LOADER_ERROR_BIT, 0,
+ struct loader_instance *loader_inst = (struct loader_instance *)icd_term->this_instance;
+ if (!loader_inst->wsi_display_enabled) {
+ loader_log(loader_inst, VULKAN_LOADER_ERROR_BIT, 0,
"VK_KHR_display extension not enabled. vkGetDisplayPlaneSupportedDisplaysKHR not executed!\n");
return VK_SUCCESS;
}
if (NULL == icd_term->dispatch.GetDisplayPlaneSupportedDisplaysKHR) {
- loader_log(ptr_instance, VULKAN_LOADER_ERROR_BIT, 0,
+ loader_log(loader_inst, VULKAN_LOADER_ERROR_BIT, 0,
"ICD for selected physical device is not exporting vkGetDisplayPlaneSupportedDisplaysKHR!\n");
abort();
}
// First, check to ensure the appropriate extension was enabled:
struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice;
struct loader_icd_term *icd_term = phys_dev_term->this_icd_term;
- struct loader_instance *ptr_instance = (struct loader_instance *)icd_term->this_instance;
- if (!ptr_instance->wsi_display_enabled) {
- loader_log(ptr_instance, VULKAN_LOADER_ERROR_BIT, 0,
+ struct loader_instance *loader_inst = (struct loader_instance *)icd_term->this_instance;
+ if (!loader_inst->wsi_display_enabled) {
+ loader_log(loader_inst, VULKAN_LOADER_ERROR_BIT, 0,
"VK_KHR_display extension not enabled. vkGetDisplayModePropertiesKHR not executed!\n");
return VK_SUCCESS;
}
if (NULL == icd_term->dispatch.GetDisplayModePropertiesKHR) {
- loader_log(ptr_instance, VULKAN_LOADER_ERROR_BIT, 0,
+ loader_log(loader_inst, VULKAN_LOADER_ERROR_BIT, 0,
"ICD for selected physical device is not exporting vkGetDisplayModePropertiesKHR!\n");
abort();
}
// First, check to ensure the appropriate extension was enabled:
struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice;
struct loader_icd_term *icd_term = phys_dev_term->this_icd_term;
- struct loader_instance *ptr_instance = (struct loader_instance *)icd_term->this_instance;
- if (!ptr_instance->wsi_display_enabled) {
- loader_log(ptr_instance, VULKAN_LOADER_ERROR_BIT, 0,
+ struct loader_instance *loader_inst = (struct loader_instance *)icd_term->this_instance;
+ if (!loader_inst->wsi_display_enabled) {
+ loader_log(loader_inst, VULKAN_LOADER_ERROR_BIT, 0,
"VK_KHR_display extension not enabled. vkCreateDisplayModeKHR not executed!\n");
return VK_ERROR_EXTENSION_NOT_PRESENT;
}
if (NULL == icd_term->dispatch.CreateDisplayModeKHR) {
- loader_log(ptr_instance, VULKAN_LOADER_ERROR_BIT, 0,
+ loader_log(loader_inst, VULKAN_LOADER_ERROR_BIT, 0,
"ICD for selected physical device is not exporting vkCreateDisplayModeKHR!\n");
abort();
}
// First, check to ensure the appropriate extension was enabled:
struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice;
struct loader_icd_term *icd_term = phys_dev_term->this_icd_term;
- struct loader_instance *ptr_instance = (struct loader_instance *)icd_term->this_instance;
- if (!ptr_instance->wsi_display_enabled) {
- loader_log(ptr_instance, VULKAN_LOADER_ERROR_BIT, 0,
+ struct loader_instance *loader_inst = (struct loader_instance *)icd_term->this_instance;
+ if (!loader_inst->wsi_display_enabled) {
+ loader_log(loader_inst, VULKAN_LOADER_ERROR_BIT, 0,
"VK_KHR_display extension not enabled. vkGetDisplayPlaneCapabilitiesKHR not executed!\n");
return VK_SUCCESS;
}
if (NULL == icd_term->dispatch.GetDisplayPlaneCapabilitiesKHR) {
- loader_log(ptr_instance, VULKAN_LOADER_ERROR_BIT, 0,
+ loader_log(loader_inst, VULKAN_LOADER_ERROR_BIT, 0,
"ICD for selected physical device is not exporting vkGetDisplayPlaneCapabilitiesKHR!\n");
abort();
}
const VkDisplaySurfaceCreateInfoKHR *pCreateInfo,
const VkAllocationCallbacks *pAllocator,
VkSurfaceKHR *pSurface) {
- const VkLayerInstanceDispatchTable *disp;
- if (NULL == loader_get_instance(instance)) {
+ struct loader_instance *loader_inst = loader_get_instance(instance);
+ if (NULL == loader_inst) {
loader_log(NULL, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0,
"vkCreateDisplayPlaneSurfaceKHR: Invalid instance [VUID-vkCreateDisplayPlaneSurfaceKHR-instance-parameter]");
abort(); /* Intentionally fail so user can correct issue. */
}
- disp = loader_get_instance_layer_dispatch(instance);
- VkResult res;
-
- res = disp->CreateDisplayPlaneSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface);
- return res;
+ return loader_inst->disp->layer_inst_disp.CreateDisplayPlaneSurfaceKHR(loader_inst->instance, pCreateInfo, pAllocator,
+ pSurface);
}
VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateDisplayPlaneSurfaceKHR(VkInstance instance,
const VkImagePipeSurfaceCreateInfoFUCHSIA *pCreateInfo,
const VkAllocationCallbacks *pAllocator,
VkSurfaceKHR *pSurface) {
- const VkLayerInstanceDispatchTable *disp;
- if (NULL == loader_get_instance(instance)) {
+ struct loader_instance *loader_inst = loader_get_instance(instance);
+ if (NULL == loader_inst) {
loader_log(NULL, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0,
"vkCreateImagePipeSurfaceFUCHSIA: Invalid instance [VUID-vkCreateImagePipeSurfaceFUCHSIA-instance-parameter]");
abort(); /* Intentionally fail so user can correct issue. */
}
- disp = loader_get_instance_layer_dispatch(instance);
- VkResult res;
-
- res = disp->CreateImagePipeSurfaceFUCHSIA(instance, pCreateInfo, pAllocator, pSurface);
- return res;
+ return loader_inst->disp->layer_inst_disp.CreateImagePipeSurfaceFUCHSIA(loader_inst->instance, pCreateInfo, pAllocator,
+ pSurface);
}
// This is the instance chain terminator function for CreateImagePipeSurfaceFUCHSIA
// Initialize pSurface to NULL just to be safe.
*pSurface = VK_NULL_HANDLE;
// First, check to ensure the appropriate extension was enabled:
- struct loader_instance *ptr_instance = loader_get_instance(instance);
- if (!ptr_instance->wsi_imagepipe_surface_enabled) {
- loader_log(ptr_instance, VULKAN_LOADER_ERROR_BIT, 0,
+ struct loader_instance *loader_inst = loader_get_instance(instance);
+ if (!loader_inst->wsi_imagepipe_surface_enabled) {
+ loader_log(loader_inst, VULKAN_LOADER_ERROR_BIT, 0,
"VK_FUCHSIA_imagepipe_surface extension not enabled. "
"vkCreateImagePipeSurfaceFUCHSIA not executed!\n");
vkRes = VK_ERROR_EXTENSION_NOT_PRESENT;
// Next, if so, proceed with the implementation of this function:
pIcdSurface =
- AllocateIcdSurfaceStruct(ptr_instance, sizeof(pIcdSurface->imagepipe_surf.base), sizeof(pIcdSurface->imagepipe_surf));
+ AllocateIcdSurfaceStruct(loader_inst, sizeof(pIcdSurface->imagepipe_surf.base), sizeof(pIcdSurface->imagepipe_surf));
if (pIcdSurface == NULL) {
vkRes = VK_ERROR_OUT_OF_HOST_MEMORY;
goto out;
pIcdSurface->imagepipe_surf.base.platform = VK_ICD_WSI_PLATFORM_FUCHSIA;
// Loop through each ICD and determine if they need to create a surface
- for (struct loader_icd_term *icd_term = ptr_instance->icd_terms; icd_term != NULL; icd_term = icd_term->next, i++) {
+ for (struct loader_icd_term *icd_term = loader_inst->icd_terms; icd_term != NULL; icd_term = icd_term->next, i++) {
if (icd_term->scanned_icd->interface_version >= ICD_VER_SUPPORTS_ICD_SURFACE_KHR) {
if (NULL != icd_term->dispatch.CreateImagePipeSurfaceFUCHSIA) {
vkRes = icd_term->dispatch.CreateImagePipeSurfaceFUCHSIA(icd_term->instance, pCreateInfo, pAllocator,
if (VK_SUCCESS != vkRes && NULL != pIcdSurface) {
if (NULL != pIcdSurface->real_icd_surfaces) {
i = 0;
- for (struct loader_icd_term *icd_term = ptr_instance->icd_terms; icd_term != NULL; icd_term = icd_term->next, i++) {
+ for (struct loader_icd_term *icd_term = loader_inst->icd_terms; icd_term != NULL; icd_term = icd_term->next, i++) {
if ((VkSurfaceKHR)NULL != pIcdSurface->real_icd_surfaces[i] && NULL != icd_term->dispatch.DestroySurfaceKHR) {
icd_term->dispatch.DestroySurfaceKHR(icd_term->instance, pIcdSurface->real_icd_surfaces[i], pAllocator);
}
}
- loader_instance_heap_free(ptr_instance, pIcdSurface->real_icd_surfaces);
+ loader_instance_heap_free(loader_inst, pIcdSurface->real_icd_surfaces);
}
- loader_instance_heap_free(ptr_instance, pIcdSurface);
+ loader_instance_heap_free(loader_inst, pIcdSurface);
}
return vkRes;
VkSurfaceCapabilities2KHR *pSurfaceCapabilities) {
struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice;
struct loader_icd_term *icd_term = phys_dev_term->this_icd_term;
- struct loader_instance *ptr_instance = (struct loader_instance *)icd_term->this_instance;
+ struct loader_instance *loader_inst = (struct loader_instance *)icd_term->this_instance;
- if (!ptr_instance->wsi_surface_enabled) {
- loader_log(ptr_instance, VULKAN_LOADER_ERROR_BIT, 0,
+ if (!loader_inst->wsi_surface_enabled) {
+ loader_log(loader_inst, VULKAN_LOADER_ERROR_BIT, 0,
"VK_KHR_surface extension not enabled. vkGetPhysicalDeviceSurfaceCapabilities2KHR not executed!\n");
return VK_SUCCESS;
}
VkSurfaceFormat2KHR *pSurfaceFormats) {
struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice;
struct loader_icd_term *icd_term = phys_dev_term->this_icd_term;
- struct loader_instance *ptr_instance = (struct loader_instance *)icd_term->this_instance;
+ struct loader_instance *loader_inst = (struct loader_instance *)icd_term->this_instance;
- if (!ptr_instance->wsi_surface_enabled) {
- loader_log(ptr_instance, VULKAN_LOADER_ERROR_BIT, 0,
+ if (!loader_inst->wsi_surface_enabled) {
+ loader_log(loader_inst, VULKAN_LOADER_ERROR_BIT, 0,
"VK_KHR_surface extension not enabled. vkGetPhysicalDeviceSurfaceFormats2KHR not executed!\n");
return VK_SUCCESS;
}
}
}
-bool wsi_swapchain_instance_gpa(struct loader_instance *ptr_instance, const char *name, void **addr) {
+bool wsi_swapchain_instance_gpa(struct loader_instance *loader_inst, const char *name, void **addr) {
*addr = NULL;
// Functions for the VK_KHR_surface extension:
if (!strcmp("vkDestroySurfaceKHR", name)) {
- *addr = ptr_instance->wsi_surface_enabled ? (void *)vkDestroySurfaceKHR : NULL;
+ *addr = loader_inst->wsi_surface_enabled ? (void *)vkDestroySurfaceKHR : NULL;
return true;
}
if (!strcmp("vkGetPhysicalDeviceSurfaceSupportKHR", name)) {
- *addr = ptr_instance->wsi_surface_enabled ? (void *)vkGetPhysicalDeviceSurfaceSupportKHR : NULL;
+ *addr = loader_inst->wsi_surface_enabled ? (void *)vkGetPhysicalDeviceSurfaceSupportKHR : NULL;
return true;
}
if (!strcmp("vkGetPhysicalDeviceSurfaceCapabilitiesKHR", name)) {
- *addr = ptr_instance->wsi_surface_enabled ? (void *)vkGetPhysicalDeviceSurfaceCapabilitiesKHR : NULL;
+ *addr = loader_inst->wsi_surface_enabled ? (void *)vkGetPhysicalDeviceSurfaceCapabilitiesKHR : NULL;
return true;
}
if (!strcmp("vkGetPhysicalDeviceSurfaceFormatsKHR", name)) {
- *addr = ptr_instance->wsi_surface_enabled ? (void *)vkGetPhysicalDeviceSurfaceFormatsKHR : NULL;
+ *addr = loader_inst->wsi_surface_enabled ? (void *)vkGetPhysicalDeviceSurfaceFormatsKHR : NULL;
return true;
}
if (!strcmp("vkGetPhysicalDeviceSurfacePresentModesKHR", name)) {
- *addr = ptr_instance->wsi_surface_enabled ? (void *)vkGetPhysicalDeviceSurfacePresentModesKHR : NULL;
+ *addr = loader_inst->wsi_surface_enabled ? (void *)vkGetPhysicalDeviceSurfacePresentModesKHR : NULL;
return true;
}
if (!strcmp("vkGetDeviceGroupPresentCapabilitiesKHR", name)) {
- *addr = ptr_instance->wsi_surface_enabled ? (void *)vkGetDeviceGroupPresentCapabilitiesKHR : NULL;
+ *addr = loader_inst->wsi_surface_enabled ? (void *)vkGetDeviceGroupPresentCapabilitiesKHR : NULL;
return true;
}
if (!strcmp("vkGetDeviceGroupSurfacePresentModesKHR", name)) {
- *addr = ptr_instance->wsi_surface_enabled ? (void *)vkGetDeviceGroupSurfacePresentModesKHR : NULL;
+ *addr = loader_inst->wsi_surface_enabled ? (void *)vkGetDeviceGroupSurfacePresentModesKHR : NULL;
return true;
}
if (!strcmp("vkGetPhysicalDevicePresentRectanglesKHR", name)) {
- *addr = ptr_instance->wsi_surface_enabled ? (void *)vkGetPhysicalDevicePresentRectanglesKHR : NULL;
+ *addr = loader_inst->wsi_surface_enabled ? (void *)vkGetPhysicalDevicePresentRectanglesKHR : NULL;
return true;
}
// Functions for VK_KHR_get_surface_capabilities2 extension:
if (!strcmp("vkGetPhysicalDeviceSurfaceCapabilities2KHR", name)) {
- *addr = ptr_instance->wsi_surface_enabled ? (void *)vkGetPhysicalDeviceSurfaceCapabilities2KHR : NULL;
+ *addr = loader_inst->wsi_surface_enabled ? (void *)vkGetPhysicalDeviceSurfaceCapabilities2KHR : NULL;
return true;
}
if (!strcmp("vkGetPhysicalDeviceSurfaceFormats2KHR", name)) {
- *addr = ptr_instance->wsi_surface_enabled ? (void *)vkGetPhysicalDeviceSurfaceFormats2KHR : NULL;
+ *addr = loader_inst->wsi_surface_enabled ? (void *)vkGetPhysicalDeviceSurfaceFormats2KHR : NULL;
return true;
}
// Functions for the VK_KHR_win32_surface extension:
if (!strcmp("vkCreateWin32SurfaceKHR", name)) {
- *addr = ptr_instance->wsi_win32_surface_enabled ? (void *)vkCreateWin32SurfaceKHR : NULL;
+ *addr = loader_inst->wsi_win32_surface_enabled ? (void *)vkCreateWin32SurfaceKHR : NULL;
return true;
}
if (!strcmp("vkGetPhysicalDeviceWin32PresentationSupportKHR", name)) {
- *addr = ptr_instance->wsi_win32_surface_enabled ? (void *)vkGetPhysicalDeviceWin32PresentationSupportKHR : NULL;
+ *addr = loader_inst->wsi_win32_surface_enabled ? (void *)vkGetPhysicalDeviceWin32PresentationSupportKHR : NULL;
return true;
}
#endif // VK_USE_PLATFORM_WIN32_KHR
// Functions for the VK_KHR_wayland_surface extension:
if (!strcmp("vkCreateWaylandSurfaceKHR", name)) {
- *addr = ptr_instance->wsi_wayland_surface_enabled ? (void *)vkCreateWaylandSurfaceKHR : NULL;
+ *addr = loader_inst->wsi_wayland_surface_enabled ? (void *)vkCreateWaylandSurfaceKHR : NULL;
return true;
}
if (!strcmp("vkGetPhysicalDeviceWaylandPresentationSupportKHR", name)) {
- *addr = ptr_instance->wsi_wayland_surface_enabled ? (void *)vkGetPhysicalDeviceWaylandPresentationSupportKHR : NULL;
+ *addr = loader_inst->wsi_wayland_surface_enabled ? (void *)vkGetPhysicalDeviceWaylandPresentationSupportKHR : NULL;
return true;
}
#endif // VK_USE_PLATFORM_WAYLAND_KHR
// Functions for the VK_KHR_xcb_surface extension:
if (!strcmp("vkCreateXcbSurfaceKHR", name)) {
- *addr = ptr_instance->wsi_xcb_surface_enabled ? (void *)vkCreateXcbSurfaceKHR : NULL;
+ *addr = loader_inst->wsi_xcb_surface_enabled ? (void *)vkCreateXcbSurfaceKHR : NULL;
return true;
}
if (!strcmp("vkGetPhysicalDeviceXcbPresentationSupportKHR", name)) {
- *addr = ptr_instance->wsi_xcb_surface_enabled ? (void *)vkGetPhysicalDeviceXcbPresentationSupportKHR : NULL;
+ *addr = loader_inst->wsi_xcb_surface_enabled ? (void *)vkGetPhysicalDeviceXcbPresentationSupportKHR : NULL;
return true;
}
#endif // VK_USE_PLATFORM_XCB_KHR
// Functions for the VK_KHR_xlib_surface extension:
if (!strcmp("vkCreateXlibSurfaceKHR", name)) {
- *addr = ptr_instance->wsi_xlib_surface_enabled ? (void *)vkCreateXlibSurfaceKHR : NULL;
+ *addr = loader_inst->wsi_xlib_surface_enabled ? (void *)vkCreateXlibSurfaceKHR : NULL;
return true;
}
if (!strcmp("vkGetPhysicalDeviceXlibPresentationSupportKHR", name)) {
- *addr = ptr_instance->wsi_xlib_surface_enabled ? (void *)vkGetPhysicalDeviceXlibPresentationSupportKHR : NULL;
+ *addr = loader_inst->wsi_xlib_surface_enabled ? (void *)vkGetPhysicalDeviceXlibPresentationSupportKHR : NULL;
return true;
}
#endif // VK_USE_PLATFORM_XLIB_KHR
// Functions for the VK_EXT_directfb_surface extension:
if (!strcmp("vkCreateDirectFBSurfaceEXT", name)) {
- *addr = ptr_instance->wsi_directfb_surface_enabled ? (void *)vkCreateDirectFBSurfaceEXT : NULL;
+ *addr = loader_inst->wsi_directfb_surface_enabled ? (void *)vkCreateDirectFBSurfaceEXT : NULL;
return true;
}
if (!strcmp("vkGetPhysicalDeviceDirectFBPresentationSupportEXT", name)) {
- *addr = ptr_instance->wsi_directfb_surface_enabled ? (void *)vkGetPhysicalDeviceDirectFBPresentationSupportEXT : NULL;
+ *addr = loader_inst->wsi_directfb_surface_enabled ? (void *)vkGetPhysicalDeviceDirectFBPresentationSupportEXT : NULL;
return true;
}
#endif // VK_USE_PLATFORM_DIRECTFB_EXT
// Functions for the VK_KHR_android_surface extension:
if (!strcmp("vkCreateAndroidSurfaceKHR", name)) {
- *addr = ptr_instance->wsi_android_surface_enabled ? (void *)vkCreateAndroidSurfaceKHR : NULL;
+ *addr = loader_inst->wsi_android_surface_enabled ? (void *)vkCreateAndroidSurfaceKHR : NULL;
return true;
}
#endif // VK_USE_PLATFORM_ANDROID_KHR
// Functions for the VK_MVK_macos_surface extension:
if (!strcmp("vkCreateMacOSSurfaceMVK", name)) {
- *addr = ptr_instance->wsi_macos_surface_enabled ? (void *)vkCreateMacOSSurfaceMVK : NULL;
+ *addr = loader_inst->wsi_macos_surface_enabled ? (void *)vkCreateMacOSSurfaceMVK : NULL;
return true;
}
#endif // VK_USE_PLATFORM_MACOS_MVK
// Functions for the VK_MVK_ios_surface extension:
if (!strcmp("vkCreateIOSSurfaceMVK", name)) {
- *addr = ptr_instance->wsi_ios_surface_enabled ? (void *)vkCreateIOSSurfaceMVK : NULL;
+ *addr = loader_inst->wsi_ios_surface_enabled ? (void *)vkCreateIOSSurfaceMVK : NULL;
return true;
}
#endif // VK_USE_PLATFORM_IOS_MVK
// Functions for the VK_GGP_stream_descriptor_surface extension:
if (!strcmp("vkCreateStreamDescriptorSurfaceGGP", name)) {
- *addr = ptr_instance->wsi_ggp_surface_enabled ? (void *)vkCreateStreamDescriptorSurfaceGGP : NULL;
+ *addr = loader_inst->wsi_ggp_surface_enabled ? (void *)vkCreateStreamDescriptorSurfaceGGP : NULL;
return true;
}
#endif // VK_USE_PLATFORM_GGP
// Functions for the VK_FUCHSIA_imagepipe_surface extension:
if (!strcmp("vkCreateImagePipeSurfaceFUCHSIA", name)) {
- *addr = ptr_instance->wsi_imagepipe_surface_enabled ? (void *)vkCreateImagePipeSurfaceFUCHSIA : NULL;
+ *addr = loader_inst->wsi_imagepipe_surface_enabled ? (void *)vkCreateImagePipeSurfaceFUCHSIA : NULL;
return true;
}
// Functions for the VK_EXT_headless_surface extension:
if (!strcmp("vkCreateHeadlessSurfaceEXT", name)) {
- *addr = ptr_instance->wsi_headless_surface_enabled ? (void *)vkCreateHeadlessSurfaceEXT : NULL;
+ *addr = loader_inst->wsi_headless_surface_enabled ? (void *)vkCreateHeadlessSurfaceEXT : NULL;
return true;
}
#if defined(VK_USE_PLATFORM_METAL_EXT)
// Functions for the VK_MVK_macos_surface extension:
if (!strcmp("vkCreateMetalSurfaceEXT", name)) {
- *addr = ptr_instance->wsi_metal_surface_enabled ? (void *)vkCreateMetalSurfaceEXT : NULL;
+ *addr = loader_inst->wsi_metal_surface_enabled ? (void *)vkCreateMetalSurfaceEXT : NULL;
return true;
}
#endif // VK_USE_PLATFORM_METAL_EXT
// Functions for the VK_QNX_screen_surface extension:
if (!strcmp("vkCreateScreenSurfaceQNX", name)) {
- *addr = ptr_instance->wsi_screen_surface_enabled ? (void *)vkCreateScreenSurfaceQNX : NULL;
+ *addr = loader_inst->wsi_screen_surface_enabled ? (void *)vkCreateScreenSurfaceQNX : NULL;
return true;
}
if (!strcmp("vkGetPhysicalDeviceScreenPresentationSupportQNX", name)) {
- *addr = ptr_instance->wsi_screen_surface_enabled ? (void *)vkGetPhysicalDeviceScreenPresentationSupportQNX : NULL;
+ *addr = loader_inst->wsi_screen_surface_enabled ? (void *)vkGetPhysicalDeviceScreenPresentationSupportQNX : NULL;
return true;
}
#endif // VK_USE_PLATFORM_SCREEN_QNX
// Functions for VK_KHR_display extension:
if (!strcmp("vkGetPhysicalDeviceDisplayPropertiesKHR", name)) {
- *addr = ptr_instance->wsi_display_enabled ? (void *)vkGetPhysicalDeviceDisplayPropertiesKHR : NULL;
+ *addr = loader_inst->wsi_display_enabled ? (void *)vkGetPhysicalDeviceDisplayPropertiesKHR : NULL;
return true;
}
if (!strcmp("vkGetPhysicalDeviceDisplayPlanePropertiesKHR", name)) {
- *addr = ptr_instance->wsi_display_enabled ? (void *)vkGetPhysicalDeviceDisplayPlanePropertiesKHR : NULL;
+ *addr = loader_inst->wsi_display_enabled ? (void *)vkGetPhysicalDeviceDisplayPlanePropertiesKHR : NULL;
return true;
}
if (!strcmp("vkGetDisplayPlaneSupportedDisplaysKHR", name)) {
- *addr = ptr_instance->wsi_display_enabled ? (void *)vkGetDisplayPlaneSupportedDisplaysKHR : NULL;
+ *addr = loader_inst->wsi_display_enabled ? (void *)vkGetDisplayPlaneSupportedDisplaysKHR : NULL;
return true;
}
if (!strcmp("vkGetDisplayModePropertiesKHR", name)) {
- *addr = ptr_instance->wsi_display_enabled ? (void *)vkGetDisplayModePropertiesKHR : NULL;
+ *addr = loader_inst->wsi_display_enabled ? (void *)vkGetDisplayModePropertiesKHR : NULL;
return true;
}
if (!strcmp("vkCreateDisplayModeKHR", name)) {
- *addr = ptr_instance->wsi_display_enabled ? (void *)vkCreateDisplayModeKHR : NULL;
+ *addr = loader_inst->wsi_display_enabled ? (void *)vkCreateDisplayModeKHR : NULL;
return true;
}
if (!strcmp("vkGetDisplayPlaneCapabilitiesKHR", name)) {
- *addr = ptr_instance->wsi_display_enabled ? (void *)vkGetDisplayPlaneCapabilitiesKHR : NULL;
+ *addr = loader_inst->wsi_display_enabled ? (void *)vkGetDisplayPlaneCapabilitiesKHR : NULL;
return true;
}
if (!strcmp("vkCreateDisplayPlaneSurfaceKHR", name)) {
- *addr = ptr_instance->wsi_display_enabled ? (void *)vkCreateDisplayPlaneSurfaceKHR : NULL;
+ *addr = loader_inst->wsi_display_enabled ? (void *)vkCreateDisplayPlaneSurfaceKHR : NULL;
return true;
}
// Functions for KHR_get_display_properties2
if (!strcmp("vkGetPhysicalDeviceDisplayProperties2KHR", name)) {
- *addr = ptr_instance->wsi_display_props2_enabled ? (void *)vkGetPhysicalDeviceDisplayProperties2KHR : NULL;
+ *addr = loader_inst->wsi_display_props2_enabled ? (void *)vkGetPhysicalDeviceDisplayProperties2KHR : NULL;
return true;
}
if (!strcmp("vkGetPhysicalDeviceDisplayPlaneProperties2KHR", name)) {
- *addr = ptr_instance->wsi_display_props2_enabled ? (void *)vkGetPhysicalDeviceDisplayPlaneProperties2KHR : NULL;
+ *addr = loader_inst->wsi_display_props2_enabled ? (void *)vkGetPhysicalDeviceDisplayPlaneProperties2KHR : NULL;
return true;
}
if (!strcmp("vkGetDisplayModeProperties2KHR", name)) {
- *addr = ptr_instance->wsi_display_props2_enabled ? (void *)vkGetDisplayModeProperties2KHR : NULL;
+ *addr = loader_inst->wsi_display_props2_enabled ? (void *)vkGetDisplayModeProperties2KHR : NULL;
return true;
}
if (!strcmp("vkGetDisplayPlaneCapabilities2KHR", name)) {
- *addr = ptr_instance->wsi_display_props2_enabled ? (void *)vkGetDisplayPlaneCapabilities2KHR : NULL;
+ *addr = loader_inst->wsi_display_props2_enabled ? (void *)vkGetDisplayPlaneCapabilities2KHR : NULL;
return true;
}
delete inst;
}
+VKAPI_ATTR VkResult VKAPI_CALL wrap_vkCreateDebugUtilsMessengerEXT(VkInstance instance,
+ const VkDebugUtilsMessengerCreateInfoEXT *pCreateInfo,
+ const VkAllocationCallbacks *pAllocator,
+ VkDebugUtilsMessengerEXT *pMessenger) {
+ wrapped_inst_obj *inst;
+ auto vk_inst = unwrap_instance(instance, &inst);
+ VkLayerInstanceDispatchTable *pDisp = &inst->layer_disp;
+ return pDisp->CreateDebugUtilsMessengerEXT(vk_inst, pCreateInfo, pAllocator, pMessenger);
+}
+
+VKAPI_ATTR void VKAPI_CALL wrap_vkDestroyDebugUtilsMessengerEXT(VkInstance instance, VkDebugUtilsMessengerEXT messenger,
+ const VkAllocationCallbacks *pAllocator) {
+ wrapped_inst_obj *inst;
+ auto vk_inst = unwrap_instance(instance, &inst);
+ VkLayerInstanceDispatchTable *pDisp = &inst->layer_disp;
+ pDisp->DestroyDebugUtilsMessengerEXT(vk_inst, messenger, pAllocator);
+}
+
+VKAPI_ATTR void VKAPI_CALL wrap_vkDestroySurfaceKHR(VkInstance instance, VkSurfaceKHR surface,
+ const VkAllocationCallbacks *pAllocator) {
+ wrapped_inst_obj *inst;
+ auto vk_inst = unwrap_instance(instance, &inst);
+ VkLayerInstanceDispatchTable *pDisp = &inst->layer_disp;
+ pDisp->DestroySurfaceKHR(vk_inst, surface, pAllocator);
+}
+#ifdef VK_USE_PLATFORM_ANDROID_KHR
+VKAPI_ATTR VkResult VKAPI_CALL wrap_vkCreateAndroidSurfaceKHR(VkInstance instance, const VkAndroidSurfaceCreateInfoKHR *pCreateInfo,
+ const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface) {
+ wrapped_inst_obj *inst;
+ auto vk_inst = unwrap_instance(instance, &inst);
+ VkLayerInstanceDispatchTable *pDisp = &inst->layer_disp;
+ return pDisp->CreateAndroidSurfaceKHR(vk_inst, pCreateInfo, pAllocator, pSurface);
+}
+#endif
+
+#ifdef VK_USE_PLATFORM_WIN32_KHR
+VKAPI_ATTR VkResult VKAPI_CALL wrap_vkCreateWin32SurfaceKHR(VkInstance instance, const VkWin32SurfaceCreateInfoKHR *pCreateInfo,
+ const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface) {
+ wrapped_inst_obj *inst;
+ auto vk_inst = unwrap_instance(instance, &inst);
+ VkLayerInstanceDispatchTable *pDisp = &inst->layer_disp;
+ return pDisp->CreateWin32SurfaceKHR(vk_inst, pCreateInfo, pAllocator, pSurface);
+}
+#endif // VK_USE_PLATFORM_WIN32_KHR
+
+#ifdef VK_USE_PLATFORM_WAYLAND_KHR
+VKAPI_ATTR VkResult VKAPI_CALL wrap_vkCreateWaylandSurfaceKHR(VkInstance instance, const VkWaylandSurfaceCreateInfoKHR *pCreateInfo,
+ const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface) {
+ wrapped_inst_obj *inst;
+ auto vk_inst = unwrap_instance(instance, &inst);
+ VkLayerInstanceDispatchTable *pDisp = &inst->layer_disp;
+ return pDisp->CreateWaylandSurfaceKHR(vk_inst, pCreateInfo, pAllocator, pSurface);
+}
+#endif // VK_USE_PLATFORM_WAYLAND_KHR
+
+#ifdef VK_USE_PLATFORM_XCB_KHR
+VKAPI_ATTR VkResult VKAPI_CALL wrap_vkCreateXcbSurfaceKHR(VkInstance instance, const VkXcbSurfaceCreateInfoKHR *pCreateInfo,
+ const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface) {
+ wrapped_inst_obj *inst;
+ auto vk_inst = unwrap_instance(instance, &inst);
+ VkLayerInstanceDispatchTable *pDisp = &inst->layer_disp;
+ return pDisp->CreateXcbSurfaceKHR(vk_inst, pCreateInfo, pAllocator, pSurface);
+}
+#endif // VK_USE_PLATFORM_XCB_KHR
+
+#ifdef VK_USE_PLATFORM_XLIB_KHR
+VKAPI_ATTR VkResult VKAPI_CALL wrap_vkCreateXlibSurfaceKHR(VkInstance instance, const VkXlibSurfaceCreateInfoKHR *pCreateInfo,
+ const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface) {
+ wrapped_inst_obj *inst;
+ auto vk_inst = unwrap_instance(instance, &inst);
+ VkLayerInstanceDispatchTable *pDisp = &inst->layer_disp;
+ return pDisp->CreateXlibSurfaceKHR(vk_inst, pCreateInfo, pAllocator, pSurface);
+}
+#endif // VK_USE_PLATFORM_XLIB_KHR
+
+#ifdef VK_USE_PLATFORM_DIRECTFB_EXT
+VKAPI_ATTR VkResult VKAPI_CALL wrap_vkCreateDirectFBSurfaceEXT(VkInstance instance,
+ const VkDirectFBSurfaceCreateInfoEXT *pCreateInfo,
+ const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface) {
+ wrapped_inst_obj *inst;
+ auto vk_inst = unwrap_instance(instance, &inst);
+ VkLayerInstanceDispatchTable *pDisp = &inst->layer_disp;
+ return pDisp->CreateDirectFBSurfaceEXT(vk_inst, pCreateInfo, pAllocator, pSurface);
+}
+#endif // VK_USE_PLATFORM_DIRECTFB_EXT
+
+#ifdef VK_USE_PLATFORM_MACOS_MVK
+VKAPI_ATTR VkResult VKAPI_CALL wrap_vkCreateMacOSSurfaceMVK(VkInstance instance, const VkMacOSSurfaceCreateInfoMVK *pCreateInfo,
+ const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface) {
+ wrapped_inst_obj *inst;
+ auto vk_inst = unwrap_instance(instance, &inst);
+ VkLayerInstanceDispatchTable *pDisp = &inst->layer_disp;
+ return pDisp->CreateMacOSSurfaceMVK(vk_inst, pCreateInfo, pAllocator, pSurface);
+}
+#endif // VK_USE_PLATFORM_MACOS_MVK
+
+#ifdef VK_USE_PLATFORM_IOS_MVK
+VKAPI_ATTR VkResult VKAPI_CALL wrap_vkCreateIOSSurfaceMVK(VkInstance instance, const VkIOSSurfaceCreateInfoMVK *pCreateInfo,
+ const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface) {
+ wrapped_inst_obj *inst;
+ auto vk_inst = unwrap_instance(instance, &inst);
+ VkLayerInstanceDispatchTable *pDisp = &inst->layer_disp;
+ return pDisp->CreateIOSSurfaceMVK(vk_inst, pCreateInfo, pAllocator, pSurface);
+}
+#endif // VK_USE_PLATFORM_IOS_MVK
+
+#ifdef VK_USE_PLATFORM_GGP
+VKAPI_ATTR VkResult VKAPI_CALL wrap_vkCreateStreamDescriptorSurfaceGGP(VkInstance instance,
+ const VkStreamDescriptorSurfaceCreateInfoGGP *pCreateInfo,
+ const VkAllocationCallbacks *pAllocator,
+ VkSurfaceKHR *pSurface) {
+ wrapped_inst_obj *inst;
+ auto vk_inst = unwrap_instance(instance, &inst);
+ VkLayerInstanceDispatchTable *pDisp = &inst->layer_disp;
+ return pDisp->CreateStreamDescriptorSurfaceGGP(vk_inst, pCreateInfo, pAllocator, pSurface);
+}
+#endif // VK_USE_PLATFORM_GGP
+
+#if defined(VK_USE_PLATFORM_METAL_EXT)
+VKAPI_ATTR VkResult VKAPI_CALL wrap_vkCreateMetalSurfaceEXT(VkInstance instance, const VkMetalSurfaceCreateInfoEXT *pCreateInfo,
+ const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface) {
+ wrapped_inst_obj *inst;
+ auto vk_inst = unwrap_instance(instance, &inst);
+ VkLayerInstanceDispatchTable *pDisp = &inst->layer_disp;
+ return pDisp->CreateMetalSurfaceEXT(vk_inst, pCreateInfo, pAllocator, pSurface);
+}
+#endif // VK_USE_PLATFORM_METAL_EXT
+
+#ifdef VK_USE_PLATFORM_SCREEN_QNX
+VKAPI_ATTR VkResult VKAPI_CALL wrap_vkCreateScreenSurfaceQNX(VkInstance instance, const VkScreenSurfaceCreateInfoQNX *pCreateInfo,
+ const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface) {
+ wrapped_inst_obj *inst;
+ auto vk_inst = unwrap_instance(instance, &inst);
+ VkLayerInstanceDispatchTable *pDisp = &inst->layer_disp;
+ return pDisp->CreateScreenSurfaceQNX(vk_inst, pCreateInfo, pAllocator, pSurface);
+}
+#endif // VK_USE_PLATFORM_SCREEN_QNX
+
VKAPI_ATTR VkResult VKAPI_CALL vkEnumeratePhysicalDevices(VkInstance instance, uint32_t *pPhysicalDeviceCount,
VkPhysicalDevice *pPhysicalDevices) {
wrapped_inst_obj *inst;
return (PFN_vkVoidFunction)wrap_vkGetPhysicalDeviceQueueFamilyProperties;
if (!strcmp(name, "CreateDevice")) return (PFN_vkVoidFunction)wrap_vkCreateDevice;
if (!strcmp(name, "DestroyDevice")) return (PFN_vkVoidFunction)wrap_vkDestroyDevice;
+ if (!strcmp(name, "CreateDebugUtilsMessengerEXT")) return (PFN_vkVoidFunction)wrap_vkCreateDebugUtilsMessengerEXT;
+ if (!strcmp(name, "DestroyDebugUtilsMessengerEXT")) return (PFN_vkVoidFunction)wrap_vkDestroyDebugUtilsMessengerEXT;
return NULL;
}
return (PFN_vkVoidFunction)wrap_vkGetPhysicalDeviceQueueFamilyProperties;
if (!strcmp(name, "EnumerateDeviceExtensionProperties")) return (PFN_vkVoidFunction)wrap_vkEnumerateDeviceExtensionProperties;
+
+#ifdef VK_USE_PLATFORM_ANDROID_KHR
+ if (!strcmp(name, "CreateAndroidSurfaceKHR")) return (PFN_vkVoidFunction)wrap_vkCreateAndroidSurfaceKHR;
+#endif // VK_USE_PLATFORM_WIN32_KHR
+
+#ifdef VK_USE_PLATFORM_WIN32_KHR
+ if (!strcmp(name, "CreateWin32SurfaceKHR")) return (PFN_vkVoidFunction)wrap_vkCreateWin32SurfaceKHR;
+#endif // VK_USE_PLATFORM_WIN32_KHR
+
+#ifdef VK_USE_PLATFORM_WAYLAND_KHR
+ if (!strcmp(name, "CreateWaylandSurfaceKHR")) return (PFN_vkVoidFunction)wrap_vkCreateWaylandSurfaceKHR;
+#endif // VK_USE_PLATFORM_WAYLAND_KHR
+
+#ifdef VK_USE_PLATFORM_XCB_KHR
+ if (!strcmp(name, "CreateXcbSurfaceKHR")) return (PFN_vkVoidFunction)wrap_vkCreateXcbSurfaceKHR;
+#endif // VK_USE_PLATFORM_XCB_KHR
+
+#ifdef VK_USE_PLATFORM_XLIB_KHR
+ if (!strcmp(name, "CreateXlibSurfaceKHR")) return (PFN_vkVoidFunction)wrap_vkCreateXlibSurfaceKHR;
+#endif // VK_USE_PLATFORM_XLIB_KHR
+
+#ifdef VK_USE_PLATFORM_DIRECTFB_EXT
+ if (!strcmp(name, "CreateDirectFBSurfaceEXT")) return (PFN_vkVoidFunction)wrap_vkCreateDirectFBSurfaceEXT;
+#endif // VK_USE_PLATFORM_DIRECTFB_EXT
+
+#ifdef VK_USE_PLATFORM_MACOS_MVK
+ if (!strcmp(name, "CreateMacOSSurfaceMVK")) return (PFN_vkVoidFunction)wrap_vkCreateMacOSSurfaceMVK;
+#endif // VK_USE_PLATFORM_MACOS_MVK
+
+#ifdef VK_USE_PLATFORM_IOS_MVK
+ if (!strcmp(name, "CreateIOSSurfaceMVK")) return (PFN_vkVoidFunction)wrap_vkCreateIOSSurfaceMVK;
+#endif // VK_USE_PLATFORM_IOS_MVK
+
+#ifdef VK_USE_PLATFORM_GGP
+ if (!strcmp(name, "CreateStreamDescriptorSurfaceGGP")) return (PFN_vkVoidFunction)wrap_vkCreateStreamDescriptorSurfaceGGP;
+#endif // VK_USE_PLATFORM_GGP
+
+#if defined(VK_USE_PLATFORM_METAL_EXT)
+ if (!strcmp(name, "CreateMetalSurfaceEXT")) return (PFN_vkVoidFunction)wrap_vkCreateMetalSurfaceEXT;
+#endif // VK_USE_PLATFORM_METAL_EXT
+
+#ifdef VK_USE_PLATFORM_SCREEN_QNX
+ if (!strcmp(name, "CreateScreenSurfaceQNX")) return (PFN_vkVoidFunction)wrap_vkCreateScreenSurfaceQNX;
+#endif // VK_USE_PLATFORM_SCREEN_QNX
+ if (!strcmp(name, "DestroySurfaceKHR")) return (PFN_vkVoidFunction)wrap_vkDestroySurfaceKHR;
+
return NULL;
}
return wrap_objects::wrap_vkEnumerateDeviceExtensionProperties(VK_NULL_HANDLE, pLayerName, pCount, pProperties);
}
+VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateDebugUtilsMessengerEXT(VkInstance instance,
+ const VkDebugUtilsMessengerCreateInfoEXT *pCreateInfo,
+ const VkAllocationCallbacks *pAllocator,
+ VkDebugUtilsMessengerEXT *pMessenger) {
+ return wrap_objects::wrap_vkCreateDebugUtilsMessengerEXT(instance, pCreateInfo, pAllocator, pMessenger);
+}
+
+VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyDebugUtilsMessengerEXT(VkInstance instance, VkDebugUtilsMessengerEXT messenger,
+ const VkAllocationCallbacks *pAllocator) {
+ return wrap_objects::wrap_vkDestroyDebugUtilsMessengerEXT(instance, messenger, pAllocator);
+}
+
+VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroySurfaceKHR(VkInstance instance, VkSurfaceKHR surface,
+ const VkAllocationCallbacks *pAllocator) {
+ return wrap_objects::wrap_vkDestroySurfaceKHR(instance, surface, pAllocator);
+}
+
+#ifdef VK_USE_PLATFORM_ANDROID_KHR
+VKAPI_ATTR VkResult VKAPI_CALL test_vkCreateAndroidSurfaceKHR(VkInstance instance, const VkAndroidSurfaceCreateInfoKHR *pCreateInfo,
+ const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface) {
+ return wrap_objects::wrap_vkCreateAndroidSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface);
+}
+#endif // VK_USE_PLATFORM_WIN32_KHR
+
+#ifdef VK_USE_PLATFORM_WIN32_KHR
+VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateWin32SurfaceKHR(VkInstance instance,
+ const VkWin32SurfaceCreateInfoKHR *pCreateInfo,
+ const VkAllocationCallbacks *pAllocator,
+ VkSurfaceKHR *pSurface) {
+ return wrap_objects::wrap_vkCreateWin32SurfaceKHR(instance, pCreateInfo, pAllocator, pSurface);
+}
+#endif // VK_USE_PLATFORM_WIN32_KHR
+
+#ifdef VK_USE_PLATFORM_WAYLAND_KHR
+VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateWaylandSurfaceKHR(VkInstance instance,
+ const VkWaylandSurfaceCreateInfoKHR *pCreateInfo,
+ const VkAllocationCallbacks *pAllocator,
+ VkSurfaceKHR *pSurface) {
+ return wrap_objects::wrap_vkCreateWaylandSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface);
+}
+#endif // VK_USE_PLATFORM_WAYLAND_KHR
+
+#ifdef VK_USE_PLATFORM_XCB_KHR
+VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateXcbSurfaceKHR(VkInstance instance,
+ const VkXcbSurfaceCreateInfoKHR *pCreateInfo,
+ const VkAllocationCallbacks *pAllocator,
+ VkSurfaceKHR *pSurface) {
+ return wrap_objects::wrap_vkCreateXcbSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface);
+}
+#endif // VK_USE_PLATFORM_XCB_KHR
+
+#ifdef VK_USE_PLATFORM_XLIB_KHR
+VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateXlibSurfaceKHR(VkInstance instance,
+ const VkXlibSurfaceCreateInfoKHR *pCreateInfo,
+ const VkAllocationCallbacks *pAllocator,
+ VkSurfaceKHR *pSurface) {
+ return wrap_objects::wrap_vkCreateXlibSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface);
+}
+#endif // VK_USE_PLATFORM_XLIB_KHR
+
+#ifdef VK_USE_PLATFORM_DIRECTFB_EXT
+VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateDirectFBSurfaceEXT(VkInstance instance,
+ const VkDirectFBSurfaceCreateInfoEXT *pCreateInfo,
+ const VkAllocationCallbacks *pAllocator,
+ VkSurfaceKHR *pSurface) {
+ return wrap_objects::wrap_vkCreateDirectFBSurfaceEXT(instance, pCreateInfo, pAllocator, pSurface);
+}
+#endif // VK_USE_PLATFORM_DIRECTFB_EXT
+
+#ifdef VK_USE_PLATFORM_MACOS_MVK
+VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateMacOSSurfaceMVK(VkInstance instance,
+ const VkMacOSSurfaceCreateInfoMVK *pCreateInfo,
+ const VkAllocationCallbacks *pAllocator,
+ VkSurfaceKHR *pSurface) {
+ return wrap_objects::wrap_vkCreateMacOSSurfaceMVK(instance, pCreateInfo, pAllocator, pSurface);
+}
+#endif // VK_USE_PLATFORM_MACOS_MVK
+
+#ifdef VK_USE_PLATFORM_IOS_MVK
+VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateIOSSurfaceMVK(VkInstance instance,
+ const VkIOSSurfaceCreateInfoMVK *pCreateInfo,
+ const VkAllocationCallbacks *pAllocator,
+ VkSurfaceKHR *pSurface) {
+ return wrap_objects::wrap_vkCreateIOSSurfaceMVK(instance, pCreateInfo, pAllocator, pSurface);
+}
+#endif // VK_USE_PLATFORM_IOS_MVK
+
+#ifdef VK_USE_PLATFORM_GGP
+VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
+vkCreateStreamDescriptorSurfaceGGP(VkInstance instance, const VkStreamDescriptorSurfaceCreateInfoGGP *pCreateInfo,
+ const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface) {
+ return wrap_objects::wrap_vkCreateStreamDescriptorSurfaceGGP(instance, pCreateInfo, pAllocator, pSurface);
+}
+#endif // VK_USE_PLATFORM_GGP
+
+#if defined(VK_USE_PLATFORM_METAL_EXT)
+VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateMetalSurfaceEXT(VkInstance instance,
+ const VkMetalSurfaceCreateInfoEXT *pCreateInfo,
+ const VkAllocationCallbacks *pAllocator,
+ VkSurfaceKHR *pSurface) {
+ return wrap_objects::wrap_vkCreateMetalSurfaceEXT(instance, pCreateInfo, pAllocator, pSurface);
+}
+#endif // VK_USE_PLATFORM_METAL_EXT
+
+#ifdef VK_USE_PLATFORM_SCREEN_QNX
+VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateScreenSurfaceQNX(VkInstance instance,
+ const VkScreenSurfaceCreateInfoQNX *pCreateInfo,
+ const VkAllocationCallbacks *pAllocator,
+ VkSurfaceKHR *pSurface) {
+ return wrap_objects::wrap_vkCreateScreenSurfaceQNX(instance, pCreateInfo, pAllocator, pSurface);
+}
+#endif // VK_USE_PLATFORM_SCREEN_QNX
+
VK_LAYER_EXPORT VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vk_layerGetPhysicalDeviceProcAddr(VkInstance instance,
const char *funcName) {
return wrap_objects::GetPhysicalDeviceProcAddr(instance, funcName);
uint64_t bad_array[3] = {0x123456789AB, 0x23456789AB1, 0x9876543210AB};
} my_bad_data;
VkPhysicalDevice bad_physical_dev = (VkPhysicalDevice)(&my_bad_data);
- RROutput rrout;
+ RROutput rrout = {};
VkDisplayKHR disp;
PFN_vkGetRandROutputDisplayEXT pfn = reinterpret_cast<PFN_vkGetRandROutputDisplayEXT>(
env->vulkan_functions.vkGetInstanceProcAddr(instance, "vkGetRandROutputDisplayEXT"));
uint32_t count = 0;
ASSERT_DEATH(pfn(bad_physical_dev, &count, nullptr), "");
// TODO: Look for "invalid physicalDevice" in stderr log to make sure correct error is thrown
-}
\ No newline at end of file
+}
+
+#ifdef VK_USE_PLATFORM_ANDROID_KHR
+TEST_F(LoaderHandleValidTests, VerifyHandleWrappingAndroidSurface) {
+ Extension first_ext{"VK_KHR_surface"};
+ Extension second_ext{"VK_KHR_android_surface"};
+ auto& driver = env->get_test_icd();
+ driver.AddInstanceExtensions({first_ext, second_ext});
+
+ const char* wrap_objects_name = "WrapObjectsLayer";
+ ManifestLayer::LayerDescription wrap_objects_description{};
+ wrap_objects_description.name = wrap_objects_name;
+ wrap_objects_description.lib_path = TEST_LAYER_WRAP_OBJECTS;
+
+ ManifestLayer wrap_objects_layer;
+ wrap_objects_layer.layers.push_back(wrap_objects_description);
+ env->AddExplicitLayer(wrap_objects_layer, "wrap_objects_layer.json");
+
+ driver.physical_devices.emplace_back("physical_device_0");
+ MockQueueFamilyProperties family_props{{VK_QUEUE_GRAPHICS_BIT, 1, 0, {1, 1, 1}}, true};
+ driver.physical_devices.back().queue_family_properties.push_back(family_props);
+
+ InstWrapper instance(env->vulkan_functions);
+ instance.create_info.add_extension("VK_KHR_surface");
+ instance.create_info.add_extension("VK_KHR_android_surface");
+ instance.create_info.add_layer(wrap_objects_name);
+ instance.CheckCreate();
+
+ VkAndroidSurfaceCreateInfoKHR surf_create_info = {};
+ surf_create_info.sType = VK_STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR;
+ surf_create_info.pNext = nullptr;
+ VkSurfaceKHR created_surface = VK_NULL_HANDLE;
+ PFN_vkCreateAndroidSurfaceKHR pfn_CreateSurface = reinterpret_cast<PFN_vkCreateAndroidSurfaceKHR>(
+ env->vulkan_functions.vkGetInstanceProcAddr(instance, "vkCreateAndroidSurfaceKHR"));
+ ASSERT_NE(pfn_CreateSurface, nullptr);
+ PFN_vkDestroySurfaceKHR pfn_DestroySurface =
+ reinterpret_cast<PFN_vkDestroySurfaceKHR>(env->vulkan_functions.vkGetInstanceProcAddr(instance, "vkDestroySurfaceKHR"));
+ ASSERT_NE(pfn_DestroySurface, nullptr);
+ ASSERT_EQ(VK_SUCCESS, pfn_CreateSurface(instance, &surf_create_info, nullptr, &created_surface));
+ pfn_DestroySurface(instance, created_surface, nullptr);
+}
+#endif // VK_USE_PLATFORM_ANDROID_KHR
+
+#ifdef VK_USE_PLATFORM_DIRECTFB_EXT
+TEST_F(LoaderHandleValidTests, VerifyHandleWrappingDirectFBSurf) {
+ Extension first_ext{"VK_KHR_surface"};
+ Extension second_ext{"VK_EXT_directfb_surface"};
+ auto& driver = env->get_test_icd();
+ driver.AddInstanceExtensions({first_ext, second_ext});
+
+ const char* wrap_objects_name = "WrapObjectsLayer";
+ ManifestLayer::LayerDescription wrap_objects_description{};
+ wrap_objects_description.name = wrap_objects_name;
+ wrap_objects_description.lib_path = TEST_LAYER_WRAP_OBJECTS;
+
+ ManifestLayer wrap_objects_layer;
+ wrap_objects_layer.layers.push_back(wrap_objects_description);
+ env->AddExplicitLayer(wrap_objects_layer, "wrap_objects_layer.json");
+
+ driver.physical_devices.emplace_back("physical_device_0");
+ MockQueueFamilyProperties family_props{{VK_QUEUE_GRAPHICS_BIT, 1, 0, {1, 1, 1}}, true};
+ driver.physical_devices.back().queue_family_properties.push_back(family_props);
+
+ InstWrapper instance(env->vulkan_functions);
+ instance.create_info.add_extension("VK_KHR_surface");
+ instance.create_info.add_extension("VK_EXT_directfb_surface");
+ instance.create_info.add_layer(wrap_objects_name);
+ instance.CheckCreate();
+
+ VkDirectFBSurfaceCreateInfoEXT surf_create_info = {};
+ surf_create_info.sType = VK_STRUCTURE_TYPE_DIRECTFB_SURFACE_CREATE_INFO_EXT;
+ surf_create_info.pNext = nullptr;
+ VkSurfaceKHR created_surface = VK_NULL_HANDLE;
+ PFN_vkCreateDirectFBSurfaceEXT pfn_CreateSurface = reinterpret_cast<PFN_vkCreateDirectFBSurfaceEXT>(
+ env->vulkan_functions.vkGetInstanceProcAddr(instance, "vkCreateDirectFBSurfaceEXT"));
+ ASSERT_NE(pfn_CreateSurface, nullptr);
+ PFN_vkDestroySurfaceKHR pfn_DestroySurface =
+ reinterpret_cast<PFN_vkDestroySurfaceKHR>(env->vulkan_functions.vkGetInstanceProcAddr(instance, "vkDestroySurfaceKHR"));
+ ASSERT_NE(pfn_DestroySurface, nullptr);
+ ASSERT_EQ(VK_SUCCESS, pfn_CreateSurface(instance, &surf_create_info, nullptr, &created_surface));
+ pfn_DestroySurface(instance, created_surface, nullptr);
+}
+#endif // VK_USE_PLATFORM_DIRECTFB_EXT
+
+#ifdef VK_USE_PLATFORM_FUCHSIA
+TEST_F(LoaderHandleValidTests, VerifyHandleWrappingFuchsiaSurf) {
+ Extension first_ext{"VK_KHR_surface"};
+ Extension second_ext{"VK_FUCHSIA_imagepipe_surface"};
+ auto& driver = env->get_test_icd();
+ driver.AddInstanceExtensions({first_ext, second_ext});
+
+ const char* wrap_objects_name = "WrapObjectsLayer";
+ ManifestLayer::LayerDescription wrap_objects_description{};
+ wrap_objects_description.name = wrap_objects_name;
+ wrap_objects_description.lib_path = TEST_LAYER_WRAP_OBJECTS;
+
+ ManifestLayer wrap_objects_layer;
+ wrap_objects_layer.layers.push_back(wrap_objects_description);
+ env->AddExplicitLayer(wrap_objects_layer, "wrap_objects_layer.json");
+
+ driver.physical_devices.emplace_back("physical_device_0");
+ MockQueueFamilyProperties family_props{{VK_QUEUE_GRAPHICS_BIT, 1, 0, {1, 1, 1}}, true};
+ driver.physical_devices.back().queue_family_properties.push_back(family_props);
+
+ InstWrapper instance(env->vulkan_functions);
+ instance.create_info.add_extension("VK_KHR_surface");
+ instance.create_info.add_extension("VK_FUCHSIA_imagepipe_surface");
+ instance.create_info.add_layer(wrap_objects_name);
+ instance.CheckCreate();
+
+ VkImagePipeSurfaceCreateInfoFUCHSIA surf_create_info = {};
+ surf_create_info.sType = VK_STRUCTURE_TYPE_IMAGEPIPE_SURFACE_CREATE_INFO_FUCHSIA;
+ surf_create_info.pNext = nullptr;
+ VkSurfaceKHR created_surface = VK_NULL_HANDLE;
+ PFN_vkCreateImagePipeSurfaceFUCHSIA pfn_CreateSurface = reinterpret_cast<PFN_vkCreateImagePipeSurfaceFUCHSIA>(
+ env->vulkan_functions.vkGetInstanceProcAddr(instance, "vkCreateImagePipeSurfaceFUCHSIA"));
+ ASSERT_NE(pfn_CreateSurface, nullptr);
+ PFN_vkDestroySurfaceKHR pfn_DestroySurface =
+ reinterpret_cast<PFN_vkDestroySurfaceKHR>(env->vulkan_functions.vkGetInstanceProcAddr(instance, "vkDestroySurfaceKHR"));
+ ASSERT_NE(pfn_DestroySurface, nullptr);
+ ASSERT_EQ(VK_SUCCESS, pfn_CreateSurface(instance, &surf_create_info, nullptr, &created_surface));
+ pfn_DestroySurface(instance, created_surface, nullptr);
+}
+#endif // VK_USE_PLATFORM_FUCHSIA
+
+#ifdef VK_USE_PLATFORM_GGP
+TEST_F(LoaderHandleValidTests, VerifyHandleWrappingGGPSurf) {
+ Extension first_ext{"VK_KHR_surface"};
+ Extension second_ext{"VK_GGP_stream_descriptor_surface"};
+ auto& driver = env->get_test_icd();
+ driver.AddInstanceExtensions({first_ext, second_ext});
+
+ const char* wrap_objects_name = "WrapObjectsLayer";
+ ManifestLayer::LayerDescription wrap_objects_description{};
+ wrap_objects_description.name = wrap_objects_name;
+ wrap_objects_description.lib_path = TEST_LAYER_WRAP_OBJECTS;
+
+ ManifestLayer wrap_objects_layer;
+ wrap_objects_layer.layers.push_back(wrap_objects_description);
+ env->AddExplicitLayer(wrap_objects_layer, "wrap_objects_layer.json");
+
+ driver.physical_devices.emplace_back("physical_device_0");
+ MockQueueFamilyProperties family_props{{VK_QUEUE_GRAPHICS_BIT, 1, 0, {1, 1, 1}}, true};
+ driver.physical_devices.back().queue_family_properties.push_back(family_props);
+
+ InstWrapper instance(env->vulkan_functions);
+ instance.create_info.add_extension("VK_KHR_surface");
+ instance.create_info.add_extension("VK_GGP_stream_descriptor_surface");
+ instance.create_info.add_layer(wrap_objects_name);
+ instance.CheckCreate();
+
+ VkStreamDescriptorSurfaceCreateInfoGGP surf_create_info = {};
+ surf_create_info.sType = VK_STRUCTURE_TYPE_STREAM_DESCRIPTOR_SURFACE_CREATE_INFO_GGP;
+ surf_create_info.pNext = nullptr;
+ VkSurfaceKHR created_surface = VK_NULL_HANDLE;
+ PFN_vkCreateStreamDescriptorSurfaceGGP pfn_CreateSurface = reinterpret_cast<PFN_vkCreateStreamDescriptorSurfaceGGP>(
+ env->vulkan_functions.vkGetInstanceProcAddr(instance, "vkCreateStreamDescriptorSurfaceGGP"));
+ ASSERT_NE(pfn_CreateSurface, nullptr);
+ PFN_vkDestroySurfaceKHR pfn_DestroySurface =
+ reinterpret_cast<PFN_vkDestroySurfaceKHR>(env->vulkan_functions.vkGetInstanceProcAddr(instance, "vkDestroySurfaceKHR"));
+ ASSERT_NE(pfn_DestroySurface, nullptr);
+ ASSERT_EQ(VK_SUCCESS, pfn_CreateSurface(instance, &surf_create_info, nullptr, &created_surface));
+ pfn_DestroySurface(instance, created_surface, nullptr);
+}
+#endif // VK_USE_PLATFORM_GGP
+
+#ifdef VK_USE_PLATFORM_IOS_MVK
+TEST_F(LoaderHandleValidTests, VerifyHandleWrappingIOSSurf) {
+ Extension first_ext{"VK_KHR_surface"};
+ Extension second_ext{"VK_MVK_ios_surface"};
+ auto& driver = env->get_test_icd();
+ driver.AddInstanceExtensions({first_ext, second_ext});
+
+ const char* wrap_objects_name = "WrapObjectsLayer";
+ ManifestLayer::LayerDescription wrap_objects_description{};
+ wrap_objects_description.name = wrap_objects_name;
+ wrap_objects_description.lib_path = TEST_LAYER_WRAP_OBJECTS;
+
+ ManifestLayer wrap_objects_layer;
+ wrap_objects_layer.layers.push_back(wrap_objects_description);
+ env->AddExplicitLayer(wrap_objects_layer, "wrap_objects_layer.json");
+
+ driver.physical_devices.emplace_back("physical_device_0");
+ MockQueueFamilyProperties family_props{{VK_QUEUE_GRAPHICS_BIT, 1, 0, {1, 1, 1}}, true};
+ driver.physical_devices.back().queue_family_properties.push_back(family_props);
+
+ InstWrapper instance(env->vulkan_functions);
+ instance.create_info.add_extension("VK_KHR_surface");
+ instance.create_info.add_extension("VK_MVK_ios_surface");
+ instance.create_info.add_layer(wrap_objects_name);
+ instance.CheckCreate();
+
+ VkIOSSurfaceCreateInfoMVK surf_create_info = {};
+ surf_create_info.sType = VK_STRUCTURE_TYPE_IOS_SURFACE_CREATE_INFO_MVK;
+ surf_create_info.pNext = nullptr;
+ VkSurfaceKHR created_surface = VK_NULL_HANDLE;
+ PFN_vkCreateIOSSurfaceMVK pfn_CreateSurface =
+ reinterpret_cast<PFN_vkCreateIOSSurfaceMVK>(env->vulkan_functions.vkGetInstanceProcAddr(instance, "vkCreateIOSSurfaceMVK"));
+ ASSERT_NE(pfn_CreateSurface, nullptr);
+ PFN_vkDestroySurfaceKHR pfn_DestroySurface =
+ reinterpret_cast<PFN_vkDestroySurfaceKHR>(env->vulkan_functions.vkGetInstanceProcAddr(instance, "vkDestroySurfaceKHR"));
+ ASSERT_NE(pfn_DestroySurface, nullptr);
+ ASSERT_EQ(VK_SUCCESS, pfn_CreateSurface(instance, &surf_create_info, nullptr, &created_surface));
+ pfn_DestroySurface(instance, created_surface, nullptr);
+}
+#endif // VK_USE_PLATFORM_IOS_MVK
+
+#ifdef VK_USE_PLATFORM_MACOS_MVK
+TEST_F(LoaderHandleValidTests, VerifyHandleWrappingMacOSSurf) {
+ Extension first_ext{"VK_KHR_surface"};
+ Extension second_ext{"VK_MVK_macos_surface"};
+ auto& driver = env->get_test_icd();
+ driver.AddInstanceExtensions({first_ext, second_ext});
+
+ const char* wrap_objects_name = "WrapObjectsLayer";
+ ManifestLayer::LayerDescription wrap_objects_description{};
+ wrap_objects_description.name = wrap_objects_name;
+ wrap_objects_description.lib_path = TEST_LAYER_WRAP_OBJECTS;
+
+ ManifestLayer wrap_objects_layer;
+ wrap_objects_layer.layers.push_back(wrap_objects_description);
+ env->AddExplicitLayer(wrap_objects_layer, "wrap_objects_layer.json");
+
+ driver.physical_devices.emplace_back("physical_device_0");
+ MockQueueFamilyProperties family_props{{VK_QUEUE_GRAPHICS_BIT, 1, 0, {1, 1, 1}}, true};
+ driver.physical_devices.back().queue_family_properties.push_back(family_props);
+
+ InstWrapper instance(env->vulkan_functions);
+ instance.create_info.add_extension("VK_KHR_surface");
+ instance.create_info.add_extension("VK_MVK_macos_surface");
+ instance.create_info.add_layer(wrap_objects_name);
+ instance.CheckCreate();
+
+ VkMacOSSurfaceCreateInfoMVK surf_create_info = {};
+ surf_create_info.sType = VK_STRUCTURE_TYPE_MACOS_SURFACE_CREATE_INFO_MVK;
+ surf_create_info.pNext = nullptr;
+ VkSurfaceKHR created_surface = VK_NULL_HANDLE;
+ PFN_vkCreateMacOSSurfaceMVK pfn_CreateSurface = reinterpret_cast<PFN_vkCreateMacOSSurfaceMVK>(
+ env->vulkan_functions.vkGetInstanceProcAddr(instance, "vkCreateMacOSSurfaceMVK"));
+ ASSERT_NE(pfn_CreateSurface, nullptr);
+ PFN_vkDestroySurfaceKHR pfn_DestroySurface =
+ reinterpret_cast<PFN_vkDestroySurfaceKHR>(env->vulkan_functions.vkGetInstanceProcAddr(instance, "vkDestroySurfaceKHR"));
+ ASSERT_NE(pfn_DestroySurface, nullptr);
+ ASSERT_EQ(VK_SUCCESS, pfn_CreateSurface(instance, &surf_create_info, nullptr, &created_surface));
+ pfn_DestroySurface(instance, created_surface, nullptr);
+}
+#endif // VK_USE_PLATFORM_MACOS_MVK
+
+#if defined(VK_USE_PLATFORM_METAL_EXT)
+TEST_F(LoaderHandleValidTests, VerifyHandleWrappingMetalSurf) {
+ Extension first_ext{"VK_KHR_surface"};
+ Extension second_ext{"VK_EXT_metal_surface"};
+ auto& driver = env->get_test_icd();
+ driver.AddInstanceExtensions({first_ext, second_ext});
+
+ const char* wrap_objects_name = "WrapObjectsLayer";
+ ManifestLayer::LayerDescription wrap_objects_description{};
+ wrap_objects_description.name = wrap_objects_name;
+ wrap_objects_description.lib_path = TEST_LAYER_WRAP_OBJECTS;
+
+ ManifestLayer wrap_objects_layer;
+ wrap_objects_layer.layers.push_back(wrap_objects_description);
+ env->AddExplicitLayer(wrap_objects_layer, "wrap_objects_layer.json");
+
+ driver.physical_devices.emplace_back("physical_device_0");
+ MockQueueFamilyProperties family_props{{VK_QUEUE_GRAPHICS_BIT, 1, 0, {1, 1, 1}}, true};
+ driver.physical_devices.back().queue_family_properties.push_back(family_props);
+
+ InstWrapper instance(env->vulkan_functions);
+ instance.create_info.add_extension("VK_KHR_surface");
+ instance.create_info.add_extension("VK_EXT_metal_surface");
+ instance.create_info.add_layer(wrap_objects_name);
+ instance.CheckCreate();
+
+ VkMetalSurfaceCreateInfoEXT surf_create_info = {};
+ surf_create_info.sType = VK_STRUCTURE_TYPE_METAL_SURFACE_CREATE_INFO_EXT;
+ surf_create_info.pNext = nullptr;
+ VkSurfaceKHR created_surface = VK_NULL_HANDLE;
+ PFN_vkCreateMetalSurfaceEXT pfn_CreateSurface = reinterpret_cast<PFN_vkCreateMetalSurfaceEXT>(
+ env->vulkan_functions.vkGetInstanceProcAddr(instance, "vkCreateMetalSurfaceEXT"));
+ ASSERT_NE(pfn_CreateSurface, nullptr);
+ PFN_vkDestroySurfaceKHR pfn_DestroySurface =
+ reinterpret_cast<PFN_vkDestroySurfaceKHR>(env->vulkan_functions.vkGetInstanceProcAddr(instance, "vkDestroySurfaceKHR"));
+ ASSERT_NE(pfn_DestroySurface, nullptr);
+ ASSERT_EQ(VK_SUCCESS, pfn_CreateSurface(instance, &surf_create_info, nullptr, &created_surface));
+ pfn_DestroySurface(instance, created_surface, nullptr);
+}
+#endif // VK_USE_PLATFORM_METAL_EXT
+
+#ifdef VK_USE_PLATFORM_SCREEN_QNX
+TEST_F(LoaderHandleValidTests, VerifyHandleWrappingQNXSurf) {
+ Extension first_ext{"VK_KHR_surface"};
+ Extension second_ext{"VK_QNX_screen_surface"};
+ auto& driver = env->get_test_icd();
+ driver.AddInstanceExtensions({first_ext, second_ext});
+
+ const char* wrap_objects_name = "WrapObjectsLayer";
+ ManifestLayer::LayerDescription wrap_objects_description{};
+ wrap_objects_description.name = wrap_objects_name;
+ wrap_objects_description.lib_path = TEST_LAYER_WRAP_OBJECTS;
+
+ ManifestLayer wrap_objects_layer;
+ wrap_objects_layer.layers.push_back(wrap_objects_description);
+ env->AddExplicitLayer(wrap_objects_layer, "wrap_objects_layer.json");
+
+ driver.physical_devices.emplace_back("physical_device_0");
+ MockQueueFamilyProperties family_props{{VK_QUEUE_GRAPHICS_BIT, 1, 0, {1, 1, 1}}, true};
+ driver.physical_devices.back().queue_family_properties.push_back(family_props);
+
+ InstWrapper instance(env->vulkan_functions);
+ instance.create_info.add_extension("VK_KHR_surface");
+ instance.create_info.add_extension("VK_QNX_screen_surface");
+ instance.create_info.add_layer(wrap_objects_name);
+ instance.CheckCreate();
+
+ VkScreenSurfaceCreateInfoQNX surf_create_info = {};
+ surf_create_info.sType = VK_STRUCTURE_TYPE_SCREEN_SURFACE_CREATE_INFO_QNX;
+ surf_create_info.pNext = nullptr;
+ VkSurfaceKHR created_surface = VK_NULL_HANDLE;
+ PFN_vkCreateScreenSurfaceQNX pfn_CreateSurface = reinterpret_cast<PFN_vkCreateScreenSurfaceQNX>(
+ env->vulkan_functions.vkGetInstanceProcAddr(instance, "vkCreateScreenSurfaceQNX"));
+ ASSERT_NE(pfn_CreateSurface, nullptr);
+ PFN_vkDestroySurfaceKHR pfn_DestroySurface =
+ reinterpret_cast<PFN_vkDestroySurfaceKHR>(env->vulkan_functions.vkGetInstanceProcAddr(instance, "vkDestroySurfaceKHR"));
+ ASSERT_NE(pfn_DestroySurface, nullptr);
+ ASSERT_EQ(VK_SUCCESS, pfn_CreateSurface(instance, &surf_create_info, nullptr, &created_surface));
+ pfn_DestroySurface(instance, created_surface, nullptr);
+}
+#endif // VK_USE_PLATFORM_SCREEN_QNX
+
+#ifdef VK_USE_PLATFORM_VI_NN
+TEST_F(LoaderHandleValidTests, VerifyHandleWrappingViNNSurf) {
+ Extension first_ext{"VK_KHR_surface"};
+ Extension second_ext{"VK_NN_vi_surface"};
+ auto& driver = env->get_test_icd();
+ driver.AddInstanceExtensions({first_ext, second_ext});
+
+ const char* wrap_objects_name = "WrapObjectsLayer";
+ ManifestLayer::LayerDescription wrap_objects_description{};
+ wrap_objects_description.name = wrap_objects_name;
+ wrap_objects_description.lib_path = TEST_LAYER_WRAP_OBJECTS;
+
+ ManifestLayer wrap_objects_layer;
+ wrap_objects_layer.layers.push_back(wrap_objects_description);
+ env->AddExplicitLayer(wrap_objects_layer, "wrap_objects_layer.json");
+
+ driver.physical_devices.emplace_back("physical_device_0");
+ MockQueueFamilyProperties family_props{{VK_QUEUE_GRAPHICS_BIT, 1, 0, {1, 1, 1}}, true};
+ driver.physical_devices.back().queue_family_properties.push_back(family_props);
+
+ InstWrapper instance(env->vulkan_functions);
+ instance.create_info.add_extension("VK_KHR_surface");
+ instance.create_info.add_extension("VK_NN_vi_surface");
+ instance.create_info.add_layer(wrap_objects_name);
+ instance.CheckCreate();
+
+ VkViSurfaceCreateInfoNN surf_create_info = {};
+ surf_create_info.sType = VK_STRUCTURE_TYPE_VI_SURFACE_CREATE_INFO_NN;
+ surf_create_info.pNext = nullptr;
+ VkSurfaceKHR created_surface = VK_NULL_HANDLE;
+ PFN_vkCreateViSurfaceNN pfn_CreateSurface =
+ reinterpret_cast<PFN_vkCreateViSurfaceNN>(env->vulkan_functions.vkGetInstanceProcAddr(instance, "vkCreateViSurfaceNN"));
+ ASSERT_NE(pfn_CreateSurface, nullptr);
+ PFN_vkDestroySurfaceKHR pfn_DestroySurface =
+ reinterpret_cast<PFN_vkDestroySurfaceKHR>(env->vulkan_functions.vkGetInstanceProcAddr(instance, "vkDestroySurfaceKHR"));
+ ASSERT_NE(pfn_DestroySurface, nullptr);
+ ASSERT_EQ(VK_SUCCESS, pfn_CreateSurface(instance, &surf_create_info, nullptr, &created_surface));
+ pfn_DestroySurface(instance, created_surface, nullptr);
+}
+#endif // VK_USE_PLATFORM_VI_NN
+
+#ifdef VK_USE_PLATFORM_WAYLAND_KHR
+TEST_F(LoaderHandleValidTests, VerifyHandleWrappingWaylandSurf) {
+ Extension first_ext{"VK_KHR_surface"};
+ Extension second_ext{"VK_KHR_wayland_surface"};
+ auto& driver = env->get_test_icd();
+ driver.AddInstanceExtensions({first_ext, second_ext});
+
+ const char* wrap_objects_name = "WrapObjectsLayer";
+ ManifestLayer::LayerDescription wrap_objects_description{};
+ wrap_objects_description.name = wrap_objects_name;
+ wrap_objects_description.lib_path = TEST_LAYER_WRAP_OBJECTS;
+
+ ManifestLayer wrap_objects_layer;
+ wrap_objects_layer.layers.push_back(wrap_objects_description);
+ env->AddExplicitLayer(wrap_objects_layer, "wrap_objects_layer.json");
+
+ driver.physical_devices.emplace_back("physical_device_0");
+ MockQueueFamilyProperties family_props{{VK_QUEUE_GRAPHICS_BIT, 1, 0, {1, 1, 1}}, true};
+ driver.physical_devices.back().queue_family_properties.push_back(family_props);
+
+ InstWrapper instance(env->vulkan_functions);
+ instance.create_info.add_extension("VK_KHR_surface");
+ instance.create_info.add_extension("VK_KHR_wayland_surface");
+ instance.create_info.add_layer(wrap_objects_name);
+ instance.CheckCreate();
+
+ VkWaylandSurfaceCreateInfoKHR surf_create_info = {};
+ surf_create_info.sType = VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR;
+ surf_create_info.pNext = nullptr;
+ VkSurfaceKHR created_surface = VK_NULL_HANDLE;
+ PFN_vkCreateWaylandSurfaceKHR pfn_CreateSurface = reinterpret_cast<PFN_vkCreateWaylandSurfaceKHR>(
+ env->vulkan_functions.vkGetInstanceProcAddr(instance, "vkCreateWaylandSurfaceKHR"));
+ ASSERT_NE(pfn_CreateSurface, nullptr);
+ PFN_vkDestroySurfaceKHR pfn_DestroySurface =
+ reinterpret_cast<PFN_vkDestroySurfaceKHR>(env->vulkan_functions.vkGetInstanceProcAddr(instance, "vkDestroySurfaceKHR"));
+ ASSERT_NE(pfn_DestroySurface, nullptr);
+ ASSERT_EQ(VK_SUCCESS, pfn_CreateSurface(instance, &surf_create_info, nullptr, &created_surface));
+ pfn_DestroySurface(instance, created_surface, nullptr);
+}
+#endif // VK_USE_PLATFORM_WAYLAND_KHR
+
+#ifdef VK_USE_PLATFORM_WIN32_KHR
+TEST_F(LoaderHandleValidTests, VerifyHandleWrappingWin32Surf) {
+ Extension first_ext{"VK_KHR_surface"};
+ Extension second_ext{"VK_KHR_win32_surface"};
+ auto& driver = env->get_test_icd();
+ driver.AddInstanceExtensions({first_ext, second_ext});
+
+ const char* wrap_objects_name = "WrapObjectsLayer";
+ ManifestLayer::LayerDescription wrap_objects_description{};
+ wrap_objects_description.name = wrap_objects_name;
+ wrap_objects_description.lib_path = TEST_LAYER_WRAP_OBJECTS;
+
+ ManifestLayer wrap_objects_layer;
+ wrap_objects_layer.layers.push_back(wrap_objects_description);
+ env->AddExplicitLayer(wrap_objects_layer, "wrap_objects_layer.json");
+
+ driver.physical_devices.emplace_back("physical_device_0");
+ MockQueueFamilyProperties family_props{{VK_QUEUE_GRAPHICS_BIT, 1, 0, {1, 1, 1}}, true};
+ driver.physical_devices.back().queue_family_properties.push_back(family_props);
+
+ InstWrapper instance(env->vulkan_functions);
+ instance.create_info.add_extension("VK_KHR_surface");
+ instance.create_info.add_extension("VK_KHR_win32_surface");
+ instance.create_info.add_layer(wrap_objects_name);
+ instance.CheckCreate();
+
+ VkWin32SurfaceCreateInfoKHR surf_create_info = {};
+ surf_create_info.sType = VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR;
+ surf_create_info.pNext = nullptr;
+ VkSurfaceKHR created_surface = VK_NULL_HANDLE;
+ PFN_vkCreateWin32SurfaceKHR pfn_CreateSurface = reinterpret_cast<PFN_vkCreateWin32SurfaceKHR>(
+ env->vulkan_functions.vkGetInstanceProcAddr(instance, "vkCreateWin32SurfaceKHR"));
+ ASSERT_NE(pfn_CreateSurface, nullptr);
+ PFN_vkDestroySurfaceKHR pfn_DestroySurface =
+ reinterpret_cast<PFN_vkDestroySurfaceKHR>(env->vulkan_functions.vkGetInstanceProcAddr(instance, "vkDestroySurfaceKHR"));
+ ASSERT_NE(pfn_DestroySurface, nullptr);
+ ASSERT_EQ(VK_SUCCESS, pfn_CreateSurface(instance, &surf_create_info, nullptr, &created_surface));
+ pfn_DestroySurface(instance, created_surface, nullptr);
+}
+#endif // VK_USE_PLATFORM_WIN32_KHR
+
+#ifdef VK_USE_PLATFORM_XCB_KHR
+TEST_F(LoaderHandleValidTests, VerifyHandleWrappingXCBSurf) {
+ Extension first_ext{"VK_KHR_surface"};
+ Extension second_ext{"VK_KHR_xcb_surface"};
+ auto& driver = env->get_test_icd();
+ driver.AddInstanceExtensions({first_ext, second_ext});
+
+ const char* wrap_objects_name = "WrapObjectsLayer";
+ ManifestLayer::LayerDescription wrap_objects_description{};
+ wrap_objects_description.name = wrap_objects_name;
+ wrap_objects_description.lib_path = TEST_LAYER_WRAP_OBJECTS;
+
+ ManifestLayer wrap_objects_layer;
+ wrap_objects_layer.layers.push_back(wrap_objects_description);
+ env->AddExplicitLayer(wrap_objects_layer, "wrap_objects_layer.json");
+
+ driver.physical_devices.emplace_back("physical_device_0");
+ MockQueueFamilyProperties family_props{{VK_QUEUE_GRAPHICS_BIT, 1, 0, {1, 1, 1}}, true};
+ driver.physical_devices.back().queue_family_properties.push_back(family_props);
+
+ InstWrapper instance(env->vulkan_functions);
+ instance.create_info.add_extension("VK_KHR_surface");
+ instance.create_info.add_extension("VK_KHR_xcb_surface");
+ instance.create_info.add_layer(wrap_objects_name);
+ instance.CheckCreate();
+
+ VkXcbSurfaceCreateInfoKHR surf_create_info = {};
+ surf_create_info.sType = VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR;
+ surf_create_info.pNext = nullptr;
+ VkSurfaceKHR created_surface = VK_NULL_HANDLE;
+ PFN_vkCreateXcbSurfaceKHR pfn_CreateSurface =
+ reinterpret_cast<PFN_vkCreateXcbSurfaceKHR>(env->vulkan_functions.vkGetInstanceProcAddr(instance, "vkCreateXcbSurfaceKHR"));
+ ASSERT_NE(pfn_CreateSurface, nullptr);
+ PFN_vkDestroySurfaceKHR pfn_DestroySurface =
+ reinterpret_cast<PFN_vkDestroySurfaceKHR>(env->vulkan_functions.vkGetInstanceProcAddr(instance, "vkDestroySurfaceKHR"));
+ ASSERT_NE(pfn_DestroySurface, nullptr);
+ ASSERT_EQ(VK_SUCCESS, pfn_CreateSurface(instance, &surf_create_info, nullptr, &created_surface));
+ pfn_DestroySurface(instance, created_surface, nullptr);
+}
+#endif // VK_USE_PLATFORM_XCB_KHR
+
+#ifdef VK_USE_PLATFORM_XLIB_KHR
+TEST_F(LoaderHandleValidTests, VerifyHandleWrappingXlibSurf) {
+ Extension first_ext{"VK_KHR_surface"};
+ Extension second_ext{"VK_KHR_xlib_surface"};
+ auto& driver = env->get_test_icd();
+ driver.AddInstanceExtensions({first_ext, second_ext});
+
+ const char* wrap_objects_name = "WrapObjectsLayer";
+ ManifestLayer::LayerDescription wrap_objects_description{};
+ wrap_objects_description.name = wrap_objects_name;
+ wrap_objects_description.lib_path = TEST_LAYER_WRAP_OBJECTS;
+
+ ManifestLayer wrap_objects_layer;
+ wrap_objects_layer.layers.push_back(wrap_objects_description);
+ env->AddExplicitLayer(wrap_objects_layer, "wrap_objects_layer.json");
+
+ driver.physical_devices.emplace_back("physical_device_0");
+ MockQueueFamilyProperties family_props{{VK_QUEUE_GRAPHICS_BIT, 1, 0, {1, 1, 1}}, true};
+ driver.physical_devices.back().queue_family_properties.push_back(family_props);
+
+ InstWrapper instance(env->vulkan_functions);
+ instance.create_info.add_extension("VK_KHR_surface");
+ instance.create_info.add_extension("VK_KHR_xlib_surface");
+ instance.create_info.add_layer(wrap_objects_name);
+ instance.CheckCreate();
+
+ VkXlibSurfaceCreateInfoKHR surf_create_info = {};
+ surf_create_info.sType = VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR;
+ surf_create_info.pNext = nullptr;
+ VkSurfaceKHR created_surface = VK_NULL_HANDLE;
+ PFN_vkCreateXlibSurfaceKHR pfn_CreateSurface = reinterpret_cast<PFN_vkCreateXlibSurfaceKHR>(
+ env->vulkan_functions.vkGetInstanceProcAddr(instance, "vkCreateXlibSurfaceKHR"));
+ ASSERT_NE(pfn_CreateSurface, nullptr);
+ PFN_vkDestroySurfaceKHR pfn_DestroySurface =
+ reinterpret_cast<PFN_vkDestroySurfaceKHR>(env->vulkan_functions.vkGetInstanceProcAddr(instance, "vkDestroySurfaceKHR"));
+ ASSERT_NE(pfn_DestroySurface, nullptr);
+ ASSERT_EQ(VK_SUCCESS, pfn_CreateSurface(instance, &surf_create_info, nullptr, &created_surface));
+ pfn_DestroySurface(instance, created_surface, nullptr);
+}
+#endif // VK_USE_PLATFORM_XLIB_KHR
+
+static VkBool32 JunkDebugUtilsCallback(VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity,
+ VkDebugUtilsMessageTypeFlagsEXT messageTypes,
+ const VkDebugUtilsMessengerCallbackDataEXT* pCallbackData, void* pUserData) {
+ // This is just a stub callback in case the loader or any other layer triggers it.
+ (void)messageSeverity;
+ (void)messageTypes;
+ (void)pCallbackData;
+ (void)pUserData;
+ return VK_FALSE;
+}
+
+#if 0 // Disable for now to get this commit in
+TEST_F(LoaderHandleValidTests, VerifyHandleWrappingDebugUtilsMessenger) {
+ Extension ext{"VK_EXT_debug_utils"};
+ auto& driver = env->get_test_icd();
+ driver.AddInstanceExtensions({ext});
+
+ const char* wrap_objects_name = "WrapObjectsLayer";
+ ManifestLayer::LayerDescription wrap_objects_description{};
+ wrap_objects_description.name = wrap_objects_name;
+ wrap_objects_description.lib_path = TEST_LAYER_WRAP_OBJECTS;
+
+ ManifestLayer wrap_objects_layer;
+ wrap_objects_layer.layers.push_back(wrap_objects_description);
+ env->AddExplicitLayer(wrap_objects_layer, "wrap_objects_layer.json");
+
+ driver.physical_devices.emplace_back("physical_device_0");
+ MockQueueFamilyProperties family_props{{VK_QUEUE_GRAPHICS_BIT, 1, 0, {1, 1, 1}}, true};
+ driver.physical_devices.back().queue_family_properties.push_back(family_props);
+
+ InstWrapper instance(env->vulkan_functions);
+ instance.create_info.add_extension("VK_EXT_debug_utils");
+ instance.create_info.add_layer(wrap_objects_name);
+ instance.CheckCreate();
+
+ VkDebugUtilsMessengerCreateInfoEXT debug_messenger_create_info = {};
+ debug_messenger_create_info.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT;
+ debug_messenger_create_info.pNext = nullptr;
+ debug_messenger_create_info.messageSeverity = VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT;
+ debug_messenger_create_info.messageType =
+ VK_DEBUG_UTILS_MESSAGE_TYPE_GENERAL_BIT_EXT | VK_DEBUG_UTILS_MESSAGE_TYPE_VALIDATION_BIT_EXT;
+ debug_messenger_create_info.pfnUserCallback = reinterpret_cast<PFN_vkDebugUtilsMessengerCallbackEXT>(JunkDebugUtilsCallback);
+ VkDebugUtilsMessengerEXT messenger = VK_NULL_HANDLE;
+ PFN_vkCreateDebugUtilsMessengerEXT pfn_CreateMessenger = reinterpret_cast<PFN_vkCreateDebugUtilsMessengerEXT>(
+ env->vulkan_functions.vkGetInstanceProcAddr(instance, "vkCreateDebugUtilsMessengerEXT"));
+ ASSERT_NE(pfn_CreateMessenger, nullptr);
+ PFN_vkDestroyDebugUtilsMessengerEXT pfn_DestroyMessenger = reinterpret_cast<PFN_vkDestroyDebugUtilsMessengerEXT>(
+ env->vulkan_functions.vkGetInstanceProcAddr(instance, "vkDestroyDebugUtilsMessengerEXT"));
+ ASSERT_NE(pfn_DestroyMessenger, nullptr);
+ ASSERT_EQ(VK_SUCCESS, pfn_CreateMessenger(instance, &debug_messenger_create_info, nullptr, &messenger));
+ pfn_DestroyMessenger(instance, messenger, nullptr);
+}
+#endif
\ No newline at end of file