diff options
author | wm4 <wm4@nowhere> | 2015-03-12 21:57:54 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-03-12 23:20:20 +0100 |
commit | e74a4d5bc0b101fbfb371942c00d3a77267dc4a6 (patch) | |
tree | a9cc46910567eaf32ba0b47c9539f47418565d41 /video/out/vo_opengl.c | |
parent | ae6019cbc98cfad2613e89a80bee79ce6b2f1319 (diff) | |
download | mpv-e74a4d5bc0b101fbfb371942c00d3a77267dc4a6.tar.bz2 mpv-e74a4d5bc0b101fbfb371942c00d3a77267dc4a6.tar.xz |
vo_opengl: refactor shader generation (part 1)
The basic idea is to use dynamically generated shaders instead of a
single monolithic file + a ton of ifdefs. Instead of having to setup
every aspect of it separately (like compiling shaders, setting uniforms,
perfoming the actual rendering steps, the GLSL parts), we generate the
GLSL on the fly, and perform the rendering at the same time. The GLSL
is regenerated every frame, but the actual compiled OpenGL-level shaders
are cached, which makes it fast again. Almost all logic can be in a
single place.
The new code is significantly more flexible, which allows us to improve
the code clarity, performance and add more features easily.
This commit is incomplete. It drops almost all previous code, and
readds only the most important things (some of them actually buggy).
The next commit will complete it - it's separate to preserve authorship
information.
Diffstat (limited to 'video/out/vo_opengl.c')
-rw-r--r-- | video/out/vo_opengl.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/video/out/vo_opengl.c b/video/out/vo_opengl.c index 887a8d8fbd..aa3dd0c9e0 100644 --- a/video/out/vo_opengl.c +++ b/video/out/vo_opengl.c @@ -93,12 +93,11 @@ static void resize(struct gl_priv *p) MP_VERBOSE(vo, "Resize: %dx%d\n", vo->dwidth, vo->dheight); - struct mp_rect wnd = {0, 0, vo->dwidth, vo->dheight}; struct mp_rect src, dst; struct mp_osd_res osd; vo_get_src_dst_rects(vo, &src, &dst, &osd); - gl_video_resize(p->renderer, &wnd, &src, &dst, &osd, false); + gl_video_resize(p->renderer, vo->dwidth, -vo->dheight, &src, &dst, &osd); vo->want_redraw = true; } @@ -198,7 +197,7 @@ static int query_format(struct vo *vo, int format) static void video_resize_redraw_callback(struct vo *vo, int w, int h) { struct gl_priv *p = vo->priv; - gl_video_resize_redraw(p->renderer, w, h); + gl_video_resize_redraw(p->renderer, w, -h); } |