summaryrefslogtreecommitdiffstats
path: root/video/out/gpu/video.c
diff options
context:
space:
mode:
authorJames Ross-Gowan <rossy@jrg.systems>2017-10-02 23:10:52 +1100
committerJames Ross-Gowan <rossy@jrg.systems>2017-11-07 20:27:13 +1100
commit9b2dae79b1be1f57e7b6bcf80d500ab4190aa3d3 (patch)
tree8c490aa1149b57d33f5eb1a03175425d212fe63f /video/out/gpu/video.c
parent68eac1a1e7ac931576a8b59dd159a7961189ca48 (diff)
downloadmpv-9b2dae79b1be1f57e7b6bcf80d500ab4190aa3d3.tar.bz2
mpv-9b2dae79b1be1f57e7b6bcf80d500ab4190aa3d3.tar.xz
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.
Diffstat (limited to 'video/out/gpu/video.c')
-rw-r--r--video/out/gpu/video.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/video/out/gpu/video.c b/video/out/gpu/video.c
index fd870a2ffc..9cc889b401 100644
--- a/video/out/gpu/video.c
+++ b/video/out/gpu/video.c
@@ -1719,7 +1719,8 @@ static void pass_dispatch_sample_polar(struct gl_video *p, struct scaler *scaler
fallback:
// Fall back to regular polar shader when compute shaders are unsupported
// or the kernel is too big for shmem
- pass_sample_polar(p->sc, scaler, img.components, p->ra->glsl_version);
+ pass_sample_polar(p->sc, scaler, img.components,
+ p->ra->caps & RA_CAP_GATHER);
}
// Sample from image, with the src rectangle given by it.
@@ -3465,6 +3466,19 @@ static void check_gl_features(struct gl_video *p)
p->opts.compute_hdr_peak = 0;
MP_WARN(p, "Disabling HDR peak computation (no compute shaders).\n");
}
+ if (!(ra->caps & RA_CAP_FRAGCOORD) && p->opts.dither_depth >= 0 &&
+ p->opts.dither_algo != DITHER_NONE)
+ {
+ p->opts.dither_algo = DITHER_NONE;
+ MP_WARN(p, "Disabling dithering (no gl_FragCoord).\n");
+ }
+ if (!(ra->caps & RA_CAP_FRAGCOORD) &&
+ p->opts.alpha_mode == ALPHA_BLEND_TILES)
+ {
+ p->opts.alpha_mode = ALPHA_BLEND;
+ // Verbose, since this is the default setting
+ MP_VERBOSE(p, "Disabling alpha checkerboard (no gl_FragCoord).\n");
+ }
}
static void init_gl(struct gl_video *p)