hwcontext_vulkan: fix 3-plane 444 10 and 12-bit formats using the new MSB formats

We previously tried to fudge this somehow, but the pixel formats
are simply broken and we cannot use them without declaring them as MSB.
This commit is contained in:
Lynne 2025-10-26 20:12:15 +00:00 committed by James Almer
parent 471acedec2
commit 41ecb203c5
4 changed files with 24 additions and 18 deletions

View file

@ -1116,6 +1116,12 @@ int ff_vk_frame_params(AVCodecContext *avctx, AVBufferRef *hw_frames_ctx)
/* Vulkan's formats are all LSB-padded */
case AV_PIX_FMT_GRAY10: frames_ctx->sw_format = AV_PIX_FMT_GRAY10MSB; break;
case AV_PIX_FMT_GRAY12: frames_ctx->sw_format = AV_PIX_FMT_GRAY12MSB; break;
case AV_PIX_FMT_YUV420P10: frames_ctx->sw_format = AV_PIX_FMT_YUV420P10MSB; break;
case AV_PIX_FMT_YUV420P12: frames_ctx->sw_format = AV_PIX_FMT_YUV420P12MSB; break;
case AV_PIX_FMT_YUV422P10: frames_ctx->sw_format = AV_PIX_FMT_YUV422P10MSB; break;
case AV_PIX_FMT_YUV422P12: frames_ctx->sw_format = AV_PIX_FMT_YUV422P12MSB; break;
case AV_PIX_FMT_YUV444P10: frames_ctx->sw_format = AV_PIX_FMT_YUV444P10MSB; break;
case AV_PIX_FMT_YUV444P12: frames_ctx->sw_format = AV_PIX_FMT_YUV444P12MSB; break;
case AV_PIX_FMT_GBRAP16:
/* This should be more efficient for downloading and using */
frames_ctx->sw_format = AV_PIX_FMT_RGBA64;