1
0
Fork 0
mutter-performance-source/cogl/gl-prototypes
Neil Roberts ec03357e88 Add cogl_buffer_map_range()
This adds a buffer method to map a subregion of the buffer. This works
using the GL_ARB_map_buffer_range extension. If the extension is not
available then it will fallback to using glMapBuffer to map the entire
buffer and then just add the offset to the returned pointer.

cogl_buffer_map() is now just a wrapper which maps the entire range of
the buffer. The driver backend functions have been renamed to
map_range and they now all take the offset and size arguments.

When the COGL_BUFFER_MAP_HINT_DISCARD hint is used and the map range
extension is available instead of using glBufferData to invalidate the
buffer it will instead pass the new GL_MAP_HINT_INVALIDATE_BUFFER
flag. There is now additionally a COGL_BUFFER_MAP_HINT_DISCARD_REGION
hint which can be used if the application only wants to discard the
small region that is mapped. glMapBufferRange is always used if it is
available even if the entire buffer is being mapped because it seems
more robust to pass those flags then to call glBufferData.

Reviewed-by: Robert Bragg <robert@linux.intel.com>

(cherry picked from commit 55ca02b5ca9cafc750251ec974e0d6a536cb80b8)
2013-01-22 17:48:03 +00:00
..
cogl-all-functions.h Add cogl_buffer_map_range() 2013-01-22 17:48:03 +00:00
cogl-core-functions.h cogl-gles2: Add glTexParameterf to wrapper library 2012-08-06 14:27:44 +01:00
cogl-fixed-functions.h gl-prototypes: split up cogl-ext-functions.h 2012-01-04 19:27:20 +00:00
cogl-gles1-functions.h gl-prototypes: split up cogl-ext-functions.h 2012-01-04 19:27:20 +00:00
cogl-gles2-functions.h gl-prototypes: split up cogl-ext-functions.h 2012-01-04 19:27:20 +00:00
cogl-glsl-functions.h Use the old GLSL extensions if GL 2.0 is not available 2012-08-06 14:27:45 +01:00
cogl-in-gles-core-functions.h Add a GL 3 driver 2013-01-22 17:48:01 +00:00
cogl-in-gles1-core-functions.h gl-prototypes: split up cogl-ext-functions.h 2012-01-04 19:27:20 +00:00
cogl-in-gles2-core-functions.h Add a GL 3 driver 2013-01-22 17:48:01 +00:00