winevulkan: Don't use vulkan_private.h in loader.c.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2021-04-19 14:15:10 +02:00 committed by Alexandre Julliard
parent 171fe51b79
commit bd5408493a
4 changed files with 31 additions and 27 deletions

View File

@ -28,7 +28,7 @@
#include "devguid.h"
#include "setupapi.h"
#include "vulkan_private.h"
#include "vulkan_loader.h"
WINE_DEFAULT_DEBUG_CHANNEL(vulkan);
@ -159,7 +159,7 @@ PFN_vkVoidFunction WINAPI wine_vkGetDeviceProcAddr(VkDevice device, const char *
* https://github.com/KhronosGroup/Vulkan-LoaderAndValidationLayers/issues/2323
* https://github.com/KhronosGroup/Vulkan-Docs/issues/655
*/
if (device->quirks & WINEVULKAN_QUIRK_GET_DEVICE_PROC_ADDR
if (((struct wine_vk_device_base *)device)->quirks & WINEVULKAN_QUIRK_GET_DEVICE_PROC_ADDR
&& ((func = wine_vk_get_instance_proc_addr(name))
|| (func = wine_vk_get_phys_dev_proc_addr(name))))
{

View File

@ -768,7 +768,7 @@ VkResult WINAPI unix_vkCreateDevice(VkPhysicalDevice phys_dev,
if (!(object = calloc(1, sizeof(*object))))
return VK_ERROR_OUT_OF_HOST_MEMORY;
object->base.loader_magic = VULKAN_ICD_MAGIC_VALUE;
object->base.base.loader_magic = VULKAN_ICD_MAGIC_VALUE;
object->phys_dev = phys_dev;
res = wine_vk_device_convert_create_info(create_info, &create_info_host);
@ -823,7 +823,7 @@ VkResult WINAPI unix_vkCreateDevice(VkPhysicalDevice phys_dev,
next_queue += queue_count;
}
object->quirks = phys_dev->instance->quirks;
object->base.quirks = phys_dev->instance->quirks;
*device = object;
TRACE("Created device %p (native device %p).\n", object, object->device);

View File

@ -28,6 +28,32 @@
#include "loader_thunks.h"
/* Magic value defined by Vulkan ICD / Loader spec */
#define VULKAN_ICD_MAGIC_VALUE 0x01CDC0DE
#define WINEVULKAN_QUIRK_GET_DEVICE_PROC_ADDR 0x00000001
#define WINEVULKAN_QUIRK_ADJUST_MAX_IMAGE_COUNT 0x00000002
#define WINEVULKAN_QUIRK_IGNORE_EXPLICIT_LAYERS 0x00000004
/* 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
* functionality is expected.
*/
struct wine_vk_base
{
/* Special section in each dispatchable object for use by the ICD loader for
* storing dispatch tables. The start contains a magical value '0x01CDC0DE'.
*/
UINT_PTR loader_magic;
};
struct wine_vk_device_base
{
struct wine_vk_base base;
unsigned int quirks;
};
struct vulkan_func
{
const char *name;

View File

@ -32,26 +32,6 @@
#include "vulkan_loader.h"
#include "vulkan_thunks.h"
/* Magic value defined by Vulkan ICD / Loader spec */
#define VULKAN_ICD_MAGIC_VALUE 0x01CDC0DE
#define WINEVULKAN_QUIRK_GET_DEVICE_PROC_ADDR 0x00000001
#define WINEVULKAN_QUIRK_ADJUST_MAX_IMAGE_COUNT 0x00000002
#define WINEVULKAN_QUIRK_IGNORE_EXPLICIT_LAYERS 0x00000004
/* 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
* functionality is expected.
*/
struct wine_vk_base
{
/* Special section in each dispatchable object for use by the ICD loader for
* storing dispatch tables. The start contains a magical value '0x01CDC0DE'.
*/
UINT_PTR loader_magic;
};
/* Some extensions have callbacks for those we need to be able to
* get the wine wrapper for a native handle
*/
@ -74,7 +54,7 @@ struct VkCommandBuffer_T
struct VkDevice_T
{
struct wine_vk_base base;
struct wine_vk_device_base base;
struct vulkan_device_funcs funcs;
struct VkPhysicalDevice_T *phys_dev; /* parent */
VkDevice device; /* native device */
@ -82,8 +62,6 @@ struct VkDevice_T
struct VkQueue_T* queues;
uint32_t queue_count;
unsigned int quirks;
struct wine_vk_mapping mapping;
};