From 9b2dae79b1be1f57e7b6bcf80d500ab4190aa3d3 Mon Sep 17 00:00:00 2001 From: James Ross-Gowan Date: Mon, 2 Oct 2017 23:10:52 +1100 Subject: vo_gpu: d3d11: add RA caps for ra_d3d11 ra_d3d11 uses the SPIR-V compiler to translate GLSL to SPIR-V, which is then translated to HLSL. This means it always exposes the same GLSL version that the SPIR-V compiler supports (4.50 for shaderc/glslang.) Despite claiming to support GLSL 4.50, some features that are tied to the GLSL version in OpenGL are not supported by ra_d3d11 when targeting legacy Direct3D feature levels. This includes two features that mpv relies on: - Reading from gl_FragCoord in the fragment shader (requires FL 10_0) - textureGather from any texture component (requires FL 11_0) These features have been exposed as new RA caps. --- video/out/d3d11/ra_d3d11.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'video/out/d3d11/ra_d3d11.c') diff --git a/video/out/d3d11/ra_d3d11.c b/video/out/d3d11/ra_d3d11.c index 372b65d49f..806ce9ad52 100644 --- a/video/out/d3d11/ra_d3d11.c +++ b/video/out/d3d11/ra_d3d11.c @@ -2161,6 +2161,11 @@ struct ra *ra_d3d11_create(ID3D11Device *dev, struct mp_log *log, ra->max_texture_wh = D3D_FL9_1_REQ_TEXTURE2D_U_OR_V_DIMENSION; } + if (p->fl >= D3D_FEATURE_LEVEL_11_0) + ra->caps |= RA_CAP_GATHER; + if (p->fl >= D3D_FEATURE_LEVEL_10_0) + ra->caps |= RA_CAP_FRAGCOORD; + // Some 10_0 hardware has compute shaders, but only 11_0 has image load/store if (p->fl >= D3D_FEATURE_LEVEL_11_0) { ra->caps |= RA_CAP_COMPUTE | RA_CAP_BUF_RW; -- cgit v1.2.3