summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.xyz>2020-07-14 03:58:55 +0200
committerNiklas Haas <github-c6e1c8@haasn.xyz>2020-07-14 07:32:04 +0200
commit22e7c700dd86654d132cf3a4bc4b57dbd7da27a7 (patch)
tree8c6014121aed007d4a94368f053f9d49bb0834f5
parent7a7a0a78b518180bfb48a42e23acac6c801ed5cf (diff)
downloadmpv-22e7c700dd86654d132cf3a4bc4b57dbd7da27a7.tar.bz2
mpv-22e7c700dd86654d132cf3a4bc4b57dbd7da27a7.tar.xz
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.
-rw-r--r--video/out/hwdec/hwdec_vaapi_vk.c7
1 files 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
+}