summaryrefslogtreecommitdiffstats
path: root/video/out/opengl/common.h
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.xyz>2017-07-16 17:17:39 +0200
committerNiklas Haas <git@haasn.xyz>2017-07-16 17:46:24 +0200
commitdead206873c1840a21adf789b9e4b5d167012b19 (patch)
tree5de62f71ae89cd902019a315b786c239dd09327b /video/out/opengl/common.h
parent46bfa3726f6163cb812425b49a8483c635b6d623 (diff)
downloadmpv-dead206873c1840a21adf789b9e4b5d167012b19.tar.bz2
mpv-dead206873c1840a21adf789b9e4b5d167012b19.tar.xz
vo_opengl: use glBufferSubData instead of glMapBufferRange
Performance seems pretty much unchanged but I no longer get nasty spikes on NUMA systems, probably because glBufferSubData runs in the driver or something. As a simplification of the code, we also just size the PBO to always have the full size, even for cropped textures. This seems slower but not by relevant amounts, and only affects e.g. --vf=crop. It also slightly increases VRAM usage for textures with big strides. This new code path is especially nice because it no longer depends on GL_ARB_map_buffer_range, and no longer uses any functions that can possibly fail, thus simplifying control flow and seemingly deprecating the manpage's claim about possible image corruption. In theory we could also reduce NUM_PBO_BUFFERS since it doesn't seem like we're streaming uploads anyway, but leave it in there just in case some drivers disagree...
Diffstat (limited to 'video/out/opengl/common.h')
-rw-r--r--video/out/opengl/common.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/video/out/opengl/common.h b/video/out/opengl/common.h
index 351624051f..c9162f2479 100644
--- a/video/out/opengl/common.h
+++ b/video/out/opengl/common.h
@@ -128,6 +128,7 @@ struct GL {
GLbitfield);
GLboolean (GLAPIENTRY *UnmapBuffer)(GLenum);
void (GLAPIENTRY *BufferData)(GLenum, intptr_t, const GLvoid *, GLenum);
+ void (GLAPIENTRY *BufferSubData)(GLenum, GLintptr, GLsizeiptr, const GLvoid *);
void (GLAPIENTRY *ActiveTexture)(GLenum);
void (GLAPIENTRY *BindTexture)(GLenum, GLuint);
int (GLAPIENTRY *SwapInterval)(int);