1
0
mirror of https://github.com/mpv-player/mpv synced 2025-01-10 00:49:32 +00:00
mpv/video/out/opengl/ra_gl.h
wm4 81851febc4 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.
2017-07-26 11:31:43 +02:00

30 lines
468 B
C

#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);