[Mesa-dev] [PATCH] intel: fix read_only/write_only

Ben Widawsky ben at bwidawsk.net
Mon Aug 22 10:37:52 PDT 2011


Here was my patch which I forgot to send to the list. I think you missed
map.

Signed-off-by: Ben Widawsky <ben at bwidawsk.net>
---
 src/mesa/drivers/dri/intel/intel_buffer_objects.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/mesa/drivers/dri/intel/intel_buffer_objects.c b/src/mesa/drivers/dri/intel/intel_buffer_objects.c
index 703300b..bab5d46 100644
--- a/src/mesa/drivers/dri/intel/intel_buffer_objects.c
+++ b/src/mesa/drivers/dri/intel/intel_buffer_objects.c
@@ -307,8 +307,10 @@ intel_bufferobj_map(struct gl_context * ctx,
 {
    struct intel_context *intel = intel_context(ctx);
    struct intel_buffer_object *intel_obj = intel_buffer_object(obj);
-   GLboolean read_only = (access == GL_READ_ONLY_ARB);
-   GLboolean write_only = (access == GL_WRITE_ONLY_ARB);
+   GLboolean read_only = (access & (GL_MAP_READ_BIT|GL_MAP_WRITE_BIT) ==
+			 GL_MAP_READ_BIT);
+   GLboolean write_only = (access & (GL_MAP_READ_BIT|GL_MAP_WRITE_BIT) ==
+			  GL_MAP_WRITE_BIT);
 
    assert(intel_obj);
 
@@ -378,7 +380,8 @@ intel_bufferobj_map_range(struct gl_context * ctx,
 {
    struct intel_context *intel = intel_context(ctx);
    struct intel_buffer_object *intel_obj = intel_buffer_object(obj);
-   GLboolean read_only = (access == GL_READ_ONLY_ARB);
+   GLboolean read_only = (access & (GL_MAP_READ_BIT|GL_MAP_WRITE_BIT) ==
+			 GL_MAP_READ_BIT);
 
    assert(intel_obj);
 
-- 
1.7.6



More information about the mesa-dev mailing list