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.
This commit is contained in:
Kacper Michajłow
2025-03-13 12:21:16 +01:00
parent 4d08d4d51a
commit bd3ff140fa
+1 -1
View File
@@ -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;
}