1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-04 22:03:09 +02:00

hwcontext_vulkan: add workaround for broken Nvidia drivers

This commit is contained in:
Lynne
2025-06-16 19:11:20 +00:00
parent 85c0364b70
commit 11428896db

View File

@ -2854,6 +2854,12 @@ static int vulkan_frames_init(AVHWFramesContext *hwfc)
return err; 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 */ /* Image usage flags */
if (!hwctx->usage) { if (!hwctx->usage) {
hwctx->usage = supported_usage & (VK_IMAGE_USAGE_TRANSFER_DST_BIT | hwctx->usage = supported_usage & (VK_IMAGE_USAGE_TRANSFER_DST_BIT |