From 22e7c700dd86654d132cf3a4bc4b57dbd7da27a7 Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Tue, 14 Jul 2020 03:58:55 +0200 Subject: vo_gpu: hwdec_vaapi: add support for DRM format modifiers This is required to get non-corrupted textures when importing vaapi planes on AMD drivers. --- video/out/hwdec/hwdec_vaapi_vk.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/video/out/hwdec/hwdec_vaapi_vk.c b/video/out/hwdec/hwdec_vaapi_vk.c index f5fe27080c..7f09a7e895 100644 --- a/video/out/hwdec/hwdec_vaapi_vk.c +++ b/video/out/hwdec/hwdec_vaapi_vk.c @@ -48,7 +48,7 @@ static bool vaapi_vk_map(struct ra_hwdec_mapper *mapper) .format = format->priv, .sampleable = true, .sample_mode = format->linear_filter ? PL_TEX_SAMPLE_LINEAR - : PL_TEX_SAMPLE_NEAREST, + : PL_TEX_SAMPLE_NEAREST, .import_handle = PL_HANDLE_DMA_BUF, .shared_mem = (struct pl_shared_mem) { .handle = { @@ -56,6 +56,9 @@ static bool vaapi_vk_map(struct ra_hwdec_mapper *mapper) }, .size = size, .offset = offset, +#if PL_API_VER >= 88 + .drm_format_mod = p->desc.objects[id].drm_format_modifier, +#endif }, }; @@ -107,4 +110,4 @@ bool vaapi_vk_init(const struct ra_hwdec *hw) p->interop_unmap = vaapi_vk_unmap; return true; -} \ No newline at end of file +} -- cgit v1.2.3