aboutsummaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan/anv_wsi_wayland.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/intel/vulkan/anv_wsi_wayland.c')
-rw-r--r--src/intel/vulkan/anv_wsi_wayland.c34
1 files changed, 23 insertions, 11 deletions
diff --git a/src/intel/vulkan/anv_wsi_wayland.c b/src/intel/vulkan/anv_wsi_wayland.c
index 16a96470fa0..fe43eb16220 100644
--- a/src/intel/vulkan/anv_wsi_wayland.c
+++ b/src/intel/vulkan/anv_wsi_wayland.c
@@ -422,20 +422,14 @@ wsi_wl_surface_get_present_modes(VkIcdSurfaceBase *surface,
return VK_SUCCESS;
}
-VkResult anv_CreateWaylandSurfaceKHR(
- VkInstance _instance,
- const VkWaylandSurfaceCreateInfoKHR* pCreateInfo,
- const VkAllocationCallbacks* pAllocator,
- VkSurfaceKHR* pSurface)
+static VkResult anv_create_wl_surface(const VkAllocationCallbacks *pAllocator,
+ const VkWaylandSurfaceCreateInfoKHR *pCreateInfo,
+ VkSurfaceKHR *pSurface)
{
- ANV_FROM_HANDLE(anv_instance, instance, _instance);
-
- assert(pCreateInfo->sType == VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR);
-
VkIcdSurfaceWayland *surface;
- surface = vk_alloc2(&instance->alloc, pAllocator, sizeof *surface, 8,
- VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
+ surface = vk_alloc(pAllocator, sizeof *surface, 8,
+ VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if (surface == NULL)
return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);
@@ -448,6 +442,24 @@ VkResult anv_CreateWaylandSurfaceKHR(
return VK_SUCCESS;
}
+VkResult anv_CreateWaylandSurfaceKHR(
+ VkInstance _instance,
+ const VkWaylandSurfaceCreateInfoKHR* pCreateInfo,
+ const VkAllocationCallbacks* pAllocator,
+ VkSurfaceKHR* pSurface)
+{
+ ANV_FROM_HANDLE(anv_instance, instance, _instance);
+ const VkAllocationCallbacks *alloc;
+ assert(pCreateInfo->sType == VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR);
+
+ if (pAllocator)
+ alloc = pAllocator;
+ else
+ alloc = &instance->alloc;
+
+ return anv_create_wl_surface(alloc, pCreateInfo, pSurface);
+}
+
struct wsi_wl_image {
VkImage image;
VkDeviceMemory memory;