From bd3ff140fa8c02253fa14939cba43da074329120 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= Date: Wed, 12 Mar 2025 22:06:54 +0100 Subject: [PATCH] hwdec_dxva2dxgi: don't lie about the image format The conversion is done to DXGI_FORMAT_B8G8R8X8_UNORM, this was tagged as IMGFMT_RGB0 because vo_gpu didn't understand that B8G8R8X8 needs to be sampled differently. This is fixed now, so we can tag the image with the correct format. Fixes output with dxva2 for gpu-next (after https://github.com/haasn/libplacebo/commit/bbe63109cba2ef5c7e6aea1c47d5f6994b6dc71c) and gpu (after previous commit). Will fail with older libplacebo, but there is no reason to use dxva2 anyway. d3d11va is available on all supported platforms and is bit-exact unlike dxva2 which always does conversion to 8-bit BGR. Also note that libplacebo was broken with all BGR inputs up until recently, and only because it was working the same as vo=gpu, the issue was canceling out. --- video/out/d3d11/hwdec_dxva2dxgi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/video/out/d3d11/hwdec_dxva2dxgi.c b/video/out/d3d11/hwdec_dxva2dxgi.c index 1e80b10e10..968c3214dc 100644 --- a/video/out/d3d11/hwdec_dxva2dxgi.c +++ b/video/out/d3d11/hwdec_dxva2dxgi.c @@ -162,7 +162,7 @@ static int mapper_init(struct ra_hwdec_mapper *mapper) ID3D11Device_GetImmediateContext(o->dev11, &p->ctx11); mapper->dst_params = mapper->src_params; - mapper->dst_params.imgfmt = IMGFMT_RGB0; + mapper->dst_params.imgfmt = IMGFMT_BGR0; mapper->dst_params.hw_subfmt = 0; return 0; }