diff options
author | wm4 <wm4@nowhere> | 2017-08-04 15:47:50 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2017-08-05 13:09:05 +0200 |
commit | 0206efa94aea3d4d20584c4446654a5ddd8e7896 (patch) | |
tree | 67bd0d8da79023e6b4e4fe6f04bf846a45350637 /video/out/opengl/ra_gl.h | |
parent | a796745fd272701c9ed435337a161f643d34a26a (diff) | |
download | mpv-0206efa94aea3d4d20584c4446654a5ddd8e7896.tar.bz2 mpv-0206efa94aea3d4d20584c4446654a5ddd8e7896.tar.xz |
vo_opengl: pass ra objects during rendering instead of GL objects
Another "small" step towards removing GL dependencies from the renderer.
This commit generally passes ra_tex objects instead of GL FBO integer
IDs to various rendering functions. video.c still manually binds the
FBOs when calling shaders.
This also happens to fix a memory leak with output_fbo.
Diffstat (limited to 'video/out/opengl/ra_gl.h')
-rw-r--r-- | video/out/opengl/ra_gl.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/video/out/opengl/ra_gl.h b/video/out/opengl/ra_gl.h index d17b576afc..23e3199aeb 100644 --- a/video/out/opengl/ra_gl.h +++ b/video/out/opengl/ra_gl.h @@ -11,9 +11,10 @@ struct ra_gl { // For ra_tex.priv struct ra_tex_gl { + bool own_objects; GLenum target; - GLuint texture; - GLuint fbo; // 0 if no rendering requested + GLuint texture; // 0 if no texture data associated + GLuint fbo; // 0 if no rendering requested, or it default framebuffer // These 3 fields can be 0 if unknown. GLint internal_format; GLenum format; @@ -28,3 +29,8 @@ struct ra_mapped_buffer_gl { }; int ra_init_gl(struct ra *ra, GL *gl); +struct ra_tex *ra_create_wrapped_texture(struct ra *ra, GLuint gl_texture, + GLenum gl_target, GLint gl_iformat, + GLenum gl_format, GLenum gl_type, + int w, int h); +struct ra_tex *ra_create_wrapped_fb(struct ra *ra, GLuint gl_fbo, int w, int h); |