From 6002e2705f5e77de4a22fc24e94734dd3500feb7 Mon Sep 17 00:00:00 2001 From: James Ross-Gowan Date: Thu, 10 Oct 2019 19:41:55 +1100 Subject: vo_gpu: d3d11: use linear filtering for wrapped textures This affects hwdec_dxva2dxgi, which uses ra_d3d11_wrap_tex to wrap RGB video frames that are shared with a D3D9 device. Without it, mpv uses nearest instead of bilinear scaling with --scale=bilinear (the default) and --hwdec=dxva2. It's kind of hard to believe this bug has gone unnoticed for almost two years, but that seems to have been the case. Fixes: #7042 --- video/out/d3d11/ra_d3d11.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/video/out/d3d11/ra_d3d11.c b/video/out/d3d11/ra_d3d11.c index 74cd0f6552..b14f3a48fa 100644 --- a/video/out/d3d11/ra_d3d11.c +++ b/video/out/d3d11/ra_d3d11.c @@ -566,8 +566,10 @@ struct ra_tex *ra_d3d11_wrap_tex(struct ra *ra, ID3D11Resource *res) goto error; } - if (bind_flags & D3D11_BIND_SHADER_RESOURCE) + if (bind_flags & D3D11_BIND_SHADER_RESOURCE) { params->render_src = params->blit_src = true; + params->src_linear = params->format->linear_filter; + } if (bind_flags & D3D11_BIND_RENDER_TARGET) params->render_dst = params->blit_dst = true; if (bind_flags & D3D11_BIND_UNORDERED_ACCESS) -- cgit v1.2.3