From b79e978ae48c2c4a7059a7f5eb695c6b0362ac60 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Wed, 13 Oct 2021 16:58:38 -0500 Subject: [PATCH] vulkan/wsi/win32: Delete the wrapper entrypoints Reviewed-by: Boris Brezillon Part-of: --- src/vulkan/wsi/wsi_common_win32.c | 52 +++++++++---------------------- src/vulkan/wsi/wsi_common_win32.h | 37 ---------------------- 2 files changed, 15 insertions(+), 74 deletions(-) delete mode 100644 src/vulkan/wsi/wsi_common_win32.h diff --git a/src/vulkan/wsi/wsi_common_win32.c b/src/vulkan/wsi/wsi_common_win32.c index 90456590b6f..15078485d2e 100644 --- a/src/vulkan/wsi/wsi_common_win32.c +++ b/src/vulkan/wsi/wsi_common_win32.c @@ -31,7 +31,6 @@ #include "vk_util.h" #include "wsi_common_entrypoints.h" #include "wsi_common_private.h" -#include "wsi_common_win32.h" #if defined(__GNUC__) #pragma GCC diagnostic ignored "-Wint-to-pointer-cast" // warning: cast to pointer from integer of different size @@ -70,40 +69,11 @@ struct wsi_win32_swapchain { struct wsi_win32_image images[0]; }; -VkBool32 -wsi_win32_get_presentation_support(struct wsi_device *wsi_device) -{ - return TRUE; -} - VKAPI_ATTR VkBool32 VKAPI_CALL wsi_GetPhysicalDeviceWin32PresentationSupportKHR(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex) { - VK_FROM_HANDLE(vk_physical_device, device, physicalDevice); - - return wsi_win32_get_presentation_support(device->wsi_device); -} - -VkResult -wsi_create_win32_surface(VkInstance instance, - const VkAllocationCallbacks *allocator, - const VkWin32SurfaceCreateInfoKHR *create_info, - VkSurfaceKHR *surface_khr) -{ - VkIcdSurfaceWin32 *surface = vk_zalloc(allocator, sizeof *surface, 8, - VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); - - if (surface == NULL) - return VK_ERROR_OUT_OF_HOST_MEMORY; - - surface->base.platform = VK_ICD_WSI_PLATFORM_WIN32; - - surface->hinstance = create_info->hinstance; - surface->hwnd = create_info->hwnd; - - *surface_khr = VkIcdSurfaceBase_to_handle(&surface->base); - return VK_SUCCESS; + return TRUE; } VKAPI_ATTR VkResult VKAPI_CALL @@ -113,16 +83,24 @@ wsi_CreateWin32SurfaceKHR(VkInstance _instance, VkSurfaceKHR *pSurface) { VK_FROM_HANDLE(vk_instance, instance, _instance); - const VkAllocationCallbacks *alloc; + VkIcdSurfaceWin32 *surface; assert(pCreateInfo->sType == VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR); - if (pAllocator) - alloc = pAllocator; - else - alloc = &instance->alloc; + surface = vk_zalloc2(&instance->alloc, pAllocator, sizeof(*surface), 8, + VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); - return wsi_create_win32_surface(_instance, alloc, pCreateInfo, pSurface); + if (surface == NULL) + return VK_ERROR_OUT_OF_HOST_MEMORY; + + surface->base.platform = VK_ICD_WSI_PLATFORM_WIN32; + + surface->hinstance = pCreateInfo->hinstance; + surface->hwnd = pCreateInfo->hwnd; + + *pSurface = VkIcdSurfaceBase_to_handle(&surface->base); + + return VK_SUCCESS; } static VkResult diff --git a/src/vulkan/wsi/wsi_common_win32.h b/src/vulkan/wsi/wsi_common_win32.h deleted file mode 100644 index 661ba9dea80..00000000000 --- a/src/vulkan/wsi/wsi_common_win32.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright © 2015 Intel Corporation - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice (including the next - * paragraph) shall be included in all copies or substantial portions of the - * Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - * IN THE SOFTWARE. - */ -#ifndef WSI_COMMON_WIN32_H -#define WSI_COMMON_WIN32_H - -#include "wsi_common.h" -#include - -VkBool32 -wsi_win32_get_presentation_support(struct wsi_device *wsi_device); - -VkResult -wsi_create_win32_surface(VkInstance instance, - const VkAllocationCallbacks *pAllocator, - const VkWin32SurfaceCreateInfoKHR *pCreateInfo, - VkSurfaceKHR *pSurface); -#endif