[FFmpeg-cvslog] hwcontext_vulkan: do not OR the user-specified usage with our default flags

Lynne git at videolan.org
Sat May 23 21:08:55 EEST 2020


ffmpeg | branch: master | Lynne <dev at lynne.ee> | Fri May 15 00:16:58 2020 +0100| [2c6366590e912714913680af8ea628262975755c] | committer: Lynne

hwcontext_vulkan: do not OR the user-specified usage with our default flags

Some users may need special formats that aren't available when the STORAGE
flag bit is set, which would result in allocations failing.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2c6366590e912714913680af8ea628262975755c
---

 libavutil/hwcontext_vulkan.c | 3 ++-
 libavutil/hwcontext_vulkan.h | 4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c
index 47feff43dc..9374b86632 100644
--- a/libavutil/hwcontext_vulkan.c
+++ b/libavutil/hwcontext_vulkan.c
@@ -1703,7 +1703,8 @@ static int vulkan_frames_init(AVHWFramesContext *hwfc)
     hwctx->tiling = hwctx->tiling ? hwctx->tiling : p->use_linear_images ?
                     VK_IMAGE_TILING_LINEAR : VK_IMAGE_TILING_OPTIMAL;
 
-    hwctx->usage |= DEFAULT_USAGE_FLAGS;
+    if (!hwctx->usage)
+        hwctx->usage = DEFAULT_USAGE_FLAGS;
 
     err = create_exec_ctx(hwfc->device_ctx, &fp->conv_ctx,
                           dev_hwctx->queue_family_comp_index,
diff --git a/libavutil/hwcontext_vulkan.h b/libavutil/hwcontext_vulkan.h
index 656411e0a8..0ac34658b2 100644
--- a/libavutil/hwcontext_vulkan.h
+++ b/libavutil/hwcontext_vulkan.h
@@ -112,8 +112,8 @@ typedef struct AVVulkanFramesContext {
      */
     VkImageTiling tiling;
     /**
-     * Defines extra usage of output frames. This is bitwise OR'd with the
-     * standard usage flags (SAMPLED, STORAGE, TRANSFER_SRC and TRANSFER_DST).
+     * Defines extra usage of output frames. If left as 0, the following bits
+     * are set: TRANSFER_SRC, TRANSFER_DST. SAMPLED and STORAGE.
      */
     VkImageUsageFlagBits usage;
     /**



More information about the ffmpeg-cvslog mailing list