Commit 8e64c7bd authored by Józef Kucia's avatar Józef Kucia Committed by Alexandre Julliard

winevulkan: Autogenerate thunks for functions overridden by Wine Vulkan driver.

parent 295b6301
......@@ -141,22 +141,22 @@ FUNCTION_OVERRIDES = {
"vkQueueSubmit" : {"dispatch": True, "driver" : False, "thunk" : False},
# VK_KHR_surface
"vkDestroySurfaceKHR" : {"dispatch" : False, "driver" : True, "thunk" : False},
"vkGetPhysicalDeviceSurfaceSupportKHR" : {"dispatch" : False, "driver" : True, "thunk" : False},
"vkGetPhysicalDeviceSurfaceCapabilitiesKHR" : {"dispatch" : False, "driver" : True, "thunk" : False},
"vkGetPhysicalDeviceSurfaceFormatsKHR" : {"dispatch" : False, "driver" : True, "thunk" : False},
"vkGetPhysicalDeviceSurfacePresentModesKHR" : {"dispatch" : False, "driver" : True, "thunk" : False},
"vkDestroySurfaceKHR" : {"dispatch" : True, "driver" : True, "thunk" : True},
"vkGetPhysicalDeviceSurfaceSupportKHR" : {"dispatch" : True, "driver" : True, "thunk" : True},
"vkGetPhysicalDeviceSurfaceCapabilitiesKHR" : {"dispatch" : True, "driver" : True, "thunk" : True},
"vkGetPhysicalDeviceSurfaceFormatsKHR" : {"dispatch" : True, "driver" : True, "thunk" : True},
"vkGetPhysicalDeviceSurfacePresentModesKHR" : {"dispatch" : True, "driver" : True, "thunk" : True},
# VK_KHR_win32_surface
"vkCreateWin32SurfaceKHR" : {"dispatch" : False, "driver" : True, "thunk" : False},
"vkGetPhysicalDeviceWin32PresentationSupportKHR" : {"dispatch" : False, "driver" : True, "thunk" : False},
"vkCreateWin32SurfaceKHR" : {"dispatch" : True, "driver" : True, "thunk" : True},
"vkGetPhysicalDeviceWin32PresentationSupportKHR" : {"dispatch" : True, "driver" : True, "thunk" : True},
# VK_KHR_swapchain
"vkAcquireNextImageKHR": {"dispatch" : False, "driver" : True, "thunk" : False},
"vkCreateSwapchainKHR" : {"dispatch" : False, "driver" : True, "thunk" : False},
"vkDestroySwapchainKHR" : {"dispatch" : False, "driver" : True, "thunk" : False},
"vkGetSwapchainImagesKHR": {"dispatch" : False, "driver" : True, "thunk" : False},
"vkQueuePresentKHR": {"dispatch" : False, "driver" : True, "thunk" : False},
"vkAcquireNextImageKHR": {"dispatch" : True, "driver" : True, "thunk" : True},
"vkCreateSwapchainKHR" : {"dispatch" : True, "driver" : True, "thunk" : True},
"vkDestroySwapchainKHR" : {"dispatch" : True, "driver" : True, "thunk" : True},
"vkGetSwapchainImagesKHR": {"dispatch" : True, "driver" : True, "thunk" : True},
"vkQueuePresentKHR": {"dispatch" : True, "driver" : True, "thunk" : True},
}
......
......@@ -421,17 +421,6 @@ static void wine_vk_instance_free(struct VkInstance_T *instance)
heap_free(instance);
}
VkResult WINAPI wine_vkAcquireNextImageKHR(VkDevice device, VkSwapchainKHR swapchain,
uint64_t timeout, VkSemaphore semaphore, VkFence fence, uint32_t *image_index)
{
TRACE("%p, 0x%s, 0x%s, 0x%s, 0x%s, %p\n", device, wine_dbgstr_longlong(swapchain),
wine_dbgstr_longlong(timeout), wine_dbgstr_longlong(semaphore),
wine_dbgstr_longlong(fence), image_index);
return vk_funcs->p_vkAcquireNextImageKHR(device->device, swapchain, timeout,
semaphore, fence, image_index);
}
VkResult WINAPI wine_vkAllocateCommandBuffers(VkDevice device,
const VkCommandBufferAllocateInfo *allocate_info, VkCommandBuffer *buffers)
{
......@@ -660,72 +649,6 @@ err:
return res;
}
#if defined(USE_STRUCT_CONVERSION)
static inline void convert_VkSwapchainCreateInfoKHR_win_to_host(const VkSwapchainCreateInfoKHR *in,
VkSwapchainCreateInfoKHR_host *out)
{
if (!in) return;
out->sType = in->sType;
out->pNext = in->pNext;
out->flags = in->flags;
out->surface = in->surface;
out->minImageCount = in->minImageCount;
out->imageFormat = in->imageFormat;
out->imageColorSpace = in->imageColorSpace;
out->imageExtent = in->imageExtent;
out->imageArrayLayers = in->imageArrayLayers;
out->imageUsage = in->imageUsage;
out->imageSharingMode = in->imageSharingMode;
out->queueFamilyIndexCount = in->queueFamilyIndexCount;
out->pQueueFamilyIndices = in->pQueueFamilyIndices;
out->preTransform = in->preTransform;
out->compositeAlpha = in->compositeAlpha;
out->presentMode = in->presentMode;
out->clipped = in->clipped;
out->oldSwapchain = in->oldSwapchain;
}
#endif
VkResult WINAPI wine_vkCreateSwapchainKHR(VkDevice device,
const VkSwapchainCreateInfoKHR *create_info,
const VkAllocationCallbacks *allocator, VkSwapchainKHR *swapchain)
{
#if defined(USE_STRUCT_CONVERSION)
VkSwapchainCreateInfoKHR_host create_info_host;
TRACE("%p %p %p %p\n", device, create_info, allocator, swapchain);
if (allocator)
FIXME("Support allocation allocators\n");
convert_VkSwapchainCreateInfoKHR_win_to_host(create_info, &create_info_host);
/* Wine graphics driver only uses structs in host format. */
return vk_funcs->p_vkCreateSwapchainKHR(device->device,
(VkSwapchainCreateInfoKHR *)&create_info_host, allocator, swapchain);
#else
TRACE("%p %p %p %p\n", device, create_info, allocator, swapchain);
if (allocator)
FIXME("Support allocation allocators\n");
return vk_funcs->p_vkCreateSwapchainKHR(device->device, create_info, allocator, swapchain);
#endif
}
VkResult WINAPI wine_vkCreateWin32SurfaceKHR(VkInstance instance,
const VkWin32SurfaceCreateInfoKHR *create_info,
const VkAllocationCallbacks* allocator, VkSurfaceKHR* surface)
{
TRACE("%p %p %p %p\n", instance, create_info, allocator, surface);
if (allocator)
FIXME("Support allocation allocators\n");
return vk_funcs->p_vkCreateWin32SurfaceKHR(instance->instance, create_info,
NULL /* allocator */, surface);
}
void WINAPI wine_vkDestroyDevice(VkDevice device, const VkAllocationCallbacks *allocator)
{
TRACE("%p %p\n", device, allocator);
......@@ -746,28 +669,6 @@ void WINAPI wine_vkDestroyInstance(VkInstance instance, const VkAllocationCallba
wine_vk_instance_free(instance);
}
void WINAPI wine_vkDestroySurfaceKHR(VkInstance instance, VkSurfaceKHR surface,
const VkAllocationCallbacks *allocator)
{
TRACE("%p, 0x%s, %p\n", instance, wine_dbgstr_longlong(surface), allocator);
if (allocator)
FIXME("Support allocation allocators\n");
vk_funcs->p_vkDestroySurfaceKHR(instance->instance, surface, NULL /* allocator */);
}
void WINAPI wine_vkDestroySwapchainKHR(VkDevice device, VkSwapchainKHR swapchain,
const VkAllocationCallbacks *allocator)
{
TRACE("%p, 0x%s %p\n", device, wine_dbgstr_longlong(swapchain), allocator);
if (allocator)
FIXME("Support allocation allocators\n");
vk_funcs->p_vkDestroySwapchainKHR(device->device, swapchain, NULL /* allocator */);
}
VkResult WINAPI wine_vkEnumerateDeviceExtensionProperties(VkPhysicalDevice phys_dev,
const char *layer_name, uint32_t *count, VkExtensionProperties *properties)
{
......@@ -994,60 +895,6 @@ static PFN_vkVoidFunction WINAPI wine_vkGetInstanceProcAddr(VkInstance instance,
return NULL;
}
VkResult WINAPI wine_vkGetPhysicalDeviceSurfaceCapabilitiesKHR(VkPhysicalDevice phys_dev,
VkSurfaceKHR surface, VkSurfaceCapabilitiesKHR *capabilities)
{
TRACE("%p, 0x%s, %p\n", phys_dev, wine_dbgstr_longlong(surface), capabilities);
return vk_funcs->p_vkGetPhysicalDeviceSurfaceCapabilitiesKHR(phys_dev->phys_dev,
surface, capabilities);
}
VkResult WINAPI wine_vkGetPhysicalDeviceSurfaceFormatsKHR(VkPhysicalDevice phys_dev,
VkSurfaceKHR surface, uint32_t *format_count, VkSurfaceFormatKHR *formats)
{
TRACE("%p, 0x%s, %p, %p\n", phys_dev, wine_dbgstr_longlong(surface), format_count, formats);
return vk_funcs->p_vkGetPhysicalDeviceSurfaceFormatsKHR(phys_dev->phys_dev,
surface, format_count, formats);
}
VkResult WINAPI wine_vkGetPhysicalDeviceSurfacePresentModesKHR(VkPhysicalDevice phys_dev,
VkSurfaceKHR surface, uint32_t *mode_count, VkPresentModeKHR *modes)
{
TRACE("%p, 0x%s, %p, %p\n", phys_dev, wine_dbgstr_longlong(surface), mode_count, modes);
return vk_funcs->p_vkGetPhysicalDeviceSurfacePresentModesKHR(phys_dev->phys_dev,
surface, mode_count, modes);
}
VkResult WINAPI wine_vkGetPhysicalDeviceSurfaceSupportKHR(VkPhysicalDevice phys_dev,
uint32_t queue_family_index, VkSurfaceKHR surface, VkBool32 *supported)
{
TRACE("%p, %u, 0x%s, %p\n", phys_dev, queue_family_index, wine_dbgstr_longlong(surface), supported);
return vk_funcs->p_vkGetPhysicalDeviceSurfaceSupportKHR(phys_dev->phys_dev,
queue_family_index, surface, supported);
}
VkBool32 WINAPI wine_vkGetPhysicalDeviceWin32PresentationSupportKHR(VkPhysicalDevice phys_dev,
uint32_t queue_family_index)
{
TRACE("%p %u\n", phys_dev, queue_family_index);
return vk_funcs->p_vkGetPhysicalDeviceWin32PresentationSupportKHR(phys_dev->phys_dev,
queue_family_index);
}
VkResult WINAPI wine_vkGetSwapchainImagesKHR(VkDevice device, VkSwapchainKHR swapchain,
uint32_t *image_count, VkImage *images)
{
TRACE("%p, 0x%s %p %p\n", device, wine_dbgstr_longlong(swapchain), image_count, images);
return vk_funcs->p_vkGetSwapchainImagesKHR(device->device, swapchain,
image_count, images);
}
VkResult WINAPI wine_vkQueuePresentKHR(VkQueue queue, const VkPresentInfoKHR *present_info)
{
TRACE("%p, %p\n", queue, present_info);
return vk_funcs->p_vkQueuePresentKHR(queue->queue, present_info);
}
void * WINAPI wine_vk_icdGetInstanceProcAddr(VkInstance instance, const char *name)
{
TRACE("%p %s\n", instance, debugstr_a(name));
......
......@@ -486,6 +486,30 @@ static inline void convert_VkImageViewCreateInfo_win_to_host(const VkImageViewCr
out->subresourceRange = in->subresourceRange;
}
static inline void convert_VkSwapchainCreateInfoKHR_win_to_host(const VkSwapchainCreateInfoKHR *in, VkSwapchainCreateInfoKHR_host *out)
{
if (!in) return;
out->sType = in->sType;
out->pNext = in->pNext;
out->flags = in->flags;
out->surface = in->surface;
out->minImageCount = in->minImageCount;
out->imageFormat = in->imageFormat;
out->imageColorSpace = in->imageColorSpace;
out->imageExtent = in->imageExtent;
out->imageArrayLayers = in->imageArrayLayers;
out->imageUsage = in->imageUsage;
out->imageSharingMode = in->imageSharingMode;
out->queueFamilyIndexCount = in->queueFamilyIndexCount;
out->pQueueFamilyIndices = in->pQueueFamilyIndices;
out->preTransform = in->preTransform;
out->compositeAlpha = in->compositeAlpha;
out->presentMode = in->presentMode;
out->clipped = in->clipped;
out->oldSwapchain = in->oldSwapchain;
}
static inline VkMappedMemoryRange_host *convert_VkMappedMemoryRange_array_win_to_host(const VkMappedMemoryRange *in, uint32_t count)
{
VkMappedMemoryRange_host *out;
......@@ -968,6 +992,12 @@ static inline void free_VkCopyDescriptorSet_array(VkCopyDescriptorSet_host *in,
#endif /* USE_STRUCT_CONVERSION */
static VkResult WINAPI wine_vkAcquireNextImageKHR(VkDevice device, VkSwapchainKHR swapchain, uint64_t timeout, VkSemaphore semaphore, VkFence fence, uint32_t *pImageIndex)
{
TRACE("%p, 0x%s, 0x%s, 0x%s, 0x%s, %p\n", device, wine_dbgstr_longlong(swapchain), wine_dbgstr_longlong(timeout), wine_dbgstr_longlong(semaphore), wine_dbgstr_longlong(fence), pImageIndex);
return device->funcs.p_vkAcquireNextImageKHR(device->device, swapchain, timeout, semaphore, fence, pImageIndex);
}
static VkResult WINAPI wine_vkAllocateDescriptorSets(VkDevice device, const VkDescriptorSetAllocateInfo *pAllocateInfo, VkDescriptorSet *pDescriptorSets)
{
#if defined(USE_STRUCT_CONVERSION)
......@@ -1600,6 +1630,29 @@ static VkResult WINAPI wine_vkCreateShaderModule(VkDevice device, const VkShader
return device->funcs.p_vkCreateShaderModule(device->device, pCreateInfo, NULL, pShaderModule);
}
static VkResult WINAPI wine_vkCreateSwapchainKHR(VkDevice device, const VkSwapchainCreateInfoKHR *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkSwapchainKHR *pSwapchain)
{
#if defined(USE_STRUCT_CONVERSION)
VkResult result;
VkSwapchainCreateInfoKHR_host pCreateInfo_host;
TRACE("%p, %p, %p, %p\n", device, pCreateInfo, pAllocator, pSwapchain);
convert_VkSwapchainCreateInfoKHR_win_to_host(pCreateInfo, &pCreateInfo_host);
result = device->funcs.p_vkCreateSwapchainKHR(device->device, &pCreateInfo_host, NULL, pSwapchain);
return result;
#else
TRACE("%p, %p, %p, %p\n", device, pCreateInfo, pAllocator, pSwapchain);
return device->funcs.p_vkCreateSwapchainKHR(device->device, pCreateInfo, NULL, pSwapchain);
#endif
}
static VkResult WINAPI wine_vkCreateWin32SurfaceKHR(VkInstance instance, const VkWin32SurfaceCreateInfoKHR *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface)
{
TRACE("%p, %p, %p, %p\n", instance, pCreateInfo, pAllocator, pSurface);
return instance->funcs.p_vkCreateWin32SurfaceKHR(instance->instance, pCreateInfo, NULL, pSurface);
}
static void WINAPI wine_vkDestroyBuffer(VkDevice device, VkBuffer buffer, const VkAllocationCallbacks *pAllocator)
{
TRACE("%p, 0x%s, %p\n", device, wine_dbgstr_longlong(buffer), pAllocator);
......@@ -1714,6 +1767,18 @@ static void WINAPI wine_vkDestroyShaderModule(VkDevice device, VkShaderModule sh
device->funcs.p_vkDestroyShaderModule(device->device, shaderModule, NULL);
}
static void WINAPI wine_vkDestroySurfaceKHR(VkInstance instance, VkSurfaceKHR surface, const VkAllocationCallbacks *pAllocator)
{
TRACE("%p, 0x%s, %p\n", instance, wine_dbgstr_longlong(surface), pAllocator);
instance->funcs.p_vkDestroySurfaceKHR(instance->instance, surface, NULL);
}
static void WINAPI wine_vkDestroySwapchainKHR(VkDevice device, VkSwapchainKHR swapchain, const VkAllocationCallbacks *pAllocator)
{
TRACE("%p, 0x%s, %p\n", device, wine_dbgstr_longlong(swapchain), pAllocator);
device->funcs.p_vkDestroySwapchainKHR(device->device, swapchain, NULL);
}
static VkResult WINAPI wine_vkDeviceWaitIdle(VkDevice device)
{
TRACE("%p\n", device);
......@@ -1976,6 +2041,36 @@ static void WINAPI wine_vkGetPhysicalDeviceSparseImageFormatProperties2KHR(VkPhy
physicalDevice->instance->funcs.p_vkGetPhysicalDeviceSparseImageFormatProperties2KHR(physicalDevice->phys_dev, pFormatInfo, pPropertyCount, pProperties);
}
static VkResult WINAPI wine_vkGetPhysicalDeviceSurfaceCapabilitiesKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, VkSurfaceCapabilitiesKHR *pSurfaceCapabilities)
{
TRACE("%p, 0x%s, %p\n", physicalDevice, wine_dbgstr_longlong(surface), pSurfaceCapabilities);
return physicalDevice->instance->funcs.p_vkGetPhysicalDeviceSurfaceCapabilitiesKHR(physicalDevice->phys_dev, surface, pSurfaceCapabilities);
}
static VkResult WINAPI wine_vkGetPhysicalDeviceSurfaceFormatsKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t *pSurfaceFormatCount, VkSurfaceFormatKHR *pSurfaceFormats)
{
TRACE("%p, 0x%s, %p, %p\n", physicalDevice, wine_dbgstr_longlong(surface), pSurfaceFormatCount, pSurfaceFormats);
return physicalDevice->instance->funcs.p_vkGetPhysicalDeviceSurfaceFormatsKHR(physicalDevice->phys_dev, surface, pSurfaceFormatCount, pSurfaceFormats);
}
static VkResult WINAPI wine_vkGetPhysicalDeviceSurfacePresentModesKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t *pPresentModeCount, VkPresentModeKHR *pPresentModes)
{
TRACE("%p, 0x%s, %p, %p\n", physicalDevice, wine_dbgstr_longlong(surface), pPresentModeCount, pPresentModes);
return physicalDevice->instance->funcs.p_vkGetPhysicalDeviceSurfacePresentModesKHR(physicalDevice->phys_dev, surface, pPresentModeCount, pPresentModes);
}
static VkResult WINAPI wine_vkGetPhysicalDeviceSurfaceSupportKHR(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, VkSurfaceKHR surface, VkBool32 *pSupported)
{
TRACE("%p, %u, 0x%s, %p\n", physicalDevice, queueFamilyIndex, wine_dbgstr_longlong(surface), pSupported);
return physicalDevice->instance->funcs.p_vkGetPhysicalDeviceSurfaceSupportKHR(physicalDevice->phys_dev, queueFamilyIndex, surface, pSupported);
}
static VkBool32 WINAPI wine_vkGetPhysicalDeviceWin32PresentationSupportKHR(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex)
{
TRACE("%p, %u\n", physicalDevice, queueFamilyIndex);
return physicalDevice->instance->funcs.p_vkGetPhysicalDeviceWin32PresentationSupportKHR(physicalDevice->phys_dev, queueFamilyIndex);
}
static VkResult WINAPI wine_vkGetPipelineCacheData(VkDevice device, VkPipelineCache pipelineCache, size_t *pDataSize, void *pData)
{
TRACE("%p, 0x%s, %p, %p\n", device, wine_dbgstr_longlong(pipelineCache), pDataSize, pData);
......@@ -1994,6 +2089,12 @@ static void WINAPI wine_vkGetRenderAreaGranularity(VkDevice device, VkRenderPass
device->funcs.p_vkGetRenderAreaGranularity(device->device, renderPass, pGranularity);
}
static VkResult WINAPI wine_vkGetSwapchainImagesKHR(VkDevice device, VkSwapchainKHR swapchain, uint32_t *pSwapchainImageCount, VkImage *pSwapchainImages)
{
TRACE("%p, 0x%s, %p, %p\n", device, wine_dbgstr_longlong(swapchain), pSwapchainImageCount, pSwapchainImages);
return device->funcs.p_vkGetSwapchainImagesKHR(device->device, swapchain, pSwapchainImageCount, pSwapchainImages);
}
static VkResult WINAPI wine_vkInvalidateMappedMemoryRanges(VkDevice device, uint32_t memoryRangeCount, const VkMappedMemoryRange *pMemoryRanges)
{
#if defined(USE_STRUCT_CONVERSION)
......@@ -2042,6 +2143,12 @@ static VkResult WINAPI wine_vkQueueBindSparse(VkQueue queue, uint32_t bindInfoCo
#endif
}
static VkResult WINAPI wine_vkQueuePresentKHR(VkQueue queue, const VkPresentInfoKHR *pPresentInfo)
{
TRACE("%p, %p\n", queue, pPresentInfo);
return queue->device->funcs.p_vkQueuePresentKHR(queue->queue, pPresentInfo);
}
static VkResult WINAPI wine_vkQueueWaitIdle(VkQueue queue)
{
TRACE("%p\n", queue);
......
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