[Mesa-dev] [PATCH] mesa: Set default bufferobj access to zero

Matt Turner mattst88 at gmail.com
Mon Nov 19 10:55:51 PST 2012


Fixes - copy_buffer_defaults
      - map_buffer_range_modify_indices
      - pixel_buffer_object_default_parameters
in es3conform.
---
 src/mesa/main/bufferobj.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

This code was previously returning GL_MAP_WRITE_BIT for ES since
GL_OES_mapbuffer is exposed. We *do* expose this on ES 3 as well,
so we probably need to do something more than this patch.

diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
index 5521617..8471b60 100644
--- a/src/mesa/main/bufferobj.c
+++ b/src/mesa/main/bufferobj.c
@@ -155,8 +155,13 @@ default_access_mode(const struct gl_context *ctx)
     * The difference is because GL_OES_mapbuffer only supports mapping buffers
     * write-only.
     */
-   return _mesa_is_gles(ctx)
-      ? GL_MAP_WRITE_BIT : (GL_MAP_READ_BIT | GL_MAP_WRITE_BIT);
+   if (_mesa_is_gles3(ctx)) {
+      return 0;
+   } else if (_mesa_is_gles(ctx)) {
+      return GL_MAP_WRITE_BIT;
+   } else {
+      return GL_MAP_READ_BIT | GL_MAP_WRITE_BIT;
+   }
 }
 
 
-- 
1.7.8.6



More information about the mesa-dev mailing list