[cogl/cogl-1.22] GLES: Support glMapBufferRange from ES3



commit 5253264f2f76d1c5074e581f46a3326877a6930d
Author: Daniel Stone <daniels collabora com>
Date:   Wed Sep 23 12:11:50 2015 +0100

    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

 cogl/driver/gl/gles/cogl-driver-gles.c  |   11 +++++++++++
 cogl/gl-prototypes/cogl-all-functions.h |    2 +-
 2 files changed, 12 insertions(+), 1 deletions(-)
---
diff --git a/cogl/driver/gl/gles/cogl-driver-gles.c b/cogl/driver/gl/gles/cogl-driver-gles.c
index f144ba3..e94449f 100644
--- a/cogl/driver/gl/gles/cogl-driver-gles.c
+++ b/cogl/driver/gl/gles/cogl-driver-gles.c
@@ -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);
diff --git a/cogl/gl-prototypes/cogl-all-functions.h b/cogl/gl-prototypes/cogl-all-functions.h
index dda08f7..7ac9022 100644
--- a/cogl/gl-prototypes/cogl-all-functions.h
+++ b/cogl/gl-prototypes/cogl-all-functions.h
@@ -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,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]