Commit 6d80924a authored by Józef Kucia's avatar Józef Kucia Committed by Alexandre Julliard

winevulkan: Properly retrieve queues that were created with non-zero flags.

parent b9427efe
......@@ -161,7 +161,7 @@ FUNCTION_OVERRIDES = {
"vkFreeCommandBuffers" : {"dispatch" : True, "driver" : False, "thunk" : False},
"vkGetDeviceProcAddr" : {"dispatch" : False, "driver" : True, "thunk" : False},
"vkGetDeviceQueue" : {"dispatch": True, "driver" : False, "thunk" : False},
"vkGetDeviceQueue2" : {"dispatch": False, "driver" : False, "thunk" : False},
"vkGetDeviceQueue2" : {"dispatch": True, "driver" : False, "thunk" : False},
"vkQueueSubmit" : {"dispatch": True, "driver" : False, "thunk" : False},
# VK_KHR_surface
......
......@@ -171,6 +171,7 @@ static void wine_vk_command_buffers_free(struct VkDevice_T *device, VkCommandPoo
static struct VkQueue_T *wine_vk_device_alloc_queues(struct VkDevice_T *device,
uint32_t family_index, uint32_t queue_count, VkDeviceQueueCreateFlags flags)
{
VkDeviceQueueInfo2 queue_info;
struct VkQueue_T *queues;
unsigned int i;
......@@ -188,10 +189,24 @@ static struct VkQueue_T *wine_vk_device_alloc_queues(struct VkDevice_T *device,
queue->device = device;
queue->flags = flags;
/* The native device was already allocated with the required number of queues,
* so just fetch them from there.
/* The Vulkan spec says:
*
* "vkGetDeviceQueue must only be used to get queues that were created
* with the flags parameter of VkDeviceQueueCreateInfo set to zero."
*/
device->funcs.p_vkGetDeviceQueue(device->device, family_index, i, &queue->queue);
if (flags && device->funcs.p_vkGetDeviceQueue2)
{
queue_info.sType = VK_STRUCTURE_TYPE_DEVICE_QUEUE_INFO_2;
queue_info.pNext = NULL;
queue_info.flags = flags;
queue_info.queueFamilyIndex = family_index;
queue_info.queueIndex = i;
device->funcs.p_vkGetDeviceQueue2(device->device, &queue_info, &queue->queue);
}
else
{
device->funcs.p_vkGetDeviceQueue(device->device, family_index, i, &queue->queue);
}
}
return queues;
......
......@@ -889,6 +889,7 @@ struct vulkan_device_funcs
VkResult (*p_vkGetDeviceGroupSurfacePresentModesKHR)(VkDevice, VkSurfaceKHR, VkDeviceGroupPresentModeFlagsKHR *);
void (*p_vkGetDeviceMemoryCommitment)(VkDevice, VkDeviceMemory, VkDeviceSize *);
void (*p_vkGetDeviceQueue)(VkDevice, uint32_t, uint32_t, VkQueue *);
void (*p_vkGetDeviceQueue2)(VkDevice, const VkDeviceQueueInfo2 *, VkQueue *);
VkResult (*p_vkGetEventStatus)(VkDevice, VkEvent);
VkResult (*p_vkGetFenceStatus)(VkDevice, VkFence);
#if defined(USE_STRUCT_CONVERSION)
......@@ -1178,6 +1179,7 @@ struct vulkan_instance_funcs
USE_VK_FUNC(vkGetDeviceGroupSurfacePresentModesKHR) \
USE_VK_FUNC(vkGetDeviceMemoryCommitment) \
USE_VK_FUNC(vkGetDeviceQueue) \
USE_VK_FUNC(vkGetDeviceQueue2) \
USE_VK_FUNC(vkGetEventStatus) \
USE_VK_FUNC(vkGetFenceStatus) \
USE_VK_FUNC(vkGetImageMemoryRequirements) \
......
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