summaryrefslogtreecommitdiffstats
path: root/video/out/opengl/common.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-05-23 18:02:37 +0200
committerwm4 <wm4@nowhere>2016-05-23 21:27:18 +0200
commit80d702dce8469928012b9a709805a76274cd0256 (patch)
treeff0be1fb603572b41fe5bd74a672ae72ac004ecc /video/out/opengl/common.c
parentafcef4c25b8dabff92716c3995e26068362bc3aa (diff)
downloadmpv-80d702dce8469928012b9a709805a76274cd0256.tar.bz2
mpv-80d702dce8469928012b9a709805a76274cd0256.tar.xz
vo_opengl: make PBOs work on GLES 3.x
For some reason, GLES has no glMapBuffer, only glMapBufferRange. GLES 2 has no buffer mapping at all, and GL 2.1 does not always have glMapBufferRange. On those PBOs remain unsupported (there's no reason to care about GL 2.1 without the extension). This doesn't actually work on ANGLE, and I have no idea why. (There are artifacts on OSD, as if parts of the OSD data weren't copied.) It works on desktop OpenGL and at least 1 other ES 3 implementation. Don't enable it on ANGLE, I guess.
Diffstat (limited to 'video/out/opengl/common.c')
-rw-r--r--video/out/opengl/common.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/video/out/opengl/common.c b/video/out/opengl/common.c
index 6287fc488b..7121522f4b 100644
--- a/video/out/opengl/common.c
+++ b/video/out/opengl/common.c
@@ -147,13 +147,22 @@ static const struct gl_functions gl_functions[] = {
.provides = MPGL_CAP_ROW_LENGTH | MPGL_CAP_1D_TEX,
.functions = (const struct gl_function[]) {
DEF_FN(GetTexLevelParameteriv),
- DEF_FN(MapBuffer),
DEF_FN(ReadBuffer),
DEF_FN(TexImage1D),
DEF_FN(UnmapBuffer),
{0}
},
},
+ // GL 2.1 has this as extension only.
+ {
+ .ver_exclude = 300,
+ .ver_es_exclude = 300,
+ .extension = "GL_ARB_map_buffer_range",
+ .functions = (const struct gl_function[]) {
+ DEF_FN(MapBufferRange),
+ {0}
+ },
+ },
// GL 3.0+ and ES 3.x core only functions.
{
.ver_core = 300,
@@ -162,6 +171,7 @@ static const struct gl_functions gl_functions[] = {
DEF_FN(BindBufferBase),
DEF_FN(BlitFramebuffer),
DEF_FN(GetStringi),
+ DEF_FN(MapBufferRange),
// for ES 3.0
DEF_FN(ReadBuffer),
DEF_FN(UnmapBuffer),