winevulkan: Implement vkGetDeviceQueue2.

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Roderick Colenbrander 2018-07-16 15:18:19 +02:00 committed by Alexandre Julliard
parent c92b71f6e8
commit d1d9d5495d
8 changed files with 38 additions and 10 deletions

View file

@ -164,7 +164,7 @@
@ stdcall vkGetDeviceMemoryCommitment(ptr int64 ptr) winevulkan.wine_vkGetDeviceMemoryCommitment
@ stdcall vkGetDeviceProcAddr(ptr str) winevulkan.wine_vkGetDeviceProcAddr
@ stdcall vkGetDeviceQueue(ptr long long ptr) winevulkan.wine_vkGetDeviceQueue
@ stub vkGetDeviceQueue2
@ stdcall vkGetDeviceQueue2(ptr ptr ptr) winevulkan.wine_vkGetDeviceQueue2
@ stub vkGetDisplayModePropertiesKHR
@ stub vkGetDisplayPlaneCapabilitiesKHR
@ stub vkGetDisplayPlaneSupportedDisplaysKHR

View file

@ -161,6 +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},
"vkQueueSubmit" : {"dispatch": True, "driver" : False, "thunk" : False},
# VK_KHR_surface
@ -402,7 +403,7 @@ class VkFunction(object):
# Required is set while parsing which APIs and types are required
# and is used by the code generation.
self.required = True if self.driver else False
self.required = True if func_info else False
@staticmethod
def from_alias(command, alias):

View file

