summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.dev>2022-01-15 10:27:21 +0100
committerNiklas Haas <git@haasn.dev>2022-01-15 10:27:21 +0100
commit1ba0547bfbe08b6b0a84760730d4ddaeea9f1d0d (patch)
treea9aa5a9a0dee582635b496e0687cd6c3da24d282
parenteca78ee9259bd477e6a8073165e3ebe22bc4423e (diff)
downloadmpv-1ba0547bfbe08b6b0a84760730d4ddaeea9f1d0d.tar.bz2
mpv-1ba0547bfbe08b6b0a84760730d4ddaeea9f1d0d.tar.xz
vo_gpu: add HOOKED_gather
Can be used conditionally (via #ifdef HOOKED_gather) to use textureGather in custom shaders.
-rw-r--r--video/out/gpu/video.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/video/out/gpu/video.c b/video/out/gpu/video.c
index d0d0509792..449728ccb5 100644
--- a/video/out/gpu/video.c
+++ b/video/out/gpu/video.c
@@ -1412,6 +1412,11 @@ static void hook_prelude(struct gl_video *p, const char *name, int id,
GLSLHF("#define %s_tex(pos) (%s_mul * vec4(texture(%s_raw, pos)).%s)\n",
name, name, name, crap);
+ if (p->ra->caps & RA_CAP_GATHER) {
+ GLSLHF("#define %s_gather(pos, c) (%s_mul * vec4("
+ "textureGather(%s_raw, pos, c)))\n", name, name, name);
+ }
+
// Since the extra matrix multiplication impacts performance,
// skip it unless the texture was actually rotated
if (gl_transform_eq(img.transform, identity_trans)) {