winevulkan: Implement VK_EXT_host_query_reset.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
bea86f0180
commit
d71532df22
|
@ -109,7 +109,6 @@ BLACKLISTED_EXTENSIONS = [
|
|||
"VK_EXT_external_memory_dma_buf", # Linux specific
|
||||
"VK_EXT_full_screen_exclusive",
|
||||
"VK_EXT_hdr_metadata", # Needs WSI work.
|
||||
"VK_EXT_host_query_reset",
|
||||
"VK_EXT_image_drm_format_modifier",
|
||||
"VK_EXT_memory_priority",
|
||||
"VK_EXT_pipeline_creation_feedback",
|
||||
|
|
|
@ -207,7 +207,7 @@ static struct VkQueue_T *wine_vk_device_alloc_queues(struct VkDevice_T *device,
|
|||
return queues;
|
||||
}
|
||||
|
||||
static VkDeviceGroupDeviceCreateInfo *convert_VkDeviceGroupDeviceCreateInfo(const void *src)
|
||||
static void *convert_VkDeviceGroupDeviceCreateInfo(const void *src)
|
||||
{
|
||||
const VkDeviceGroupDeviceCreateInfo *in = src;
|
||||
VkDeviceGroupDeviceCreateInfo *out;
|
||||
|
@ -218,6 +218,7 @@ static VkDeviceGroupDeviceCreateInfo *convert_VkDeviceGroupDeviceCreateInfo(cons
|
|||
return NULL;
|
||||
|
||||
*out = *in;
|
||||
out->pNext = NULL;
|
||||
if (!(physical_devices = heap_calloc(in->physicalDeviceCount, sizeof(*physical_devices))))
|
||||
{
|
||||
heap_free(out);
|
||||
|
@ -230,6 +231,37 @@ static VkDeviceGroupDeviceCreateInfo *convert_VkDeviceGroupDeviceCreateInfo(cons
|
|||
return out;
|
||||
}
|
||||
|
||||
static void *convert_VkPhysicalDeviceHostQueryResetFeaturesEXT(const void *src)
|
||||
{
|
||||
const VkPhysicalDeviceHostQueryResetFeaturesEXT *in = src;
|
||||
VkPhysicalDeviceHostQueryResetFeaturesEXT *out;
|
||||
|
||||
if (!(out = heap_alloc(sizeof(*out))))
|
||||
return NULL;
|
||||
|
||||
*out = *in;
|
||||
out->pNext = NULL;
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
static void wine_vk_device_free_create_info(VkDeviceCreateInfo *create_info)
|
||||
{
|
||||
VkPhysicalDeviceHostQueryResetFeaturesEXT *host_query_reset_features;
|
||||
VkDeviceGroupDeviceCreateInfo *group_info;
|
||||
|
||||
group_info = wine_vk_find_struct(create_info, DEVICE_GROUP_DEVICE_CREATE_INFO);
|
||||
host_query_reset_features = wine_vk_find_struct(create_info, PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES_EXT);
|
||||
create_info->pNext = NULL;
|
||||
|
||||
if (group_info)
|
||||
{
|
||||
heap_free((void *)group_info->pPhysicalDevices);
|
||||
heap_free(group_info);
|
||||
}
|
||||
heap_free(host_query_reset_features);
|
||||
}
|
||||
|
||||
static VkResult wine_vk_device_convert_create_info(const VkDeviceCreateInfo *src,
|
||||
VkDeviceCreateInfo *dst)
|
||||
{
|
||||
|
@ -244,8 +276,10 @@ static VkResult wine_vk_device_convert_create_info(const VkDeviceCreateInfo *src
|
|||
if (src->pNext)
|
||||
{
|
||||
const VkBaseInStructure *header;
|
||||
VkBaseOutStructure *dst_header;
|
||||
|
||||
dst->pNext = NULL;
|
||||
dst_header = (VkBaseOutStructure *)dst;
|
||||
for (header = src->pNext; header; header = header->pNext)
|
||||
{
|
||||
switch (header->sType)
|
||||
|
@ -257,8 +291,15 @@ static VkResult wine_vk_device_convert_create_info(const VkDeviceCreateInfo *src
|
|||
break;
|
||||
|
||||
case VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO:
|
||||
if (!(dst->pNext = convert_VkDeviceGroupDeviceCreateInfo(header)))
|
||||
return VK_ERROR_OUT_OF_HOST_MEMORY;
|
||||
if (!(dst_header->pNext = convert_VkDeviceGroupDeviceCreateInfo(header)))
|
||||
goto err;
|
||||
dst_header = dst_header->pNext;
|
||||
break;
|
||||
|
||||
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES_EXT:
|
||||
if (!(dst_header->pNext = convert_VkPhysicalDeviceHostQueryResetFeaturesEXT(header)))
|
||||
goto err;
|
||||
dst_header = dst_header->pNext;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -284,19 +325,10 @@ static VkResult wine_vk_device_convert_create_info(const VkDeviceCreateInfo *src
|
|||
}
|
||||
|
||||
return VK_SUCCESS;
|
||||
}
|
||||
|
||||
static void wine_vk_device_free_create_info(VkDeviceCreateInfo *create_info)
|
||||
{
|
||||
VkDeviceGroupDeviceCreateInfo *group_info;
|
||||
|
||||
if ((group_info = wine_vk_find_struct(create_info, DEVICE_GROUP_DEVICE_CREATE_INFO)))
|
||||
{
|
||||
heap_free((void *)group_info->pPhysicalDevices);
|
||||
heap_free(group_info);
|
||||
}
|
||||
|
||||
create_info->pNext = NULL;
|
||||
err:
|
||||
wine_vk_device_free_create_info(dst);
|
||||
return VK_ERROR_OUT_OF_HOST_MEMORY;
|
||||
}
|
||||
|
||||
/* Helper function used for freeing a device structure. This function supports full
|
||||
|
|
|
@ -3252,6 +3252,12 @@ VkResult WINAPI wine_vkResetFences(VkDevice device, uint32_t fenceCount, const V
|
|||
return device->funcs.p_vkResetFences(device->device, fenceCount, pFences);
|
||||
}
|
||||
|
||||
static void WINAPI wine_vkResetQueryPoolEXT(VkDevice device, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount)
|
||||
{
|
||||
TRACE("%p, 0x%s, %u, %u\n", device, wine_dbgstr_longlong(queryPool), firstQuery, queryCount);
|
||||
device->funcs.p_vkResetQueryPoolEXT(device->device, queryPool, firstQuery, queryCount);
|
||||
}
|
||||
|
||||
VkResult WINAPI wine_vkSetEvent(VkDevice device, VkEvent event)
|
||||
{
|
||||
TRACE("%p, 0x%s\n", device, wine_dbgstr_longlong(event));
|
||||
|
@ -3516,6 +3522,7 @@ static const struct vulkan_func vk_device_dispatch_table[] =
|
|||
{"vkResetDescriptorPool", &wine_vkResetDescriptorPool},
|
||||
{"vkResetEvent", &wine_vkResetEvent},
|
||||
{"vkResetFences", &wine_vkResetFences},
|
||||
{"vkResetQueryPoolEXT", &wine_vkResetQueryPoolEXT},
|
||||
{"vkSetEvent", &wine_vkSetEvent},
|
||||
{"vkTrimCommandPool", &wine_vkTrimCommandPool},
|
||||
{"vkTrimCommandPoolKHR", &wine_vkTrimCommandPoolKHR},
|
||||
|
@ -3625,6 +3632,7 @@ static const char * const vk_device_extensions[] =
|
|||
"VK_EXT_filter_cubic",
|
||||
"VK_EXT_fragment_density_map",
|
||||
"VK_EXT_global_priority",
|
||||
"VK_EXT_host_query_reset",
|
||||
"VK_EXT_inline_uniform_block",
|
||||
"VK_EXT_memory_budget",
|
||||
"VK_EXT_pci_bus_info",
|
||||
|
|
|
@ -1136,6 +1136,7 @@ struct vulkan_device_funcs
|
|||
VkResult (*p_vkResetDescriptorPool)(VkDevice, VkDescriptorPool, VkDescriptorPoolResetFlags);
|
||||
VkResult (*p_vkResetEvent)(VkDevice, VkEvent);
|
||||
VkResult (*p_vkResetFences)(VkDevice, uint32_t, const VkFence *);
|
||||
void (*p_vkResetQueryPoolEXT)(VkDevice, VkQueryPool, uint32_t, uint32_t);
|
||||
VkResult (*p_vkSetEvent)(VkDevice, VkEvent);
|
||||
void (*p_vkTrimCommandPool)(VkDevice, VkCommandPool, VkCommandPoolTrimFlags);
|
||||
void (*p_vkTrimCommandPoolKHR)(VkDevice, VkCommandPool, VkCommandPoolTrimFlags);
|
||||
|
@ -1428,6 +1429,7 @@ struct vulkan_instance_funcs
|
|||
USE_VK_FUNC(vkResetDescriptorPool) \
|
||||
USE_VK_FUNC(vkResetEvent) \
|
||||
USE_VK_FUNC(vkResetFences) \
|
||||
USE_VK_FUNC(vkResetQueryPoolEXT) \
|
||||
USE_VK_FUNC(vkSetEvent) \
|
||||
USE_VK_FUNC(vkTrimCommandPool) \
|
||||
USE_VK_FUNC(vkTrimCommandPoolKHR) \
|
||||
|
|
|
@ -288,6 +288,8 @@
|
|||
#define VK_EXT_BUFFER_DEVICE_ADDRESS_EXTENSION_NAME "VK_EXT_buffer_device_address"
|
||||
#define VK_EXT_SEPARATE_STENCIL_USAGE_SPEC_VERSION 1
|
||||
#define VK_EXT_SEPARATE_STENCIL_USAGE_EXTENSION_NAME "VK_EXT_separate_stencil_usage"
|
||||
#define VK_EXT_HOST_QUERY_RESET_SPEC_VERSION 1
|
||||
#define VK_EXT_HOST_QUERY_RESET_EXTENSION_NAME "VK_EXT_host_query_reset"
|
||||
|
||||
#define VK_MAKE_VERSION(major, minor, patch) \
|
||||
(((major) << 22) | ((minor) << 12) | (patch))
|
||||
|
@ -2078,6 +2080,7 @@ typedef enum VkStructureType
|
|||
VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO_EXT = 1000244001,
|
||||
VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_CREATE_INFO_EXT = 1000244002,
|
||||
VK_STRUCTURE_TYPE_IMAGE_STENCIL_USAGE_CREATE_INFO_EXT = 1000246000,
|
||||
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES_EXT = 1000261000,
|
||||
VK_STRUCTURE_TYPE_MAX_ENUM = 0x7fffffff,
|
||||
} VkStructureType;
|
||||
|
||||
|
@ -4214,6 +4217,13 @@ typedef struct VkPhysicalDeviceFragmentDensityMapFeaturesEXT
|
|||
VkBool32 fragmentDensityMapNonSubsampledImages;
|
||||
} VkPhysicalDeviceFragmentDensityMapFeaturesEXT;
|
||||
|
||||
typedef struct VkPhysicalDeviceHostQueryResetFeaturesEXT
|
||||
{
|
||||
VkStructureType sType;
|
||||
void *pNext;
|
||||
VkBool32 hostQueryReset;
|
||||
} VkPhysicalDeviceHostQueryResetFeaturesEXT;
|
||||
|
||||
typedef struct VkPhysicalDeviceInlineUniformBlockPropertiesEXT
|
||||
{
|
||||
VkStructureType sType;
|
||||
|
@ -5431,6 +5441,7 @@ typedef VkResult (VKAPI_PTR *PFN_vkResetCommandPool)(VkDevice, VkCommandPool, Vk
|
|||
typedef VkResult (VKAPI_PTR *PFN_vkResetDescriptorPool)(VkDevice, VkDescriptorPool, VkDescriptorPoolResetFlags);
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkResetEvent)(VkDevice, VkEvent);
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkResetFences)(VkDevice, uint32_t, const VkFence *);
|
||||
typedef void (VKAPI_PTR *PFN_vkResetQueryPoolEXT)(VkDevice, VkQueryPool, uint32_t, uint32_t);
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkSetEvent)(VkDevice, VkEvent);
|
||||
typedef void (VKAPI_PTR *PFN_vkTrimCommandPool)(VkDevice, VkCommandPool, VkCommandPoolTrimFlags);
|
||||
typedef void (VKAPI_PTR *PFN_vkTrimCommandPoolKHR)(VkDevice, VkCommandPool, VkCommandPoolTrimFlags);
|
||||
|
@ -5684,6 +5695,7 @@ VkResult VKAPI_CALL vkResetCommandPool(VkDevice device, VkCommandPool commandPoo
|
|||
VkResult VKAPI_CALL vkResetDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool, VkDescriptorPoolResetFlags flags);
|
||||
VkResult VKAPI_CALL vkResetEvent(VkDevice device, VkEvent event);
|
||||
VkResult VKAPI_CALL vkResetFences(VkDevice device, uint32_t fenceCount, const VkFence *pFences);
|
||||
void VKAPI_CALL vkResetQueryPoolEXT(VkDevice device, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount);
|
||||
VkResult VKAPI_CALL vkSetEvent(VkDevice device, VkEvent event);
|
||||
void VKAPI_CALL vkTrimCommandPool(VkDevice device, VkCommandPool commandPool, VkCommandPoolTrimFlags flags);
|
||||
void VKAPI_CALL vkTrimCommandPoolKHR(VkDevice device, VkCommandPool commandPool, VkCommandPoolTrimFlags flags);
|
||||
|
|
Loading…
Reference in New Issue