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.
This commit is contained in:
Niklas Haas 2020-07-14 03:58:55 +02:00 committed by Niklas Haas
parent 7a7a0a78b5
commit 22e7c700dd
1 changed files with 5 additions and 2 deletions

View File

@ -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;
}
}