summaryrefslogtreecommitdiffstats
path: root/src/gui/opengl/qopenglbuffer.h
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@digia.com>2014-06-13 16:36:27 +0200
committerLaszlo Agocs <laszlo.agocs@digia.com>2014-08-08 07:29:53 +0200
commitbb760d9514ed617ee8e7344152b3fa697b2c4171 (patch)
treeff80c5cff36421c1c17bdc86f5349da6194aefa2 /src/gui/opengl/qopenglbuffer.h
parent22e439141384f49028770d2410fafb18ef8cad1f (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/qopenglbuffer.h')
-rw-r--r--src/gui/opengl/qopenglbuffer.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/gui/opengl/qopenglbuffer.h b/src/gui/opengl/qopenglbuffer.h
index ab564e9001..45e872e9a6 100644
--- a/src/gui/opengl/qopenglbuffer.h
+++ b/src/gui/opengl/qopenglbuffer.h
@@ -92,6 +92,17 @@ public:
ReadWrite = 0x88BA // GL_READ_WRITE
};
+ enum RangeAccessFlag
+ {
+ RangeRead = 0x0001, // GL_MAP_READ_BIT
+ RangeWrite = 0x0002, // GL_MAP_WRITE_BIT
+ RangeInvalidate = 0x0004, // GL_MAP_INVALIDATE_RANGE_BIT
+ RangeInvalidateBuffer = 0x0008, // GL_MAP_INVALIDATE_BUFFER_BIT
+ RangeFlushExplicit = 0x0010, // GL_MAP_FLUSH_EXPLICIT_BIT
+ RangeUnsynchronized = 0x0020 // GL_MAP_UNSYNCHRONIZED_BIT
+ };
+ Q_DECLARE_FLAGS(RangeAccessFlags, RangeAccessFlag)
+
QOpenGLBuffer::Type type() const;
QOpenGLBuffer::UsagePattern usagePattern() const;
@@ -118,6 +129,7 @@ public:
inline void allocate(int count) { allocate(0, count); }
void *map(QOpenGLBuffer::Access access);
+ void *mapRange(int offset, int count, QOpenGLBuffer::RangeAccessFlags access);
bool unmap();
private:
@@ -126,6 +138,8 @@ private:
Q_DECLARE_PRIVATE(QOpenGLBuffer)
};
+Q_DECLARE_OPERATORS_FOR_FLAGS(QOpenGLBuffer::RangeAccessFlags)
+
QT_END_NAMESPACE
#endif // QT_NO_OPENGL