summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorigv <igv@users.noreply.github.com>2016-02-22 23:15:01 +0200
committerwm4 <wm4@nowhere>2016-02-22 22:33:04 +0100
commitf0794d0544395cf4ebde1e4e83e11350efd1f68b (patch)
tree13f436d35691a37b4d6e0d336af845e455745e53
parent935c8402bc76107b7f6d2d97e9d2d38a5924fb6c (diff)
downloadmpv-f0794d0544395cf4ebde1e4e83e11350efd1f68b.tar.bz2
mpv-f0794d0544395cf4ebde1e4e83e11350efd1f68b.tar.xz
vo_opengl: set uniform variable "pixel_size"
pixel_size is often used variable, also reciprocal is a costly operation for AMD and older nVidia (prior to Kepler) GPUs.
-rw-r--r--video/out/opengl/video.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/video/out/opengl/video.c b/video/out/opengl/video.c
index db83067357..85fa4e7ed3 100644
--- a/video/out/opengl/video.c
+++ b/video/out/opengl/video.c
@@ -986,6 +986,8 @@ static void load_shader(struct gl_video *p, const char *body)
gl_sc_uniform_f(p->sc, "frame", p->frames_uploaded);
gl_sc_uniform_vec2(p->sc, "image_size", (GLfloat[]){p->image_params.w,
p->image_params.h});
+ gl_sc_uniform_vec2(p->sc, "pixel_size", (GLfloat[]){1.0f / p->texture_w,
+ 1.0f / p->texture_h});
}
static const char *get_custom_shader_fn(struct gl_video *p, const char *body)