Commit 586a1899 authored by Roderick Colenbrander's avatar Roderick Colenbrander Committed by Alexandre Julliard

winevulkan: Add instance funcs stubs.

parent 75b68a85
......@@ -2,6 +2,7 @@ MODULE = winevulkan.dll
IMPORTS = user32 gdi32
C_SRCS = \
vulkan.c
vulkan.c \
vulkan_thunks.c
RC_SRCS = version.rc
......@@ -38,16 +38,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(vulkan);
*/
#define WINE_VULKAN_ICD_VERSION 4
#ifndef ARRAY_SIZE
#define ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0]))
#endif
struct vulkan_func
{
const char *name;
void *func;
};
static void *wine_vk_get_global_proc_addr(const char *name);
static const struct vulkan_funcs *vk_funcs = NULL;
......@@ -148,6 +138,9 @@ static PFN_vkVoidFunction WINAPI wine_vkGetInstanceProcAddr(VkInstance instance,
return NULL;
}
func = wine_vk_get_instance_proc_addr(name);
if (func) return func;
FIXME("Unsupported device or instance function: '%s'\n", debugstr_a(name));
return NULL;
}
......
......@@ -20,9 +20,21 @@
#ifndef __WINE_VULKAN_PRIVATE_H
#define __WINE_VULKAN_PRIVATE_H
#include "vulkan_thunks.h"
/* Magic value defined by Vulkan ICD / Loader spec */
#define VULKAN_ICD_MAGIC_VALUE 0x01CDC0DE
#ifndef ARRAY_SIZE
#define ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0]))
#endif
struct vulkan_func
{
const char *name;
void *func;
};
/* Base 'class' for our Vulkan dispatchable objects such as VkDevice and VkInstance.
* This structure MUST be the first element of a dispatchable object as the ICD
* loader depends on it. For now only contains loader_magic, but over time more common
......
/* Automatically generated from Vulkan vk.xml; DO NOT EDIT! */
#include "config.h"
#include "wine/port.h"
#include "wine/debug.h"
#include "wine/vulkan.h"
#include "wine/vulkan_driver.h"
#include "vulkan_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(vulkan);
static VkResult WINAPI wine_vkCreateDevice(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkDevice *pDevice)
{
FIXME("stub: %p, %p, %p, %p\n", physicalDevice, pCreateInfo, pAllocator, pDevice);
return VK_ERROR_OUT_OF_HOST_MEMORY;
}
static void WINAPI wine_vkDestroyInstance(VkInstance instance, const VkAllocationCallbacks *pAllocator)
{
FIXME("stub: %p, %p\n", instance, pAllocator);
}
static VkResult WINAPI wine_vkEnumerateDeviceExtensionProperties(VkPhysicalDevice physicalDevice, const char *pLayerName, uint32_t *pPropertyCount, VkExtensionProperties *pProperties)
{
FIXME("stub: %p, %p, %p, %p\n", physicalDevice, pLayerName, pPropertyCount, pProperties);
return VK_ERROR_OUT_OF_HOST_MEMORY;
}
static VkResult WINAPI wine_vkEnumerateDeviceLayerProperties(VkPhysicalDevice physicalDevice, uint32_t *pPropertyCount, VkLayerProperties *pProperties)
{
FIXME("stub: %p, %p, %p\n", physicalDevice, pPropertyCount, pProperties);
return VK_ERROR_OUT_OF_HOST_MEMORY;
}
static VkResult WINAPI wine_vkEnumeratePhysicalDevices(VkInstance instance, uint32_t *pPhysicalDeviceCount, VkPhysicalDevice *pPhysicalDevices)
{
FIXME("stub: %p, %p, %p\n", instance, pPhysicalDeviceCount, pPhysicalDevices);
return VK_ERROR_OUT_OF_HOST_MEMORY;
}
static void WINAPI wine_vkGetPhysicalDeviceFeatures(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures *pFeatures)
{
FIXME("stub: %p, %p\n", physicalDevice, pFeatures);
}
static void WINAPI wine_vkGetPhysicalDeviceFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties *pFormatProperties)
{
FIXME("stub: %p, %d, %p\n", physicalDevice, format, pFormatProperties);
}
static VkResult WINAPI wine_vkGetPhysicalDeviceImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags, VkImageFormatProperties *pImageFormatProperties)
{
FIXME("stub: %p, %d, %d, %d, %#x, %#x, %p\n", physicalDevice, format, type, tiling, usage, flags, pImageFormatProperties);
return VK_ERROR_OUT_OF_HOST_MEMORY;
}
static void WINAPI wine_vkGetPhysicalDeviceMemoryProperties(VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties *pMemoryProperties)
{
FIXME("stub: %p, %p\n", physicalDevice, pMemoryProperties);
}
static void WINAPI wine_vkGetPhysicalDeviceProperties(VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties *pProperties)
{
FIXME("stub: %p, %p\n", physicalDevice, pProperties);
}
static void WINAPI wine_vkGetPhysicalDeviceQueueFamilyProperties(VkPhysicalDevice physicalDevice, uint32_t *pQueueFamilyPropertyCount, VkQueueFamilyProperties *pQueueFamilyProperties)
{
FIXME("stub: %p, %p, %p\n", physicalDevice, pQueueFamilyPropertyCount, pQueueFamilyProperties);
}
static void WINAPI wine_vkGetPhysicalDeviceSparseImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkSampleCountFlagBits samples, VkImageUsageFlags usage, VkImageTiling tiling, uint32_t *pPropertyCount, VkSparseImageFormatProperties *pProperties)
{
FIXME("stub: %p, %d, %d, %d, %#x, %d, %p, %p\n", physicalDevice, format, type, samples, usage, tiling, pPropertyCount, pProperties);
}
static const struct vulkan_func vk_instance_dispatch_table[] =
{
{"vkCreateDevice", &wine_vkCreateDevice},
{"vkDestroyInstance", &wine_vkDestroyInstance},
{"vkEnumerateDeviceExtensionProperties", &wine_vkEnumerateDeviceExtensionProperties},
{"vkEnumerateDeviceLayerProperties", &wine_vkEnumerateDeviceLayerProperties},
{"vkEnumeratePhysicalDevices", &wine_vkEnumeratePhysicalDevices},
{"vkGetPhysicalDeviceFeatures", &wine_vkGetPhysicalDeviceFeatures},
{"vkGetPhysicalDeviceFormatProperties", &wine_vkGetPhysicalDeviceFormatProperties},
{"vkGetPhysicalDeviceImageFormatProperties", &wine_vkGetPhysicalDeviceImageFormatProperties},
{"vkGetPhysicalDeviceMemoryProperties", &wine_vkGetPhysicalDeviceMemoryProperties},
{"vkGetPhysicalDeviceProperties", &wine_vkGetPhysicalDeviceProperties},
{"vkGetPhysicalDeviceQueueFamilyProperties", &wine_vkGetPhysicalDeviceQueueFamilyProperties},
{"vkGetPhysicalDeviceSparseImageFormatProperties", &wine_vkGetPhysicalDeviceSparseImageFormatProperties},
};
void *wine_vk_get_instance_proc_addr(const char *name)
{
unsigned int i;
for (i = 0; i < ARRAY_SIZE(vk_instance_dispatch_table); i++)
{
if (strcmp(vk_instance_dispatch_table[i].name, name) == 0)
{
TRACE("Found pName=%s in instance table\n", name);
return vk_instance_dispatch_table[i].func;
}
}
return NULL;
}
/* Automatically generated from Vulkan vk.xml; DO NOT EDIT! */
#ifndef __WINE_VULKAN_THUNKS_H
#define __WINE_VULKAN_THUNKS_H
/* For use by vk_icdGetInstanceProcAddr / vkGetInstanceProcAddr */
void *wine_vk_get_instance_proc_addr(const char *name) DECLSPEC_HIDDEN;
#endif /* __WINE_VULKAN_THUNKS_H */
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