Commit 8a984080 authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

winevulkan: Remove now unnecessary vkGetPhysicalDeviceSurfaceFormats2KHR driver entry.

parent 64ced5a3
......@@ -86,7 +86,6 @@ static VkResult (*pvkEnumerateInstanceExtensionProperties)(const char *, uint32_
static void * (*pvkGetDeviceProcAddr)(VkDevice, const char *);
static void * (*pvkGetInstanceProcAddr)(VkInstance, const char *);
static VkResult (*pvkGetPhysicalDeviceSurfaceCapabilities2KHR)(VkPhysicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR *, VkSurfaceCapabilities2KHR *);
static VkResult (*pvkGetPhysicalDeviceSurfaceFormats2KHR)(VkPhysicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR *, uint32_t *, VkSurfaceFormat2KHR *);
static VkResult (*pvkGetPhysicalDeviceSurfaceFormatsKHR)(VkPhysicalDevice, VkSurfaceKHR, uint32_t *, VkSurfaceFormatKHR *);
static VkResult (*pvkGetSwapchainImagesKHR)(VkDevice, VkSwapchainKHR, uint32_t *, VkImage *);
static VkResult (*pvkQueuePresentKHR)(VkQueue, const VkPresentInfoKHR *);
......@@ -120,7 +119,6 @@ static void wine_vk_init(void)
LOAD_FUNCPTR(vkEnumerateInstanceExtensionProperties)
LOAD_FUNCPTR(vkGetDeviceProcAddr)
LOAD_FUNCPTR(vkGetInstanceProcAddr)
LOAD_FUNCPTR(vkGetPhysicalDeviceSurfaceFormats2KHR)
LOAD_FUNCPTR(vkGetPhysicalDeviceSurfaceFormatsKHR)
LOAD_FUNCPTR(vkGetSwapchainImagesKHR)
LOAD_FUNCPTR(vkQueuePresentKHR)
......@@ -459,19 +457,6 @@ static void *macdrv_vkGetInstanceProcAddr(VkInstance instance, const char *name)
return pvkGetInstanceProcAddr(instance, name);
}
static VkResult macdrv_vkGetPhysicalDeviceSurfaceFormats2KHR(VkPhysicalDevice phys_dev,
const VkPhysicalDeviceSurfaceInfo2KHR *surface_info, uint32_t *count, VkSurfaceFormat2KHR *formats)
{
VkPhysicalDeviceSurfaceInfo2KHR surface_info_host;
TRACE("%p, %p, %p, %p\n", phys_dev, surface_info, count, formats);
surface_info_host = *surface_info;
surface_info_host.surface = surface_from_handle(surface_info->surface)->host_surface;
return pvkGetPhysicalDeviceSurfaceFormats2KHR(phys_dev, &surface_info_host, count, formats);
}
static VkResult macdrv_vkGetPhysicalDeviceSurfaceFormatsKHR(VkPhysicalDevice phys_dev,
VkSurfaceKHR surface, uint32_t *count, VkSurfaceFormatKHR *formats)
{
......@@ -547,7 +532,6 @@ static const struct vulkan_funcs vulkan_funcs =
macdrv_vkEnumerateInstanceExtensionProperties,
macdrv_vkGetDeviceProcAddr,
macdrv_vkGetInstanceProcAddr,
macdrv_vkGetPhysicalDeviceSurfaceFormats2KHR,
macdrv_vkGetPhysicalDeviceSurfaceFormatsKHR,
macdrv_vkGetPhysicalDeviceWin32PresentationSupportKHR,
macdrv_vkGetSwapchainImagesKHR,
......
......@@ -160,7 +160,7 @@ PERF_CRITICAL_FUNCTIONS = [
# Functions part of our winevulkan graphics driver interface.
# DRIVER_VERSION should be bumped on any change to driver interface
# in FUNCTION_OVERRIDES
DRIVER_VERSION = 17
DRIVER_VERSION = 18
# Table of functions for which we have a special implementation.
# These are regular device / instance functions for which we need
......@@ -203,7 +203,6 @@ USER_DRIVER_FUNCS = {
"vkEnumerateInstanceExtensionProperties",
"vkGetDeviceProcAddr",
"vkGetInstanceProcAddr",
"vkGetPhysicalDeviceSurfaceFormats2KHR",
"vkGetPhysicalDeviceSurfaceFormatsKHR",
"vkGetPhysicalDeviceWin32PresentationSupportKHR",
"vkGetSwapchainImagesKHR",
......
......@@ -1983,7 +1983,7 @@ VkResult wine_vkGetPhysicalDeviceSurfaceFormats2KHR(VkPhysicalDevice device_hand
return res;
}
surface_info_host.surface = surface->driver_surface;
surface_info_host.surface = surface->host_surface;
return instance->funcs.p_vkGetPhysicalDeviceSurfaceFormats2KHR(physical_device->host_physical_device,
&surface_info_host, format_count, formats);
......
......@@ -60,7 +60,6 @@ static void (*pvkDestroySwapchainKHR)(VkDevice, VkSwapchainKHR, const VkAllocati
static VkResult (*pvkEnumerateInstanceExtensionProperties)(const char *, uint32_t *, VkExtensionProperties *);
static void * (*pvkGetDeviceProcAddr)(VkDevice, const char *);
static void * (*pvkGetInstanceProcAddr)(VkInstance, const char *);
static VkResult (*pvkGetPhysicalDeviceSurfaceFormats2KHR)(VkPhysicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR *, uint32_t *, VkSurfaceFormat2KHR *);
static VkResult (*pvkGetPhysicalDeviceSurfaceFormatsKHR)(VkPhysicalDevice, VkSurfaceKHR, uint32_t *, VkSurfaceFormatKHR *);
static VkBool32 (*pvkGetPhysicalDeviceWaylandPresentationSupportKHR)(VkPhysicalDevice, uint32_t, struct wl_display *);
static VkResult (*pvkGetSwapchainImagesKHR)(VkDevice, VkSwapchainKHR, uint32_t *, VkImage *);
......@@ -534,56 +533,6 @@ static void *wayland_vkGetInstanceProcAddr(VkInstance instance, const char *name
return pvkGetInstanceProcAddr(instance, name);
}
static VkResult wayland_vkGetPhysicalDeviceSurfaceFormats2KHR(VkPhysicalDevice phys_dev,
const VkPhysicalDeviceSurfaceInfo2KHR *surface_info,
uint32_t *count,
VkSurfaceFormat2KHR *formats)
{
struct wine_vk_surface *wine_vk_surface = wine_vk_surface_from_handle(surface_info->surface);
VkPhysicalDeviceSurfaceInfo2KHR surface_info_host;
VkSurfaceFormatKHR *formats_host;
uint32_t i;
VkResult result;
TRACE("%p, %p, %p, %p\n", phys_dev, surface_info, count, formats);
surface_info_host = *surface_info;
surface_info_host.surface = wine_vk_surface->host_surface;
if (pvkGetPhysicalDeviceSurfaceFormats2KHR)
{
return pvkGetPhysicalDeviceSurfaceFormats2KHR(phys_dev, &surface_info_host,
count, formats);
}
/* Until the loader version exporting this function is common, emulate it
* using the older non-2 version. */
if (surface_info->pNext)
{
FIXME("Emulating vkGetPhysicalDeviceSurfaceFormats2KHR with "
"vkGetPhysicalDeviceSurfaceFormatsKHR, pNext is ignored.\n");
}
if (!formats)
{
return pvkGetPhysicalDeviceSurfaceFormatsKHR(phys_dev, surface_info_host.surface,
count, NULL);
}
formats_host = calloc(*count, sizeof(*formats_host));
if (!formats_host) return VK_ERROR_OUT_OF_HOST_MEMORY;
result = pvkGetPhysicalDeviceSurfaceFormatsKHR(phys_dev, surface_info_host.surface,
count, formats_host);
if (result == VK_SUCCESS || result == VK_INCOMPLETE)
{
for (i = 0; i < *count; i++)
formats[i].surfaceFormat = formats_host[i];
}
free(formats_host);
return result;
}
static VkResult wayland_vkGetPhysicalDeviceSurfaceFormatsKHR(VkPhysicalDevice phys_dev,
VkSurfaceKHR surface,
uint32_t *count,
......@@ -649,7 +598,6 @@ static void wine_vk_init(void)
LOAD_FUNCPTR(vkEnumerateInstanceExtensionProperties);
LOAD_FUNCPTR(vkGetDeviceProcAddr);
LOAD_FUNCPTR(vkGetInstanceProcAddr);
LOAD_OPTIONAL_FUNCPTR(vkGetPhysicalDeviceSurfaceFormats2KHR);
LOAD_FUNCPTR(vkGetPhysicalDeviceSurfaceFormatsKHR);
LOAD_FUNCPTR(vkGetPhysicalDeviceWaylandPresentationSupportKHR);
LOAD_FUNCPTR(vkGetSwapchainImagesKHR);
......@@ -675,7 +623,6 @@ static const struct vulkan_funcs vulkan_funcs =
.p_vkEnumerateInstanceExtensionProperties = wayland_vkEnumerateInstanceExtensionProperties,
.p_vkGetDeviceProcAddr = wayland_vkGetDeviceProcAddr,
.p_vkGetInstanceProcAddr = wayland_vkGetInstanceProcAddr,
.p_vkGetPhysicalDeviceSurfaceFormats2KHR = wayland_vkGetPhysicalDeviceSurfaceFormats2KHR,
.p_vkGetPhysicalDeviceSurfaceFormatsKHR = wayland_vkGetPhysicalDeviceSurfaceFormatsKHR,
.p_vkGetPhysicalDeviceWin32PresentationSupportKHR = wayland_vkGetPhysicalDeviceWin32PresentationSupportKHR,
.p_vkGetSwapchainImagesKHR = wayland_vkGetSwapchainImagesKHR,
......
......@@ -83,7 +83,6 @@ static void (*pvkDestroySwapchainKHR)(VkDevice, VkSwapchainKHR, const VkAllocati
static VkResult (*pvkEnumerateInstanceExtensionProperties)(const char *, uint32_t *, VkExtensionProperties *);
static void * (*pvkGetDeviceProcAddr)(VkDevice, const char *);
static void * (*pvkGetInstanceProcAddr)(VkInstance, const char *);
static VkResult (*pvkGetPhysicalDeviceSurfaceFormats2KHR)(VkPhysicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR *, uint32_t *, VkSurfaceFormat2KHR *);
static VkResult (*pvkGetPhysicalDeviceSurfaceFormatsKHR)(VkPhysicalDevice, VkSurfaceKHR, uint32_t *, VkSurfaceFormatKHR *);
static VkBool32 (*pvkGetPhysicalDeviceXlibPresentationSupportKHR)(VkPhysicalDevice, uint32_t, Display *, VisualID);
static VkResult (*pvkGetSwapchainImagesKHR)(VkDevice, VkSwapchainKHR, uint32_t *, VkImage *);
......@@ -120,7 +119,6 @@ static void wine_vk_init(void)
LOAD_FUNCPTR(vkEnumerateInstanceExtensionProperties);
LOAD_FUNCPTR(vkGetDeviceProcAddr);
LOAD_FUNCPTR(vkGetInstanceProcAddr);
LOAD_OPTIONAL_FUNCPTR(vkGetPhysicalDeviceSurfaceFormats2KHR);
LOAD_FUNCPTR(vkGetPhysicalDeviceSurfaceFormatsKHR);
LOAD_FUNCPTR(vkGetPhysicalDeviceXlibPresentationSupportKHR);
LOAD_FUNCPTR(vkGetSwapchainImagesKHR);
......@@ -475,41 +473,6 @@ static void *X11DRV_vkGetInstanceProcAddr(VkInstance instance, const char *name)
return pvkGetInstanceProcAddr(instance, name);
}
static VkResult X11DRV_vkGetPhysicalDeviceSurfaceFormats2KHR(VkPhysicalDevice phys_dev,
const VkPhysicalDeviceSurfaceInfo2KHR *surface_info, uint32_t *count, VkSurfaceFormat2KHR *formats)
{
VkPhysicalDeviceSurfaceInfo2KHR surface_info_host = *surface_info;
VkSurfaceFormatKHR *formats_host;
uint32_t i;
VkResult result;
TRACE("%p, %p, %p, %p\n", phys_dev, surface_info, count, formats);
surface_info_host = *surface_info;
surface_info_host.surface = surface_from_handle( surface_info->surface )->host_surface;
if (pvkGetPhysicalDeviceSurfaceFormats2KHR)
return pvkGetPhysicalDeviceSurfaceFormats2KHR(phys_dev, &surface_info_host, count, formats);
/* Until the loader version exporting this function is common, emulate it using the older non-2 version. */
if (surface_info->pNext)
FIXME("Emulating vkGetPhysicalDeviceSurfaceFormats2KHR with vkGetPhysicalDeviceSurfaceFormatsKHR, pNext is ignored.\n");
if (!formats)
return pvkGetPhysicalDeviceSurfaceFormatsKHR(phys_dev, surface_info_host.surface, count, NULL);
formats_host = calloc(*count, sizeof(*formats_host));
if (!formats_host) return VK_ERROR_OUT_OF_HOST_MEMORY;
result = pvkGetPhysicalDeviceSurfaceFormatsKHR(phys_dev, surface_info_host.surface, count, formats_host);
if (result == VK_SUCCESS || result == VK_INCOMPLETE)
{
for (i = 0; i < *count; i++)
formats[i].surfaceFormat = formats_host[i];
}
free(formats_host);
return result;
}
static VkResult X11DRV_vkGetPhysicalDeviceSurfaceFormatsKHR(VkPhysicalDevice phys_dev,
VkSurfaceKHR surface, uint32_t *count, VkSurfaceFormatKHR *formats)
{
......@@ -588,7 +551,6 @@ static const struct vulkan_funcs vulkan_funcs =
X11DRV_vkEnumerateInstanceExtensionProperties,
X11DRV_vkGetDeviceProcAddr,
X11DRV_vkGetInstanceProcAddr,
X11DRV_vkGetPhysicalDeviceSurfaceFormats2KHR,
X11DRV_vkGetPhysicalDeviceSurfaceFormatsKHR,
X11DRV_vkGetPhysicalDeviceWin32PresentationSupportKHR,
X11DRV_vkGetSwapchainImagesKHR,
......
......@@ -13,7 +13,7 @@
#define __WINE_VULKAN_DRIVER_H
/* Wine internal vulkan driver version, needs to be bumped upon vulkan_funcs changes. */
#define WINE_VULKAN_DRIVER_VERSION 17
#define WINE_VULKAN_DRIVER_VERSION 18
struct vulkan_funcs
{
......@@ -30,7 +30,6 @@ struct vulkan_funcs
VkResult (*p_vkEnumerateInstanceExtensionProperties)(const char *, uint32_t *, VkExtensionProperties *);
void * (*p_vkGetDeviceProcAddr)(VkDevice, const char *);
void * (*p_vkGetInstanceProcAddr)(VkInstance, const char *);
VkResult (*p_vkGetPhysicalDeviceSurfaceFormats2KHR)(VkPhysicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR *, uint32_t *, VkSurfaceFormat2KHR *);
VkResult (*p_vkGetPhysicalDeviceSurfaceFormatsKHR)(VkPhysicalDevice, VkSurfaceKHR, uint32_t *, VkSurfaceFormatKHR *);
VkBool32 (*p_vkGetPhysicalDeviceWin32PresentationSupportKHR)(VkPhysicalDevice, uint32_t);
VkResult (*p_vkGetSwapchainImagesKHR)(VkDevice, VkSwapchainKHR, uint32_t *, VkImage *);
......@@ -83,8 +82,6 @@ static inline void *get_vulkan_driver_instance_proc_addr(
return vulkan_funcs->p_vkDestroySurfaceKHR;
if (!strcmp(name, "GetInstanceProcAddr"))
return vulkan_funcs->p_vkGetInstanceProcAddr;
if (!strcmp(name, "GetPhysicalDeviceSurfaceFormats2KHR"))
return vulkan_funcs->p_vkGetPhysicalDeviceSurfaceFormats2KHR;
if (!strcmp(name, "GetPhysicalDeviceSurfaceFormatsKHR"))
return vulkan_funcs->p_vkGetPhysicalDeviceSurfaceFormatsKHR;
if (!strcmp(name, "GetPhysicalDeviceWin32PresentationSupportKHR"))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment