aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/ffv1enc_vulkan.c
diff options
context:
space:
mode:
authorLynne <dev@lynne.ee>2024-12-03 15:31:49 +0900
committerLynne <dev@lynne.ee>2024-12-23 04:25:09 +0900
commit2e06b84e2747ef4ea4d9f5c20c936aa866f7647d (patch)
treeba037209826667bf2eb78796b180b673e40b36dc /libavcodec/ffv1enc_vulkan.c
parent157cd820adbbfcfd1870a6ce12d072dc0f623e9b (diff)
downloadffmpeg-2e06b84e2747ef4ea4d9f5c20c936aa866f7647d.tar.gz
vulkan: do not reinvent a queue context struct
We recently introduced a public field which was a superset of the queue context we used to have. Switch to using it entirely. This also allows us to get rid of the NIH function which was valid only for video queues.
Diffstat (limited to 'libavcodec/ffv1enc_vulkan.c')
-rw-r--r--libavcodec/ffv1enc_vulkan.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/libavcodec/ffv1enc_vulkan.c b/libavcodec/ffv1enc_vulkan.c
index 41d396fb32..1874a3f42b 100644
--- a/libavcodec/ffv1enc_vulkan.c
+++ b/libavcodec/ffv1enc_vulkan.c
@@ -58,10 +58,10 @@ typedef struct VulkanEncodeFFv1Context {
AVFrame *frame;
FFVulkanContext s;
- FFVkQueueFamilyCtx qf;
+ AVVulkanDeviceQueueFamily *qf;
FFVkExecPool exec_pool;
- FFVkQueueFamilyCtx transfer_qf;
+ AVVulkanDeviceQueueFamily *transfer_qf;
FFVkExecPool transfer_exec_pool;
VkBufferCopy *buf_regions;
@@ -1586,8 +1586,8 @@ static av_cold int vulkan_encode_ffv1_init(AVCodecContext *avctx)
if (err < 0)
return err;
- err = ff_vk_qf_init(&fv->s, &fv->qf, VK_QUEUE_COMPUTE_BIT);
- if (err < 0) {
+ fv->qf = ff_vk_qf_find(&fv->s, VK_QUEUE_COMPUTE_BIT, 0);
+ if (!fv->qf) {
av_log(avctx, AV_LOG_ERROR, "Device has no compute queues!\n");
return err;
}
@@ -1626,7 +1626,7 @@ static av_cold int vulkan_encode_ffv1_init(AVCodecContext *avctx)
}
if (!fv->async_depth) {
- fv->async_depth = FFMIN(fv->qf.nb_queues, FFMAX(max_heap_size / maxsize, 1));
+ fv->async_depth = FFMIN(fv->qf->num, FFMAX(max_heap_size / maxsize, 1));
fv->async_depth = FFMAX(fv->async_depth, 1);
}
@@ -1635,19 +1635,19 @@ static av_cold int vulkan_encode_ffv1_init(AVCodecContext *avctx)
(fv->async_depth * maxsize) / (1024*1024),
fv->async_depth);
- err = ff_vk_exec_pool_init(&fv->s, &fv->qf, &fv->exec_pool,
+ err = ff_vk_exec_pool_init(&fv->s, fv->qf, &fv->exec_pool,
fv->async_depth,
0, 0, 0, NULL);
if (err < 0)
return err;
- err = ff_vk_qf_init(&fv->s, &fv->transfer_qf, VK_QUEUE_TRANSFER_BIT);
- if (err < 0) {
+ fv->transfer_qf = ff_vk_qf_find(&fv->s, VK_QUEUE_TRANSFER_BIT, 0);
+ if (!fv->transfer_qf) {
av_log(avctx, AV_LOG_ERROR, "Device has no transfer queues!\n");
return err;
}
- err = ff_vk_exec_pool_init(&fv->s, &fv->transfer_qf, &fv->transfer_exec_pool,
+ err = ff_vk_exec_pool_init(&fv->s, fv->transfer_qf, &fv->transfer_exec_pool,
1,
0, 0, 0, NULL);
if (err < 0)