vulkan/wsi/win32: Delete the wrapper entrypoints
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13352>
This commit is contained in:
parent
f769f34680
commit
b79e978ae4
|
@ -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
|
||||
|
|
|
@ -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 <vulkan/vulkan_win32.h>
|
||||
|
||||
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
|
Loading…
Reference in New Issue