hwcontext_vulkan: fix p->img_qfs

The array was tied to our old queue API, which meant that if users
set it, it was never set.
This commit is contained in:
Lynne 2024-09-18 05:36:43 +02:00
parent 0aa4ac0faf
commit 32d47166c8
No known key found for this signature in database
GPG Key ID: A2FEA5F03F034464

View File

@ -1759,7 +1759,6 @@ FF_DISABLE_DEPRECATION_WARNINGS
tx_index = (ctx_qf == tx_index) ? -1 : tx_index; \
enc_index = (ctx_qf == enc_index) ? -1 : enc_index; \
dec_index = (ctx_qf == dec_index) ? -1 : dec_index; \
p->img_qfs[p->nb_img_qfs++] = ctx_qf; \
} while (0)
CHECK_QUEUE("graphics", 0, graph_index, hwctx->queue_family_index, hwctx->nb_graphics_queues);
@ -1802,6 +1801,22 @@ FF_ENABLE_DEPRECATION_WARNINGS
}
}
/* Setup array for pQueueFamilyIndices with used queue families */
p->nb_img_qfs = 0;
for (int i = 0; i < hwctx->nb_qf; i++) {
int seen = 0;
/* Make sure each entry is unique
* (VUID-VkBufferCreateInfo-sharingMode-01419) */
for (int j = (i - 1); j >= 0; j--) {
if (hwctx->qf[i].idx == hwctx->qf[j].idx) {
seen = 1;
break;
}
}
if (!seen)
p->img_qfs[p->nb_img_qfs++] = hwctx->qf[i].idx;
}
if (!hwctx->lock_queue)
hwctx->lock_queue = lock_queue;
if (!hwctx->unlock_queue)