summaryrefslogtreecommitdiffstats
path: root/video/out/opengl
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.xyz>2017-08-18 02:03:50 +0200
committerMartin Herkt <652892+lachs0r@users.noreply.github.com>2017-12-25 00:47:53 +0100
commit6186cc79e6b95a52f5d2ec6075416cbc58c7539f (patch)
tree65122d8c1ca7eec5c72a4e957567f78693698b2b /video/out/opengl
parentfb1c7bde42b835bfc41bc785905c050cef9f6f99 (diff)
downloadmpv-6186cc79e6b95a52f5d2ec6075416cbc58c7539f.tar.bz2
mpv-6186cc79e6b95a52f5d2ec6075416cbc58c7539f.tar.xz
vo_gpu: allow invalidating FBO in renderpass_run
This is especially interesting for vulkan since it allows completely skipping the layout transition as part of the renderpass. Unfortunately, that also means it needs to be put into renderpass_params, as opposed to renderpass_run_params (unlike #4777). Closes #4777.
Diffstat (limited to 'video/out/opengl')
-rw-r--r--video/out/opengl/ra_gl.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/video/out/opengl/ra_gl.c b/video/out/opengl/ra_gl.c
index 5b03368436..37b7285235 100644
--- a/video/out/opengl/ra_gl.c
+++ b/video/out/opengl/ra_gl.c
@@ -996,6 +996,10 @@ static void gl_renderpass_run(struct ra *ra,
assert(params->target->params.render_dst);
assert(params->target->params.format == pass->params.target_format);
gl->BindFramebuffer(GL_FRAMEBUFFER, target_gl->fbo);
+ if (pass->params.invalidate_target && gl->InvalidateFramebuffer) {
+ GLenum fb = target_gl->fbo ? GL_COLOR_ATTACHMENT0 : GL_COLOR;
+ gl->InvalidateFramebuffer(GL_FRAMEBUFFER, 1, &fb);
+ }
gl->Viewport(params->viewport.x0, params->viewport.y0,
mp_rect_w(params->viewport),
mp_rect_h(params->viewport));