diff options
author | Lynne <dev@lynne.ee> | 2024-08-31 23:28:41 +0000 |
---|---|---|
committer | Lynne <dev@lynne.ee> | 2024-09-09 07:05:44 +0200 |
commit | eb5088d28cdfd7f8001fa265ff975e7ee1fae85f (patch) | |
tree | 953cea03cf2727ef1373581a1e4cd82f88e0f5e6 /libavfilter | |
parent | c41ef7f2ff809fe3cd47188d0bb95db1f15cf3bd (diff) | |
download | ffmpeg-eb5088d28cdfd7f8001fa265ff975e7ee1fae85f.tar.gz |
vulkan_filter: require storage images properly, set usage flags explicitly
This caused images to be created without a storage usage, which broke
at least lavapipe.
Diffstat (limited to 'libavfilter')
-rw-r--r-- | libavfilter/vulkan_filter.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/libavfilter/vulkan_filter.c b/libavfilter/vulkan_filter.c index 64e9b8768a..c31d42b91a 100644 --- a/libavfilter/vulkan_filter.c +++ b/libavfilter/vulkan_filter.c @@ -68,7 +68,8 @@ int ff_vk_filter_init_context(AVFilterContext *avctx, FFVulkanContext *s, vk = &s->vkfn; /* Usage mismatch */ - usage_req = VK_IMAGE_USAGE_SAMPLED_BIT; + usage_req = VK_IMAGE_USAGE_SAMPLED_BIT | + VK_IMAGE_USAGE_STORAGE_BIT; /* If format supports hardware encoding, make sure * the context includes it. */ @@ -106,9 +107,11 @@ int ff_vk_filter_init_context(AVFilterContext *avctx, FFVulkanContext *s, /* Check if it's usable */ if (no_storage) { skip: + av_log(avctx, AV_LOG_VERBOSE, "Cannot reuse context, creating a new one\n"); device_ref = frames_ctx->device_ref; frames_ref = NULL; } else { + av_log(avctx, AV_LOG_VERBOSE, "Reusing existing frames context\n"); frames_ref = av_buffer_ref(frames_ref); if (!frames_ref) return AVERROR(ENOMEM); @@ -130,6 +133,12 @@ skip: frames_ctx->width = width; frames_ctx->height = height; + vk_frames = frames_ctx->hwctx; + vk_frames->tiling = VK_IMAGE_TILING_OPTIMAL; + vk_frames->usage = VK_IMAGE_USAGE_SAMPLED_BIT | + VK_IMAGE_USAGE_STORAGE_BIT | + VK_IMAGE_USAGE_TRANSFER_SRC_BIT; + err = av_hwframe_ctx_init(frames_ref); if (err < 0) { av_buffer_unref(&frames_ref); |