diff options
author | Laszlo Agocs <laszlo.agocs@digia.com> | 2014-06-13 16:36:27 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@digia.com> | 2014-08-08 07:29:53 +0200 |
commit | bb760d9514ed617ee8e7344152b3fa697b2c4171 (patch) | |
tree | ff80c5cff36421c1c17bdc86f5349da6194aefa2 /src/gui/opengl/qopenglextensions_p.h | |
parent | 22e439141384f49028770d2410fafb18ef8cad1f (diff) |
Add support for glMapBufferRange in the wrappers and resolvers
QOpenGLBuffer::map() and related helpers are becoming useless in
OpenGL ES 3.0 and up: instead of the old GL_OES_map_buffer,
glMapBufferRange, but not glMapBuffer, is now part of the standard.
On desktop GL_ARB_map_buffer_range is present by default in OpenGL 3.0
and newer.
[ChangeLog][QtGui] Added QOpenGLBuffer::mapBufferRange().
Task-number: QTBUG-38168
Change-Id: I4e9bbe8ced9ee4d535ac32849a8c08c26d79cb49
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Diffstat (limited to 'src/gui/opengl/qopenglextensions_p.h')
-rw-r--r-- | src/gui/opengl/qopenglextensions_p.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/gui/opengl/qopenglextensions_p.h b/src/gui/opengl/qopenglextensions_p.h index 065cbb0e57..907e315e41 100644 --- a/src/gui/opengl/qopenglextensions_p.h +++ b/src/gui/opengl/qopenglextensions_p.h @@ -99,7 +99,8 @@ public: Depth24 = 0x00010000, SRGBFrameBuffer = 0x00020000, MapBuffer = 0x00040000, - GeometryShaders = 0x00080000 + GeometryShaders = 0x00080000, + MapBufferRange = 0x00100000 }; Q_DECLARE_FLAGS(OpenGLExtensions, OpenGLExtension) @@ -107,6 +108,7 @@ public: bool hasOpenGLExtension(QOpenGLExtensions::OpenGLExtension extension) const; GLvoid *glMapBuffer(GLenum target, GLenum access); + GLvoid *glMapBufferRange(GLenum target, qopengl_GLintptr offset, qopengl_GLsizeiptr length, GLbitfield access); GLboolean glUnmapBuffer(GLenum target); void glBlitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, @@ -131,6 +133,8 @@ public: explicit QOpenGLExtensionsPrivate(QOpenGLContext *ctx); GLvoid* (QOPENGLF_APIENTRYP MapBuffer)(GLenum target, GLenum access); + GLvoid* (QOPENGLF_APIENTRYP MapBufferRange)(GLenum target, qopengl_GLintptr offset, + qopengl_GLsizeiptr length, GLbitfield access); GLboolean (QOPENGLF_APIENTRYP UnmapBuffer)(GLenum target); void (QOPENGLF_APIENTRYP BlitFramebuffer)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, @@ -150,6 +154,16 @@ inline GLvoid *QOpenGLExtensions::glMapBuffer(GLenum target, GLenum access) return result; } +inline GLvoid *QOpenGLExtensions::glMapBufferRange(GLenum target, qopengl_GLintptr offset, + qopengl_GLsizeiptr length, GLbitfield access) +{ + Q_D(QOpenGLExtensions); + Q_ASSERT(QOpenGLExtensions::isInitialized(d)); + GLvoid *result = d->MapBufferRange(target, offset, length, access); + Q_OPENGL_FUNCTIONS_DEBUG + return result; +} + inline GLboolean QOpenGLExtensions::glUnmapBuffer(GLenum target) { Q_D(QOpenGLExtensions); |