vkr: let vkr_queue_create respect VkDeviceQueueCreateFlags

protected and non-protected queues need separate vkr_queue objects.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Ryan Neph <ryanneph@google.com>
macos/master
Yiwei Zhang 3 years ago
parent fd1c39b0a3
commit 59a5ac4d33
  1. 12
      src/venus/vkr_queue.c
  2. 1
      src/venus/vkr_queue.h

@ -204,6 +204,7 @@ vkr_queue_create(struct vkr_context *ctx,
struct vkr_device *dev,
vkr_object_id id,
VkQueue handle,
VkDeviceQueueCreateFlags flags,
uint32_t family,
uint32_t index)
{
@ -211,7 +212,7 @@ vkr_queue_create(struct vkr_context *ctx,
int ret;
LIST_FOR_EACH_ENTRY (queue, &dev->queues, head) {
if (queue->family == family && queue->index == index)
if (queue->flags == flags && queue->family == family && queue->index == index)
return queue;
}
@ -225,6 +226,7 @@ vkr_queue_create(struct vkr_context *ctx,
queue->context = ctx;
queue->device = dev;
queue->flags = flags;
queue->family = family;
queue->index = index;
@ -282,8 +284,8 @@ vkr_dispatch_vkGetDeviceQueue(struct vn_dispatch_context *dispatch,
vn_replace_vkGetDeviceQueue_args_handle(args);
vkGetDeviceQueue(args->device, args->queueFamilyIndex, args->queueIndex, &handle);
struct vkr_queue *queue =
vkr_queue_create(ctx, dev, id, handle, args->queueFamilyIndex, args->queueIndex);
struct vkr_queue *queue = vkr_queue_create(ctx, dev, id, handle, 0 /* flags */,
args->queueFamilyIndex, args->queueIndex);
/* TODO create queues with device and deal with failures there */
if (!queue)
vrend_printf("failed to create queue\n");
@ -309,8 +311,8 @@ vkr_dispatch_vkGetDeviceQueue2(struct vn_dispatch_context *dispatch,
vkGetDeviceQueue2(args->device, args->pQueueInfo, &handle);
/* TODO deal with errors */
vkr_queue_create(ctx, dev, id, handle, args->pQueueInfo->queueFamilyIndex,
args->pQueueInfo->queueIndex);
vkr_queue_create(ctx, dev, id, handle, args->pQueueInfo->flags,
args->pQueueInfo->queueFamilyIndex, args->pQueueInfo->queueIndex);
}
static void

@ -23,6 +23,7 @@ struct vkr_queue {
struct vkr_context *context;
struct vkr_device *device;
VkDeviceQueueCreateFlags flags;
uint32_t family;
uint32_t index;

Loading…
Cancel
Save