diff options
author | Niklas Haas <git@haasn.xyz> | 2017-08-12 20:07:03 +0200 |
---|---|---|
committer | Niklas Haas <git@haasn.xyz> | 2017-08-18 00:19:14 +0200 |
commit | 9ca5a2a5d839476d8a597fcc124cce41279928bc (patch) | |
tree | 6fcc70bcd5c219bdaeba3021b5a65ace014a6ce3 /video/out/opengl/ra_gl.c | |
parent | 82093764684a4c11f9ad0d8c12bf2e34758ea0fe (diff) | |
download | mpv-9ca5a2a5d839476d8a597fcc124cce41279928bc.tar.bz2 mpv-9ca5a2a5d839476d8a597fcc124cce41279928bc.tar.xz |
vo_opengl: make blitting an explicit capability
Instead of merging it into render_dst. This is better for vulkan,
because blitting in vulkan both does not require a FBO *and* requires a
different image layout.
Also less "hacky" for OpenGL, since now the weird blit=FBO requirement
is an implementation detail of ra_gl
Diffstat (limited to 'video/out/opengl/ra_gl.c')
-rw-r--r-- | video/out/opengl/ra_gl.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/video/out/opengl/ra_gl.c b/video/out/opengl/ra_gl.c index 0ad5d67c6e..6d27d5a285 100644 --- a/video/out/opengl/ra_gl.c +++ b/video/out/opengl/ra_gl.c @@ -308,7 +308,8 @@ static struct ra_tex *gl_tex_create(struct ra *ra, gl_check_error(gl, ra->log, "after creating texture"); - if (tex->params.render_dst) { + // Even blitting needs an FBO in OpenGL for strange reasons + if (tex->params.render_dst || tex->params.blit_src || tex->params.blit_dst) { if (!tex->params.format->renderable) { MP_ERR(ra, "Trying to create renderable texture with unsupported " "format.\n"); @@ -378,6 +379,8 @@ struct ra_tex *ra_create_wrapped_fb(struct ra *ra, GLuint gl_fbo, int w, int h) .w = w, .h = h, .d = 1, .format = &fbo_dummy_format, .render_dst = true, + .blit_src = true, + .blit_dst = true, }, }; @@ -598,8 +601,8 @@ static void gl_blit(struct ra *ra, struct ra_tex *dst, struct ra_tex *src, { GL *gl = ra_gl_get(ra); - assert(dst->params.render_dst); - assert(src->params.render_dst); // even src must have a FBO + assert(src->params.blit_src); + assert(dst->params.blit_dst); struct ra_tex_gl *src_gl = src->priv; struct ra_tex_gl *dst_gl = dst->priv; |