diff options
author | Lynne <dev@lynne.ee> | 2024-12-03 15:31:49 +0900 |
---|---|---|
committer | Lynne <dev@lynne.ee> | 2024-12-23 04:25:09 +0900 |
commit | 2e06b84e2747ef4ea4d9f5c20c936aa866f7647d (patch) | |
tree | ba037209826667bf2eb78796b180b673e40b36dc /libavfilter/vf_scale_vulkan.c | |
parent | 157cd820adbbfcfd1870a6ce12d072dc0f623e9b (diff) | |
download | ffmpeg-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 'libavfilter/vf_scale_vulkan.c')
-rw-r--r-- | libavfilter/vf_scale_vulkan.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/libavfilter/vf_scale_vulkan.c b/libavfilter/vf_scale_vulkan.c index d675a309a8..82641a3bff 100644 --- a/libavfilter/vf_scale_vulkan.c +++ b/libavfilter/vf_scale_vulkan.c @@ -39,7 +39,7 @@ typedef struct ScaleVulkanContext { int initialized; FFVkExecPool e; - FFVkQueueFamilyCtx qf; + AVVulkanDeviceQueueFamily *qf; FFVulkanShader shd; VkSampler sampler; @@ -142,8 +142,14 @@ static av_cold int init_filter(AVFilterContext *ctx, AVFrame *in) return AVERROR_EXTERNAL; } - ff_vk_qf_init(vkctx, &s->qf, VK_QUEUE_COMPUTE_BIT); - RET(ff_vk_exec_pool_init(vkctx, &s->qf, &s->e, s->qf.nb_queues*4, 0, 0, 0, NULL)); + s->qf = ff_vk_qf_find(vkctx, VK_QUEUE_COMPUTE_BIT, 0); + if (!s->qf) { + av_log(ctx, AV_LOG_ERROR, "Device has no compute queues\n"); + err = AVERROR(ENOTSUP); + goto fail; + } + + RET(ff_vk_exec_pool_init(vkctx, s->qf, &s->e, s->qf->num*4, 0, 0, 0, NULL)); RET(ff_vk_init_sampler(vkctx, &s->sampler, 0, sampler_mode)); RET(ff_vk_shader_init(vkctx, &s->shd, "scale", VK_SHADER_STAGE_COMPUTE_BIT, |