vo_gpu: add HOOKED_gather

Can be used conditionally (via #ifdef HOOKED_gather) to use
textureGather in custom shaders.
This commit is contained in:
Niklas Haas 2022-01-15 10:27:21 +01:00
parent eca78ee925
commit 1ba0547bfb
1 changed files with 5 additions and 0 deletions

View File

@ -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)) {