Commit d1d9d549 authored by Roderick Colenbrander's avatar Roderick Colenbrander Committed by Alexandre Julliard

winevulkan: Implement vkGetDeviceQueue2.

parent c92b71f6
...@@ -164,7 +164,7 @@ ...@@ -164,7 +164,7 @@
@ stdcall vkGetDeviceMemoryCommitment(ptr int64 ptr) winevulkan.wine_vkGetDeviceMemoryCommitment @ stdcall vkGetDeviceMemoryCommitment(ptr int64 ptr) winevulkan.wine_vkGetDeviceMemoryCommitment
@ stdcall vkGetDeviceProcAddr(ptr str) winevulkan.wine_vkGetDeviceProcAddr @ stdcall vkGetDeviceProcAddr(ptr str) winevulkan.wine_vkGetDeviceProcAddr
@ stdcall vkGetDeviceQueue(ptr long long ptr) winevulkan.wine_vkGetDeviceQueue @ stdcall vkGetDeviceQueue(ptr long long ptr) winevulkan.wine_vkGetDeviceQueue
@ stub vkGetDeviceQueue2 @ stdcall vkGetDeviceQueue2(ptr ptr ptr) winevulkan.wine_vkGetDeviceQueue2
@ stub vkGetDisplayModePropertiesKHR @ stub vkGetDisplayModePropertiesKHR
@ stub vkGetDisplayPlaneCapabilitiesKHR @ stub vkGetDisplayPlaneCapabilitiesKHR
@ stub vkGetDisplayPlaneSupportedDisplaysKHR @ stub vkGetDisplayPlaneSupportedDisplaysKHR
......
...@@ -161,6 +161,7 @@ FUNCTION_OVERRIDES = { ...@@ -161,6 +161,7 @@ FUNCTION_OVERRIDES = {
"vkFreeCommandBuffers" : {"dispatch" : True, "driver" : False, "thunk" : False}, "vkFreeCommandBuffers" : {"dispatch" : True, "driver" : False, "thunk" : False},
"vkGetDeviceProcAddr" : {"dispatch" : False, "driver" : True, "thunk" : False}, "vkGetDeviceProcAddr" : {"dispatch" : False, "driver" : True, "thunk" : False},
"vkGetDeviceQueue" : {"dispatch": True, "driver" : False, "thunk" : False}, "vkGetDeviceQueue" : {"dispatch": True, "driver" : False, "thunk" : False},
"vkGetDeviceQueue2" : {"dispatch": False, "driver" : False, "thunk" : False},
"vkQueueSubmit" : {"dispatch": True, "driver" : False, "thunk" : False}, "vkQueueSubmit" : {"dispatch": True, "driver" : False, "thunk" : False},
# VK_KHR_surface # VK_KHR_surface
...@@ -402,7 +403,7 @@ class VkFunction(object): ...@@ -402,7 +403,7 @@ class VkFunction(object):
# Required is set while parsing which APIs and types are required # Required is set while parsing which APIs and types are required
# and is used by the code generation. # and is used by the code generation.
self.required = True if self.driver else False self.required = True if func_info else False
@staticmethod @staticmethod
def from_alias(command, alias): def from_alias(command, alias):
......
...@@ -168,7 +168,7 @@ static void wine_vk_command_buffers_free(struct VkDevice_T *device, VkCommandPoo ...@@ -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. */ /* Helper function to create queues for a given family index. */
static struct VkQueue_T *wine_vk_device_alloc_queues(struct VkDevice_T *device, 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; struct VkQueue_T *queues;
unsigned int i; unsigned int i;
...@@ -182,15 +182,15 @@ static struct VkQueue_T *wine_vk_device_alloc_queues(struct VkDevice_T *device, ...@@ -182,15 +182,15 @@ static struct VkQueue_T *wine_vk_device_alloc_queues(struct VkDevice_T *device,
for (i = 0; i < queue_count; i++) for (i = 0; i < queue_count; i++)
{ {
struct VkQueue_T *queue = &queues[i]; struct VkQueue_T *queue = &queues[i];
queue->base.loader_magic = VULKAN_ICD_MAGIC_VALUE;
queue->device = device; queue->device = device;
queue->flags = flags;
/* The native device was already allocated with the required number of queues, /* The native device was already allocated with the required number of queues,
* so just fetch them from there. * so just fetch them from there.
*/ */
device->funcs.p_vkGetDeviceQueue(device->device, family_index, i, &queue->queue); 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; return queues;
...@@ -342,7 +342,7 @@ static void wine_vk_instance_convert_create_info(const VkInstanceCreateInfo *src ...@@ -342,7 +342,7 @@ static void wine_vk_instance_convert_create_info(const VkInstanceCreateInfo *src
TRACE("Application name %s, application version %#x\n", TRACE("Application name %s, application version %#x\n",
debugstr_a(app_info->pApplicationName), app_info->applicationVersion); debugstr_a(app_info->pApplicationName), app_info->applicationVersion);
TRACE("Engine name %s, engine version %#x\n", debugstr_a(app_info->pEngineName), 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); TRACE("API version %#x\n", app_info->apiVersion);
} }
...@@ -633,12 +633,14 @@ VkResult WINAPI wine_vkCreateDevice(VkPhysicalDevice phys_dev, ...@@ -633,12 +633,14 @@ VkResult WINAPI wine_vkCreateDevice(VkPhysicalDevice phys_dev,
for (i = 0; i < create_info_host.queueCreateInfoCount; i++) 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 family_index = create_info_host.pQueueCreateInfos[i].queueFamilyIndex;
uint32_t queue_count = create_info_host.pQueueCreateInfos[i].queueCount; uint32_t queue_count = create_info_host.pQueueCreateInfos[i].queueCount;
TRACE("queueFamilyIndex %u, queueCount %u\n", family_index, queue_count); 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]) if (!object->queues[family_index])
{ {
ERR("Failed to allocate memory for queues\n"); ERR("Failed to allocate memory for queues\n");
...@@ -928,11 +930,30 @@ PFN_vkVoidFunction WINAPI wine_vkGetDeviceProcAddr(VkDevice device, const char * ...@@ -928,11 +930,30 @@ PFN_vkVoidFunction WINAPI wine_vkGetDeviceProcAddr(VkDevice device, const char *
void WINAPI wine_vkGetDeviceQueue(VkDevice device, uint32_t family_index, void WINAPI wine_vkGetDeviceQueue(VkDevice device, uint32_t family_index,
uint32_t queue_index, VkQueue *queue) 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]; *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) PFN_vkVoidFunction WINAPI wine_vkGetInstanceProcAddr(VkInstance instance, const char *name)
{ {
void *func; void *func;
......
...@@ -106,6 +106,8 @@ struct VkQueue_T ...@@ -106,6 +106,8 @@ struct VkQueue_T
struct wine_vk_base base; struct wine_vk_base base;
struct VkDevice_T *device; /* parent */ struct VkDevice_T *device; /* parent */
VkQueue queue; /* native queue */ VkQueue queue; /* native queue */
VkDeviceQueueCreateFlags flags;
}; };
void *wine_vk_get_device_proc_addr(const char *name) DECLSPEC_HIDDEN; void *wine_vk_get_device_proc_addr(const char *name) DECLSPEC_HIDDEN;
......
...@@ -2966,6 +2966,7 @@ static const struct vulkan_func vk_device_dispatch_table[] = ...@@ -2966,6 +2966,7 @@ static const struct vulkan_func vk_device_dispatch_table[] =
{"vkGetDeviceMemoryCommitment", &wine_vkGetDeviceMemoryCommitment}, {"vkGetDeviceMemoryCommitment", &wine_vkGetDeviceMemoryCommitment},
{"vkGetDeviceProcAddr", &wine_vkGetDeviceProcAddr}, {"vkGetDeviceProcAddr", &wine_vkGetDeviceProcAddr},
{"vkGetDeviceQueue", &wine_vkGetDeviceQueue}, {"vkGetDeviceQueue", &wine_vkGetDeviceQueue},
{"vkGetDeviceQueue2", &wine_vkGetDeviceQueue2},
{"vkGetEventStatus", &wine_vkGetEventStatus}, {"vkGetEventStatus", &wine_vkGetEventStatus},
{"vkGetFenceStatus", &wine_vkGetFenceStatus}, {"vkGetFenceStatus", &wine_vkGetFenceStatus},
{"vkGetImageMemoryRequirements", &wine_vkGetImageMemoryRequirements}, {"vkGetImageMemoryRequirements", &wine_vkGetImageMemoryRequirements},
......
...@@ -53,6 +53,7 @@ VkResult WINAPI wine_vkEnumeratePhysicalDevices(VkInstance instance, uint32_t *p ...@@ -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); void WINAPI wine_vkFreeCommandBuffers(VkDevice device, VkCommandPool commandPool, uint32_t commandBufferCount, const VkCommandBuffer *pCommandBuffers);
PFN_vkVoidFunction WINAPI wine_vkGetDeviceProcAddr(VkDevice device, const char *pName); 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_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); VkResult WINAPI wine_vkQueueSubmit(VkQueue queue, uint32_t submitCount, const VkSubmitInfo *pSubmits, VkFence fence);
typedef struct VkAcquireNextImageInfoKHR_host typedef struct VkAcquireNextImageInfoKHR_host
......
...@@ -166,7 +166,7 @@ ...@@ -166,7 +166,7 @@
@ stdcall wine_vkGetDeviceMemoryCommitment(ptr int64 ptr) @ stdcall wine_vkGetDeviceMemoryCommitment(ptr int64 ptr)
@ stdcall wine_vkGetDeviceProcAddr(ptr str) @ stdcall wine_vkGetDeviceProcAddr(ptr str)
@ stdcall wine_vkGetDeviceQueue(ptr long long ptr) @ stdcall wine_vkGetDeviceQueue(ptr long long ptr)
@ stub vkGetDeviceQueue2 @ stdcall wine_vkGetDeviceQueue2(ptr ptr ptr)
@ stub vkGetDisplayModePropertiesKHR @ stub vkGetDisplayModePropertiesKHR
@ stub vkGetDisplayPlaneCapabilitiesKHR @ stub vkGetDisplayPlaneCapabilitiesKHR
@ stub vkGetDisplayPlaneSupportedDisplaysKHR @ stub vkGetDisplayPlaneSupportedDisplaysKHR
......
...@@ -4319,6 +4319,7 @@ typedef VkResult (VKAPI_PTR *PFN_vkGetDeviceGroupSurfacePresentModesKHR)(VkDevic ...@@ -4319,6 +4319,7 @@ typedef VkResult (VKAPI_PTR *PFN_vkGetDeviceGroupSurfacePresentModesKHR)(VkDevic
typedef void (VKAPI_PTR *PFN_vkGetDeviceMemoryCommitment)(VkDevice, VkDeviceMemory, VkDeviceSize *); typedef void (VKAPI_PTR *PFN_vkGetDeviceMemoryCommitment)(VkDevice, VkDeviceMemory, VkDeviceSize *);
typedef PFN_vkVoidFunction (VKAPI_PTR *PFN_vkGetDeviceProcAddr)(VkDevice, const char *); 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_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_vkGetEventStatus)(VkDevice, VkEvent);
typedef VkResult (VKAPI_PTR *PFN_vkGetFenceStatus)(VkDevice, VkFence); typedef VkResult (VKAPI_PTR *PFN_vkGetFenceStatus)(VkDevice, VkFence);
typedef void (VKAPI_PTR *PFN_vkGetImageMemoryRequirements)(VkDevice, VkImage, VkMemoryRequirements *); typedef void (VKAPI_PTR *PFN_vkGetImageMemoryRequirements)(VkDevice, VkImage, VkMemoryRequirements *);
...@@ -4537,6 +4538,7 @@ VkResult VKAPI_CALL vkGetDeviceGroupSurfacePresentModesKHR(VkDevice device, VkSu ...@@ -4537,6 +4538,7 @@ VkResult VKAPI_CALL vkGetDeviceGroupSurfacePresentModesKHR(VkDevice device, VkSu
void VKAPI_CALL vkGetDeviceMemoryCommitment(VkDevice device, VkDeviceMemory memory, VkDeviceSize *pCommittedMemoryInBytes); void VKAPI_CALL vkGetDeviceMemoryCommitment(VkDevice device, VkDeviceMemory memory, VkDeviceSize *pCommittedMemoryInBytes);
PFN_vkVoidFunction VKAPI_CALL vkGetDeviceProcAddr(VkDevice device, const char *pName); 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 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 vkGetEventStatus(VkDevice device, VkEvent event);
VkResult VKAPI_CALL vkGetFenceStatus(VkDevice device, VkFence fence); VkResult VKAPI_CALL vkGetFenceStatus(VkDevice device, VkFence fence);
void VKAPI_CALL vkGetImageMemoryRequirements(VkDevice device, VkImage image, VkMemoryRequirements *pMemoryRequirements); void VKAPI_CALL vkGetImageMemoryRequirements(VkDevice device, VkImage image, VkMemoryRequirements *pMemoryRequirements);
......
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