GLES: Support glMapBufferRange from ES3

ES3 provides glMapBufferRange as core, with the added bonus that it also
supports read mappings. Use this where possible.

Signed-off-by: Daniel Stone <daniels@collabora.com>

https://bugzilla.gnome.org/show_bug.cgi?id=728355
This commit is contained in:
Daniel Stone 2015-09-23 12:11:50 +01:00 committed by Emmanuele Bassi
parent d6f415d491
commit 5253264f2f
2 changed files with 12 additions and 1 deletions

View File

@ -404,6 +404,17 @@ _cogl_driver_update_features (CoglContext *context,
COGL_FEATURE_ID_MAP_BUFFER_FOR_WRITE, TRUE);
}
if (context->glMapBufferRange)
{
/* MapBufferRange in ES3+ does support mapping for read */
flags |= (COGL_FEATURE_MAP_BUFFER_FOR_WRITE |
COGL_FEATURE_MAP_BUFFER_FOR_READ);
COGL_FLAGS_SET(context->features,
COGL_FEATURE_ID_MAP_BUFFER_FOR_WRITE, TRUE);
COGL_FLAGS_SET(context->features,
COGL_FEATURE_ID_MAP_BUFFER_FOR_READ, TRUE);
}
if (context->glEGLImageTargetTexture2D)
COGL_FLAGS_SET (private_features,
COGL_PRIVATE_FEATURE_TEXTURE_2D_FROM_EGL_IMAGE, TRUE);

View File

@ -295,7 +295,7 @@ COGL_EXT_FUNCTION (void, glGenVertexArrays,
COGL_EXT_END ()
COGL_EXT_BEGIN (map_region, 3, 0,
0, /* not in either GLES */
COGL_EXT_IN_GLES3,
"ARB:\0",
"map_buffer_range\0")
COGL_EXT_FUNCTION (GLvoid *, glMapBufferRange,