diff options
author | Lynne <dev@lynne.ee> | 2022-11-23 13:03:58 +0100 |
---|---|---|
committer | Lynne <dev@lynne.ee> | 2023-05-29 00:41:43 +0200 |
commit | e8fce74abfd1aa4ad13f4daf103e7f71954459ba (patch) | |
tree | 0527b4103da0b4aa182a80974422a9c6f3be2cc0 /libavutil/vulkan.c | |
parent | b5e333bba7cd0657c48b4ec996bc91fffec9d3e7 (diff) | |
download | ffmpeg-e8fce74abfd1aa4ad13f4daf103e7f71954459ba.tar.gz |
vulkan: add ff_vk_qf_fill()
Diffstat (limited to 'libavutil/vulkan.c')
-rw-r--r-- | libavutil/vulkan.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/libavutil/vulkan.c b/libavutil/vulkan.c index ae6adc5104..eceef295a8 100644 --- a/libavutil/vulkan.c +++ b/libavutil/vulkan.c @@ -108,6 +108,31 @@ const char *ff_vk_ret2str(VkResult res) #undef CASE } +void ff_vk_qf_fill(FFVulkanContext *s) +{ + s->nb_qfs = 0; + + /* Simply fills in all unique queues into s->qfs */ + if (s->hwctx->queue_family_index >= 0) + s->qfs[s->nb_qfs++] = s->hwctx->queue_family_index; + if (!s->nb_qfs || s->qfs[0] != s->hwctx->queue_family_tx_index) + s->qfs[s->nb_qfs++] = s->hwctx->queue_family_tx_index; + if (!s->nb_qfs || (s->qfs[0] != s->hwctx->queue_family_comp_index && + s->qfs[1] != s->hwctx->queue_family_comp_index)) + s->qfs[s->nb_qfs++] = s->hwctx->queue_family_comp_index; + if (s->hwctx->queue_family_decode_index >= 0 && + (s->qfs[0] != s->hwctx->queue_family_decode_index && + s->qfs[1] != s->hwctx->queue_family_decode_index && + s->qfs[2] != s->hwctx->queue_family_decode_index)) + s->qfs[s->nb_qfs++] = s->hwctx->queue_family_decode_index; + if (s->hwctx->queue_family_encode_index >= 0 && + (s->qfs[0] != s->hwctx->queue_family_encode_index && + s->qfs[1] != s->hwctx->queue_family_encode_index && + s->qfs[2] != s->hwctx->queue_family_encode_index && + s->qfs[3] != s->hwctx->queue_family_encode_index)) + s->qfs[s->nb_qfs++] = s->hwctx->queue_family_encode_index; +} + void ff_vk_qf_init(FFVulkanContext *s, FFVkQueueFamilyCtx *qf, VkQueueFlagBits dev_family, int nb_queues) { |