2018-03-01 16:37:03 +01:00
|
|
|
/* Wine Vulkan ICD private data structures
|
|
|
|
*
|
|
|
|
* Copyright 2017 Roderick Colenbrander
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __WINE_VULKAN_PRIVATE_H
|
|
|
|
#define __WINE_VULKAN_PRIVATE_H
|
|
|
|
|
2018-03-01 16:37:04 +01:00
|
|
|
#include "vulkan_thunks.h"
|
|
|
|
|
2018-03-01 16:37:03 +01:00
|
|
|
/* Magic value defined by Vulkan ICD / Loader spec */
|
|
|
|
#define VULKAN_ICD_MAGIC_VALUE 0x01CDC0DE
|
|
|
|
|
2018-03-01 16:37:04 +01:00
|
|
|
#ifndef ARRAY_SIZE
|
|
|
|
#define ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0]))
|
|
|
|
#endif
|
|
|
|
|
|
|
|
struct vulkan_func
|
|
|
|
{
|
|
|
|
const char *name;
|
|
|
|
void *func;
|
|
|
|
};
|
|
|
|
|
2018-03-01 16:37:03 +01:00
|
|
|
/* 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 VkInstance_T
|
|
|
|
{
|
|
|
|
struct wine_vk_base base;
|
2018-03-02 07:13:35 +01:00
|
|
|
struct vulkan_instance_funcs funcs;
|
2018-03-06 17:28:48 +01:00
|
|
|
|
|
|
|
/* We cache devices as we need to wrap them as they are
|
|
|
|
* dispatchable objects.
|
|
|
|
*/
|
|
|
|
uint32_t num_phys_devs;
|
|
|
|
struct VkPhysicalDevice_T **phys_devs;
|
|
|
|
|
2018-03-01 16:37:03 +01:00
|
|
|
VkInstance instance; /* native instance */
|
|
|
|
};
|
|
|
|
|
2018-03-06 17:28:48 +01:00
|
|
|
struct VkPhysicalDevice_T
|
|
|
|
{
|
|
|
|
struct wine_vk_base base;
|
|
|
|
struct VkInstance_T *instance; /* parent */
|
|
|
|
VkPhysicalDevice phys_dev; /* native physical device */
|
|
|
|
};
|
|
|
|
|
2018-03-01 16:37:03 +01:00
|
|
|
#endif /* __WINE_VULKAN_PRIVATE_H */
|