The branch, master has been updated
via a45d30a67579f00926525ffd23c7a6b5470d77a0 (commit)
from b1f2eea1cd72f6ba01d2a3303462b9717a0d043a (commit)
- Log -----------------------------------------------------------------
commit a45d30a67579f00926525ffd23c7a6b5470d77a0
Author: Niklas Haas <[email protected]>
AuthorDate: Wed Aug 20 16:56:22 2025 +0200
Commit: Lynne <[email protected]>
CommitDate: Thu Oct 16 17:40:25 2025 +0000
avutil/hwcontext_vulkan: always enable baseline usage flags
The documentation states that this field is for enabling "extra" usage
flags. This conflicts with the implementation, and the rest of the comment,
though.
In resolving this ambiguity, I think it's better to lean towards the first
sentence and treat this field purely as specifying *extra* usage flags to
enable. Otherwise, this may break vulkan encoding or subsequent hwdownload
if the upstream filter did not specifically advertise this.
Change the default behavior and update the documentation slightly to more
clearly document the semantics.
diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c
index 286e13c509..ae4b07c698 100644
--- a/libavutil/hwcontext_vulkan.c
+++ b/libavutil/hwcontext_vulkan.c
@@ -2901,21 +2901,19 @@ static int vulkan_frames_init(AVHWFramesContext *hwfc)
supported_usage &= ~VK_IMAGE_USAGE_HOST_TRANSFER_BIT_EXT;
/* Image usage flags */
- if (!hwctx->usage) {
- hwctx->usage = supported_usage & (VK_IMAGE_USAGE_TRANSFER_DST_BIT |
- VK_IMAGE_USAGE_TRANSFER_SRC_BIT |
- VK_IMAGE_USAGE_STORAGE_BIT |
- VK_IMAGE_USAGE_SAMPLED_BIT);
-
- if ((p->vkctx.extensions & FF_VK_EXT_HOST_IMAGE_COPY) &&
!p->disable_host_transfer)
- hwctx->usage |= supported_usage &
VK_IMAGE_USAGE_HOST_TRANSFER_BIT_EXT;
-
- /* Enables encoding of images, if supported by format and extensions */
- if ((supported_usage & VK_IMAGE_USAGE_VIDEO_ENCODE_SRC_BIT_KHR) &&
- (p->vkctx.extensions & (FF_VK_EXT_VIDEO_ENCODE_QUEUE |
- FF_VK_EXT_VIDEO_MAINTENANCE_1)))
- hwctx->usage |= VK_IMAGE_USAGE_VIDEO_ENCODE_SRC_BIT_KHR;
- }
+ hwctx->usage |= supported_usage & (VK_IMAGE_USAGE_TRANSFER_DST_BIT |
+ VK_IMAGE_USAGE_TRANSFER_SRC_BIT |
+ VK_IMAGE_USAGE_STORAGE_BIT |
+ VK_IMAGE_USAGE_SAMPLED_BIT);
+
+ if ((p->vkctx.extensions & FF_VK_EXT_HOST_IMAGE_COPY) &&
!p->disable_host_transfer)
+ hwctx->usage |= supported_usage & VK_IMAGE_USAGE_HOST_TRANSFER_BIT_EXT;
+
+ /* Enables encoding of images, if supported by format and extensions */
+ if ((supported_usage & VK_IMAGE_USAGE_VIDEO_ENCODE_SRC_BIT_KHR) &&
+ (p->vkctx.extensions & (FF_VK_EXT_VIDEO_ENCODE_QUEUE |
+ FF_VK_EXT_VIDEO_MAINTENANCE_1)))
+ hwctx->usage |= VK_IMAGE_USAGE_VIDEO_ENCODE_SRC_BIT_KHR;
/* Image creation flags.
* Only fill them in automatically if the image is not going to be used as
diff --git a/libavutil/hwcontext_vulkan.h b/libavutil/hwcontext_vulkan.h
index 15cf515668..0bb536ab3f 100644
--- a/libavutil/hwcontext_vulkan.h
+++ b/libavutil/hwcontext_vulkan.h
@@ -218,7 +218,8 @@ typedef struct AVVulkanFramesContext {
/**
* Defines extra usage of output frames. If non-zero, all flags MUST be
- * supported by the VkFormat. Otherwise, will use supported flags amongst:
+ * supported by the VkFormat. Regardless, frames will always have the
+ * following usage flags enabled, if supported by the format:
* - VK_IMAGE_USAGE_SAMPLED_BIT
* - VK_IMAGE_USAGE_STORAGE_BIT
* - VK_IMAGE_USAGE_TRANSFER_SRC_BIT
-----------------------------------------------------------------------
Summary of changes:
libavutil/hwcontext_vulkan.c | 28 +++++++++++++---------------
libavutil/hwcontext_vulkan.h | 3 ++-
2 files changed, 15 insertions(+), 16 deletions(-)
hooks/post-receive
--
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]