From 1ba0547bfbe08b6b0a84760730d4ddaeea9f1d0d Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Sat, 15 Jan 2022 10:27:21 +0100 Subject: vo_gpu: add HOOKED_gather Can be used conditionally (via #ifdef HOOKED_gather) to use textureGather in custom shaders. --- video/out/gpu/video.c | 5 +++++ 1 file changed, 5 insertions(+) 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)) { -- cgit v1.2.3