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/vsrc_testsrc_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/vsrc_testsrc_vulkan.c')
-rw-r--r-- | libavfilter/vsrc_testsrc_vulkan.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/libavfilter/vsrc_testsrc_vulkan.c b/libavfilter/vsrc_testsrc_vulkan.c index fb0d1c3673..a7a801aabe 100644 --- a/libavfilter/vsrc_testsrc_vulkan.c +++ b/libavfilter/vsrc_testsrc_vulkan.c @@ -40,7 +40,7 @@ typedef struct TestSrcVulkanContext { int initialized; FFVkExecPool e; - FFVkQueueFamilyCtx qf; + AVVulkanDeviceQueueFamily *qf; FFVulkanShader shd; /* Only used by color_vulkan */ @@ -82,8 +82,14 @@ static av_cold int init_filter(AVFilterContext *ctx, enum TestSrcVulkanMode mode 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_shader_init(vkctx, &s->shd, "scale", VK_SHADER_STAGE_COMPUTE_BIT, NULL, 0, |