mirror of
https://github.com/mpv-player/mpv
synced 2025-04-11 04:01:31 +00:00
vo_gpu: add HOOKED_gather
Can be used conditionally (via #ifdef HOOKED_gather) to use textureGather in custom shaders.
This commit is contained in:
parent
eca78ee925
commit
1ba0547bfb
@ -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",
|
GLSLHF("#define %s_tex(pos) (%s_mul * vec4(texture(%s_raw, pos)).%s)\n",
|
||||||
name, name, name, crap);
|
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,
|
// Since the extra matrix multiplication impacts performance,
|
||||||
// skip it unless the texture was actually rotated
|
// skip it unless the texture was actually rotated
|
||||||
if (gl_transform_eq(img.transform, identity_trans)) {
|
if (gl_transform_eq(img.transform, identity_trans)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user