summaryrefslogtreecommitdiffstats
path: root/video/out/opengl/user_shaders.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-08-03 16:08:18 +0200
committerwm4 <wm4@nowhere>2017-08-03 16:19:49 +0200
commitffe0526064309bda2b24c1503e1b43316b33e6d7 (patch)
treeefb8f963a40f35b9d77c96eb2d66a936cad837a9 /video/out/opengl/user_shaders.h
parent7ec8bd168e9347b00de5b10e87854ddf60b61071 (diff)
downloadmpv-ffe0526064309bda2b24c1503e1b43316b33e6d7.tar.bz2
mpv-ffe0526064309bda2b24c1503e1b43316b33e6d7.tar.xz
vo_opengl: simplify/fix user shader textures
This broke float textures, which were actually used by some shaders. There were probably some other bugs as well. Lots of code can be avoided by using ra_tex_params directly, so do that. The main change is that COMPONENT/FORMAT are replaced by a single FORMAT directive, which takes different parameters now. Due to the mess with 16/32 bit float textures, and because we want to support other APIs than just GL in the future, it's not really clear how this should be handled, and the nice component/type separation makes things actually harder. So just jump the gun and use the ra_format.name names, which were originally meant mostly for debugging. (This is probably something that will be regretted later.) Still only superficially tested, but seems to work. Fixes #4708.
Diffstat (limited to 'video/out/opengl/user_shaders.h')
-rw-r--r--video/out/opengl/user_shaders.h12
1 files changed, 3 insertions, 9 deletions
diff --git a/video/out/opengl/user_shaders.h b/video/out/opengl/user_shaders.h
index bd36387de9..888422608c 100644
--- a/video/out/opengl/user_shaders.h
+++ b/video/out/opengl/user_shaders.h
@@ -72,21 +72,15 @@ struct gl_user_shader_hook {
struct gl_user_shader_tex {
struct bstr name;
- int dimensions;
- int w, h, d;
- int components;
- int bytes;
- enum ra_ctype ctype;
- bool filter;
- bool border;
- void *texdata;
+ struct ra_tex_params params;
// for video.c
struct ra_tex *tex;
};
// Parse the next shader block from `body`. The callbacks are invoked on every
// valid shader block parsed.
-void parse_user_shader(struct mp_log *log, struct bstr shader, void *priv,
+void parse_user_shader(struct mp_log *log, struct ra *ra, struct bstr shader,
+ void *priv,
bool (*dohook)(void *p, struct gl_user_shader_hook hook),
bool (*dotex)(void *p, struct gl_user_shader_tex tex));