diff options
author | Chad Versace <[email protected]> | 2017-01-10 13:23:06 -0800 |
---|---|---|
committer | Emil Velikov <[email protected]> | 2017-01-24 01:13:28 +0000 |
commit | 213791e86cf52ebac09cc7b0604bed5267d50750 (patch) | |
tree | a2efe0b825db5611e6b06c1e3492a702ab80d9ab /src/intel | |
parent | 0c54aa1568256725d2f87261bc0ba55b35ced1f9 (diff) |
vulkan: Add new cast macros for VkIcd types
We can't import the latest vk_icd.h because the new header breaks the
Mesa build. This patch defines new casting macros,
ICD_DEFINE_NONDISP_HANDLE_CASTS() and ICD_FROM_HANDLE(), which can
handle both the old and new vk_icd.h, and will prevent the build from
breaking when we update the header.
In the old vk_icd.h, types were defined as:
typedef struct _VkIcdFoo {
...
} VkIcdFoo;
Commit 6ebba1f6 in the Vulkan loader changed the above to
typedef {
...
} VkIcdFoo;
because the old definitions violated the C and C++ specs. According to
the specs, identifiers that begins with an underscore followed by an
uppercase letter are reserved. (It's pedantic, I know), See the Github
issue referenced below.
References: https://github.com/KhronosGroup/Vulkan-LoaderAndValidationLayers/issues/7
References: https://github.com/KhronosGroup/Vulkan-LoaderAndValidationLayers/commit/6ebba1f630015af7a78767a15c1e74ba9b23601c
Reviewed-by: Emil Velikov <[email protected]>
Cc: [email protected]
(cherry picked from commit c085bfcec9915879e97a33c5235cf21607c72318)
Diffstat (limited to 'src/intel')
-rw-r--r-- | src/intel/vulkan/anv_wsi.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/intel/vulkan/anv_wsi.c b/src/intel/vulkan/anv_wsi.c index c504658c526..c2510f37f42 100644 --- a/src/intel/vulkan/anv_wsi.c +++ b/src/intel/vulkan/anv_wsi.c @@ -74,7 +74,7 @@ void anv_DestroySurfaceKHR( const VkAllocationCallbacks* pAllocator) { ANV_FROM_HANDLE(anv_instance, instance, _instance); - ANV_FROM_HANDLE(_VkIcdSurfaceBase, surface, _surface); + ICD_FROM_HANDLE(VkIcdSurfaceBase, surface, _surface); if (!surface) return; @@ -89,7 +89,7 @@ VkResult anv_GetPhysicalDeviceSurfaceSupportKHR( VkBool32* pSupported) { ANV_FROM_HANDLE(anv_physical_device, device, physicalDevice); - ANV_FROM_HANDLE(_VkIcdSurfaceBase, surface, _surface); + ICD_FROM_HANDLE(VkIcdSurfaceBase, surface, _surface); struct wsi_interface *iface = device->wsi_device.wsi[surface->platform]; return iface->get_support(surface, &device->wsi_device, @@ -103,7 +103,7 @@ VkResult anv_GetPhysicalDeviceSurfaceCapabilitiesKHR( VkSurfaceCapabilitiesKHR* pSurfaceCapabilities) { ANV_FROM_HANDLE(anv_physical_device, device, physicalDevice); - ANV_FROM_HANDLE(_VkIcdSurfaceBase, surface, _surface); + ICD_FROM_HANDLE(VkIcdSurfaceBase, surface, _surface); struct wsi_interface *iface = device->wsi_device.wsi[surface->platform]; return iface->get_capabilities(surface, pSurfaceCapabilities); @@ -116,7 +116,7 @@ VkResult anv_GetPhysicalDeviceSurfaceFormatsKHR( VkSurfaceFormatKHR* pSurfaceFormats) { ANV_FROM_HANDLE(anv_physical_device, device, physicalDevice); - ANV_FROM_HANDLE(_VkIcdSurfaceBase, surface, _surface); + ICD_FROM_HANDLE(VkIcdSurfaceBase, surface, _surface); struct wsi_interface *iface = device->wsi_device.wsi[surface->platform]; return iface->get_formats(surface, &device->wsi_device, pSurfaceFormatCount, @@ -130,7 +130,7 @@ VkResult anv_GetPhysicalDeviceSurfacePresentModesKHR( VkPresentModeKHR* pPresentModes) { ANV_FROM_HANDLE(anv_physical_device, device, physicalDevice); - ANV_FROM_HANDLE(_VkIcdSurfaceBase, surface, _surface); + ICD_FROM_HANDLE(VkIcdSurfaceBase, surface, _surface); struct wsi_interface *iface = device->wsi_device.wsi[surface->platform]; return iface->get_present_modes(surface, pPresentModeCount, @@ -260,7 +260,7 @@ VkResult anv_CreateSwapchainKHR( VkSwapchainKHR* pSwapchain) { ANV_FROM_HANDLE(anv_device, device, _device); - ANV_FROM_HANDLE(_VkIcdSurfaceBase, surface, pCreateInfo->surface); + ICD_FROM_HANDLE(VkIcdSurfaceBase, surface, pCreateInfo->surface); struct wsi_interface *iface = device->instance->physicalDevice.wsi_device.wsi[surface->platform]; struct wsi_swapchain *swapchain; |