aboutsummaryrefslogtreecommitdiffstats
path: root/libavutil/hwcontext_vulkan.c
diff options
context:
space:
mode:
authorLynne <dev@lynne.ee>2025-06-16 19:11:20 +0000
committerLynne <dev@lynne.ee>2025-06-24 02:30:01 +0900
commit11428896dba40814edd880272b3bcb9b778fd4a8 (patch)
treea7d6e62b4c5d450da3cab27aa3592f8a9a5a80fa /libavutil/hwcontext_vulkan.c
parent85c0364b703f4c5f581da6dd8cd6446769ed3439 (diff)
downloadffmpeg-11428896dba40814edd880272b3bcb9b778fd4a8.tar.gz
hwcontext_vulkan: add workaround for broken Nvidia drivers
Diffstat (limited to 'libavutil/hwcontext_vulkan.c')
-rw-r--r--libavutil/hwcontext_vulkan.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c
index f94ad280ff..c8c6eed0fd 100644
--- a/libavutil/hwcontext_vulkan.c
+++ b/libavutil/hwcontext_vulkan.c
@@ -2854,6 +2854,12 @@ static int vulkan_frames_init(AVHWFramesContext *hwfc)
return err;
}
+ /* Nvidia is violating the spec because they thought no one would use this. */
+ if (p->dev_is_nvidia &&
+ (((fmt->nb_images == 1) && (fmt->vk_planes > 1)) ||
+ (av_pix_fmt_desc_get(hwfc->sw_format)->nb_components == 1)))
+ supported_usage &= ~VK_IMAGE_USAGE_HOST_TRANSFER_BIT;
+
/* Image usage flags */
if (!hwctx->usage) {
hwctx->usage = supported_usage & (VK_IMAGE_USAGE_TRANSFER_DST_BIT |