@ -168,7 +168,7 @@ static void wine_vk_command_buffers_free(struct VkDevice_T *device, VkCommandPoo
/* Helper function to create queues for a given family index. */
static struct VkQueue_T *wine_vk_device_alloc_queues(struct VkDevice_T *device,
uint32_t family_index, uint32_t queue_count)
uint32_t family_index, uint32_t queue_count, VkDeviceQueueCreateFlags flags)
{
struct VkQueue_T *queues;
unsigned int i;
@ -182,15 +182,15 @@ static struct VkQueue_T *wine_vk_device_alloc_queues(struct VkDevice_T *device,
for (i = 0; i < queue_count; i++)
{
struct VkQueue_T *queue = &queues[i];
queue->base.loader_magic = VULKAN_ICD_MAGIC_VALUE;
queue->device = device;
queue->flags = flags;
/* The native device was already allocated with the required number of queues,
* so just fetch them from there.
*/
device->funcs.p_vkGetDeviceQueue(device->device, family_index, i, &queue->queue);
/* Set special header for ICD loader. */
queue->base.loader_magic = VULKAN_ICD_MAGIC_VALUE;
}
return queues;
@ -342,7 +342,7 @@ static void wine_vk_instance_convert_create_info(const VkInstanceCreateInfo *src
TRACE("Application name %s, application version %#x\n",
debugstr_a(app_info->pApplicationName), app_info->applicationVersion);
TRACE("Engine name %s, engine version %#x\n", debugstr_a(app_info->pEngineName),
app_info->engineVersion);
app_info->engineVersion);
TRACE("API version %#x\n", app_info->apiVersion);
}
@ -633,12 +633,14 @@ VkResult WINAPI wine_vkCreateDevice(VkPhysicalDevice phys_dev,
for (i = 0; i < create_info_host.queueCreateInfoCount; i++)
{
uint32_t flags = create_info_host.pQueueCreateInfos[i].flags;
uint32_t family_index = create_info_host.pQueueCreateInfos[i].queueFamilyIndex;
uint32_t queue_count = create_info_host.pQueueCreateInfos[i].queueCount;
TRACE("queueFamilyIndex %u, queueCount %u\n", family_index, queue_count);
object->queues[family_index] = wine_vk_device_alloc_queues(object, family_index, queue_count);
object->queues[family_index] = wine_vk_device_alloc_queues(object, family_index,
queue_count, flags);
if (!object->queues[family_index])
{
ERR("Failed to allocate memory for queues\n");
@ -928,11 +930,30 @@ PFN_vkVoidFunction WINAPI wine_vkGetDeviceProcAddr(VkDevice device, const char *
void WINAPI wine_vkGetDeviceQueue(VkDevice device, uint32_t family_index,
uint32_t queue_index, VkQueue *queue)
{
TRACE("%p %u %u %p\n", device, family_index, queue_index, queue);
TRACE("%p, %u, %u, %p\n", device, family_index, queue_index, queue);
*queue = &device->queues[family_index][queue_index];
}
void WINAPI wine_vkGetDeviceQueue2(VkDevice device, const VkDeviceQueueInfo2 *info, VkQueue *queue)
{
const struct wine_vk_structure_header *chain;
struct VkQueue_T *matching_queue;
TRACE("%p, %p, %p\n", device, info, queue);
if ((chain = info->pNext))
FIXME("Ignoring a linked structure of type %#x.\n", chain->sType);
matching_queue = &device->queues[info->queueFamilyIndex][info->queueIndex];
if (matching_queue->flags != info->flags)
{
WARN("No matching flags were specified %#x, %#x.\n", matching_queue->flags, info->flags);
matching_queue = VK_NULL_HANDLE;
}
*queue = matching_queue;
}
PFN_vkVoidFunction WINAPI wine_vkGetInstanceProcAddr(VkInstance instance, const char *name)
{
void *func;

View file

@ -106,6 +106,8 @@ struct VkQueue_T
struct wine_vk_base base;
struct VkDevice_T *device; /* parent */
VkQueue queue; /* native queue */
VkDeviceQueueCreateFlags flags;
};
void *wine_vk_get_device_proc_addr(const char *name) DECLSPEC_HIDDEN;

View file

@ -2966,6 +2966,7 @@ static const struct vulkan_func vk_device_dispatch_table[] =
{"vkGetDeviceMemoryCommitment", &wine_vkGetDeviceMemoryCommitment},
{"vkGetDeviceProcAddr", &wine_vkGetDeviceProcAddr},
{"vkGetDeviceQueue", &wine_vkGetDeviceQueue},
{"vkGetDeviceQueue2", &wine_vkGetDeviceQueue2},
{"vkGetEventStatus", &wine_vkGetEventStatus},
{"vkGetFenceStatus", &wine_vkGetFenceStatus},
{"vkGetImageMemoryRequirements", &wine_vkGetImageMemoryRequirements},

View file

@ -53,6 +53,7 @@ VkResult WINAPI wine_vkEnumeratePhysicalDevices(VkInstance instance, uint32_t *p
void WINAPI wine_vkFreeCommandBuffers(VkDevice device, VkCommandPool commandPool, uint32_t commandBufferCount, const VkCommandBuffer *pCommandBuffers);
PFN_vkVoidFunction WINAPI wine_vkGetDeviceProcAddr(VkDevice device, const char *pName);
void WINAPI wine_vkGetDeviceQueue(VkDevice device, uint32_t queueFamilyIndex, uint32_t queueIndex, VkQueue *pQueue);
void WINAPI wine_vkGetDeviceQueue2(VkDevice device, const VkDeviceQueueInfo2 *pQueueInfo, VkQueue *pQueue);
VkResult WINAPI wine_vkQueueSubmit(VkQueue queue, uint32_t submitCount, const VkSubmitInfo *pSubmits, VkFence fence);
typedef struct VkAcquireNextImageInfoKHR_host

View file

@ -166,7 +166,7 @@
@ stdcall wine_vkGetDeviceMemoryCommitment(ptr int64 ptr)
@ stdcall wine_vkGetDeviceProcAddr(ptr str)
@ stdcall wine_vkGetDeviceQueue(ptr long long ptr)
@ stub vkGetDeviceQueue2
@ stdcall wine_vkGetDeviceQueue2(ptr ptr ptr)
@ stub vkGetDisplayModePropertiesKHR
@ stub vkGetDisplayPlaneCapabilitiesKHR
@ stub vkGetDisplayPlaneSupportedDisplaysKHR

View file

@ -4319,6 +4319,7 @@ typedef VkResult (VKAPI_PTR *PFN_vkGetDeviceGroupSurfacePresentModesKHR)(VkDevic
typedef void (VKAPI_PTR *PFN_vkGetDeviceMemoryCommitment)(VkDevice, VkDeviceMemory, VkDeviceSize *);
typedef PFN_vkVoidFunction (VKAPI_PTR *PFN_vkGetDeviceProcAddr)(VkDevice, const char *);
typedef void (VKAPI_PTR *PFN_vkGetDeviceQueue)(VkDevice, uint32_t, uint32_t, VkQueue *);
typedef void (VKAPI_PTR *PFN_vkGetDeviceQueue2)(VkDevice, const VkDeviceQueueInfo2 *, VkQueue *);
typedef VkResult (VKAPI_PTR *PFN_vkGetEventStatus)(VkDevice, VkEvent);
typedef VkResult (VKAPI_PTR *PFN_vkGetFenceStatus)(VkDevice, VkFence);
typedef void (VKAPI_PTR *PFN_vkGetImageMemoryRequirements)(VkDevice, VkImage, VkMemoryRequirements *);
@ -4537,6 +4538,7 @@ VkResult VKAPI_CALL vkGetDeviceGroupSurfacePresentModesKHR(VkDevice device, VkSu
void VKAPI_CALL vkGetDeviceMemoryCommitment(VkDevice device, VkDeviceMemory memory, VkDeviceSize *pCommittedMemoryInBytes);
PFN_vkVoidFunction VKAPI_CALL vkGetDeviceProcAddr(VkDevice device, const char *pName);
void VKAPI_CALL vkGetDeviceQueue(VkDevice device, uint32_t queueFamilyIndex, uint32_t queueIndex, VkQueue *pQueue);
void VKAPI_CALL vkGetDeviceQueue2(VkDevice device, const VkDeviceQueueInfo2 *pQueueInfo, VkQueue *pQueue);
VkResult VKAPI_CALL vkGetEventStatus(VkDevice device, VkEvent event);
VkResult VKAPI_CALL vkGetFenceStatus(VkDevice device, VkFence fence);
void VKAPI_CALL vkGetImageMemoryRequirements(VkDevice device, VkImage image, VkMemoryRequirements *pMemoryRequirements);