[Mesa-dev] [PATCH] intel: fix mapping of malloc'd renderbuffers

Brian Paul brianp at vmware.com
Sat Jan 7 14:08:19 PST 2012


This fixes accum buffer operations.  The accumulation buffer is the
only malloc-based renderbuffer for the intel drivers.
---
 src/mesa/drivers/dri/intel/intel_fbo.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c
index b95193d..8cb6c2a 100644
--- a/src/mesa/drivers/dri/intel/intel_fbo.c
+++ b/src/mesa/drivers/dri/intel/intel_fbo.c
@@ -132,6 +132,13 @@ intel_map_renderbuffer(struct gl_context *ctx,
    void *map;
    int stride;
 
+   if (!irb && rb->Data) {
+      /* this is a malloc'd renderbuffer (accum buffer) */
+      *out_map = rb->Data;
+      *out_stride = rb->RowStride * _mesa_get_format_bytes(rb->Format);
+      return;
+   }
+
    /* We sometimes get called with this by our intel_span.c usage. */
    if (!irb->mt) {
       *out_map = NULL;
@@ -176,6 +183,12 @@ intel_unmap_renderbuffer(struct gl_context *ctx,
    DBG("%s: rb %d (%s)\n", __FUNCTION__,
        rb->Name, _mesa_get_format_name(rb->Format));
 
+   if (!irb && rb->Data) {
+      /* this is a malloc'd renderbuffer (accum buffer) */
+      /* nothing to do */
+      return;
+   }
+
    intel_miptree_unmap(intel, irb->mt, irb->mt_level, irb->mt_layer);
 }
 
-- 
1.7.3.4



More information about the mesa-dev mailing list