diff options
author | wm4 <wm4@nowhere> | 2017-07-26 11:19:51 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2017-07-26 11:31:43 +0200 |
commit | 81851febc4766e053cc17134c779959f5942025a (patch) | |
tree | 48e6aedcdb3889e641dfb169e1fff8c144b01bfa /video/out/opengl/ra_gl.h | |
parent | 5904eddb38f20bf794aadff659050c0b32479054 (diff) | |
download | mpv-81851febc4766e053cc17134c779959f5942025a.tar.bz2 mpv-81851febc4766e053cc17134c779959f5942025a.tar.xz |
vo_opengl: start work on rendering API abstraction
This starts work on moving OpenGL-specific code out of the general
renderer code, so that we can support other other GPU APIs. This is in
a very early stage and it's only a proof of concept. It's unknown
whether this will succeed or result in other backends.
For now, the GL rendering API ("ra") and its only provider (ra_gl) does
texture creation/upload/destruction only. And it's used for the main
video texture only. All other code is still hardcoded to GL.
There is some duplication with ra_format and gl_format handling. In the
end, only the ra variants will be needed (plus the gl_format table of
course). For now, this is simpler, because for some reason lots of hwdec
code still requires the GL variants, and would have to be updated to
use the ra ones.
Currently, the video.c code accesses private ra_gl fields. In the end,
it should not do that of course, and it would not include ra_gl.h.
Probably adds bugs, but you can keep them.
Diffstat (limited to 'video/out/opengl/ra_gl.h')
-rw-r--r-- | video/out/opengl/ra_gl.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/video/out/opengl/ra_gl.h b/video/out/opengl/ra_gl.h new file mode 100644 index 0000000000..9d5cb23fb7 --- /dev/null +++ b/video/out/opengl/ra_gl.h @@ -0,0 +1,29 @@ +#pragma once + +#include "common.h" +#include "ra.h" +#include "utils.h" + +// For ra.priv +struct ra_gl { + GL *gl; +}; + +// For ra_tex.priv +struct ra_tex_gl { + GLenum target; + GLuint texture; + // These 3 fields can be 0 if unknown. + GLint internal_format; + GLenum format; + GLenum type; + struct gl_pbo_upload pbo; +}; + +// For ra_mapped_buffer.priv +struct ra_mapped_buffer_gl { + GLuint pbo; + GLsync fence; +}; + +int ra_init_gl(struct ra *ra, GL *gl); |