diff options
author | Eric Anholt <eric@anholt.net> | 2009-04-22 16:24:42 -0700 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2009-04-23 11:13:04 -0700 |
commit | 4f4907d69f9020ce17aef21b6431d2dd65e01982 (patch) | |
tree | 7dfe250cc35dba6801ca839310339edd42beaa88 /src/mesa/drivers/dri/intel | |
parent | f3c7d6ff866cdd96cdd55baee94f58698a9656a3 (diff) |
intel: Take advantage of GL_READ_ONLY_ARB to map to GEM bo_map write flag.
This is a CPU win in general, but in particular reduces the pain of
Mesa's calculation of min/max indices in DrawElements (wtf?).
Diffstat (limited to 'src/mesa/drivers/dri/intel')
-rw-r--r-- | src/mesa/drivers/dri/intel/intel_buffer_objects.c | 5 |
1 files changed, 2 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 b7c7eeb368..c849e4869e 100644 --- a/src/mesa/drivers/dri/intel/intel_buffer_objects.c +++ b/src/mesa/drivers/dri/intel/intel_buffer_objects.c @@ -204,9 +204,8 @@ intel_bufferobj_map(GLcontext * 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); - /* XXX: Translate access to flags arg below: - */ assert(intel_obj); if (intel_obj->region) @@ -217,7 +216,7 @@ intel_bufferobj_map(GLcontext * ctx, return NULL; } - dri_bo_map(intel_obj->buffer, GL_TRUE); + dri_bo_map(intel_obj->buffer, !read_only); obj->Pointer = intel_obj->buffer->virtual; return obj->Pointer; } |