From e24ba8fa7f1a0645307ab53e16d9d6d1fe2349b2 Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 14 Sep 2016 20:23:46 +0200 Subject: vo_opengl: require explicit reset on shader cache after rendering The caller now has to call gl_sc_reset(), and _after_ rendering. This way we can unset OpenGL state that was setup for rendering. This affects the shader program, for example. The next commit uses this to automatically manage texture units via the shader cache. vo_rpi.c changes untested. --- video/out/opengl/video.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'video/out/opengl/video.c') diff --git a/video/out/opengl/video.c b/video/out/opengl/video.c index 040dbb2f3d..b000b2e7ce 100644 --- a/video/out/opengl/video.c +++ b/video/out/opengl/video.c @@ -1026,10 +1026,11 @@ static void finish_pass_direct(struct gl_video *p, GLint fbo, int vp_w, int vp_h { GL *gl = p->gl; pass_prepare_src_tex(p); + gl_sc_generate(p->sc); gl->BindFramebuffer(GL_FRAMEBUFFER, fbo); - gl_sc_gen_shader_and_reset(p->sc); render_pass_quad(p, vp_w, vp_h, dst); gl->BindFramebuffer(GL_FRAMEBUFFER, 0); + gl_sc_reset(p->sc); memset(&p->pass_tex, 0, sizeof(p->pass_tex)); p->pass_tex_num = 0; } @@ -2335,8 +2336,9 @@ static void pass_draw_osd(struct gl_video *p, int draw_flags, double pts, pass_colormanage(p, csp_srgb, true); } gl_sc_set_vao(p->sc, mpgl_osd_get_vao(p->osd)); - gl_sc_gen_shader_and_reset(p->sc); + gl_sc_generate(p->sc); mpgl_osd_draw_part(p->osd, vp_w, vp_h, n); + gl_sc_reset(p->sc); } gl_sc_set_vao(p->sc, &p->vao); } -- cgit v1.2.3