[PATCH 06/10] glamor: Select VBO path by ARB_mbr extension.

Markus Wick markus at selfnet.de
Tue Mar 18 01:42:52 PDT 2014


The mbr path was hard coded enabled for desktop gl and disabled for gles.
But there are both, desktop without mbr and mobiles with mbr.
---
 glamor/glamor.c      | 2 ++
 glamor/glamor_priv.h | 1 +
 glamor/glamor_vbo.c  | 4 ++--
 3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/glamor/glamor.c b/glamor/glamor.c
index eb13430..0d0f52c 100644
--- a/glamor/glamor.c
+++ b/glamor/glamor.c
@@ -378,6 +378,8 @@ glamor_init(ScreenPtr screen, unsigned int flags)
         epoxy_has_gl_extension("GL_MESA_pack_invert");
     glamor_priv->has_fbo_blit =
         epoxy_has_gl_extension("GL_EXT_framebuffer_blit");
+    glamor_priv->has_map_buffer_range =
+        epoxy_has_gl_extension("GL_ARB_map_buffer_range");
     glamor_priv->has_buffer_storage =
         epoxy_has_gl_extension("GL_ARB_buffer_storage");
     glGetIntegerv(GL_MAX_RENDERBUFFER_SIZE, &glamor_priv->max_fbo_size);
diff --git a/glamor/glamor_priv.h b/glamor/glamor_priv.h
index 0f0b0f3..d4d2e75 100644
--- a/glamor/glamor_priv.h
+++ b/glamor/glamor_priv.h
@@ -213,6 +213,7 @@ typedef struct glamor_screen_private {
     enum glamor_gl_flavor gl_flavor;
     int has_pack_invert;
     int has_fbo_blit;
+    int has_map_buffer_range;
     int has_buffer_storage;
     int has_khr_debug;
     int max_fbo_size;
diff --git a/glamor/glamor_vbo.c b/glamor/glamor_vbo.c
index 5e98bfe..c6ffea8 100644
--- a/glamor/glamor_vbo.c
+++ b/glamor/glamor_vbo.c
@@ -96,7 +96,7 @@ glamor_get_vbo_space(ScreenPtr screen, unsigned size, char **vbo_offset)
         *vbo_offset = (void *)(uintptr_t)glamor_priv->vbo_offset;
         data = glamor_priv->vb + glamor_priv->vbo_offset;
         glamor_priv->vbo_offset += size;
-    } else if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP) {
+    } else if (glamor_priv->has_map_buffer_range) {
         if (glamor_priv->vbo_size < glamor_priv->vbo_offset + size) {
             glamor_priv->vbo_size = MAX(GLAMOR_VBO_SIZE, size);
             glamor_priv->vbo_offset = 0;
@@ -147,7 +147,7 @@ glamor_put_vbo_space(ScreenPtr screen)
          * persistent mapping, so we can leave it around until we
          * reach the end of the buffer.
          */
-    } else if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP) {
+    } else if (glamor_priv->has_map_buffer_range) {
         glUnmapBuffer(GL_ARRAY_BUFFER);
     } else {
         glBufferData(GL_ARRAY_BUFFER, glamor_priv->vbo_offset,
-- 
1.9.0



More information about the xorg-devel mailing list