summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2012-01-24 15:52:52 -0800
committerEric Anholt <[email protected]>2012-01-27 11:28:16 -0800
commit42e9936ce6bcac9f863b2f85978489e4f804e927 (patch)
treef52a1be049fdd126daa5b54943a8fea65ea37036 /src/mesa/drivers/dri
parent3d8c27f882b852ada86aac99a54fdb57d98a79ac (diff)
intel: Fix accum buffer mapping since the swrast rework.
A pure swrast-allocated buffer gets an irb of NULL, so we segfaulted in the clear-accum test. Just look at the swrast renderbuffer pointer for handling swrast rbs.
Diffstat (limited to 'src/mesa/drivers/dri')
-rw-r--r--src/mesa/drivers/dri/intel/intel_fbo.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c
index 3a35a01abca..27b0bfcd4ed 100644
--- a/src/mesa/drivers/dri/intel/intel_fbo.c
+++ b/src/mesa/drivers/dri/intel/intel_fbo.c
@@ -128,15 +128,16 @@ intel_map_renderbuffer(struct gl_context *ctx,
GLint *out_stride)
{
struct intel_context *intel = intel_context(ctx);
+ struct swrast_renderbuffer *srb = (struct swrast_renderbuffer *)rb;
struct intel_renderbuffer *irb = intel_renderbuffer(rb);
void *map;
int stride;
- if (!irb && irb->Base.Buffer) {
- /* this is a malloc'd renderbuffer (accum buffer) */
+ if (srb->Buffer) {
+ /* this is a malloc'd renderbuffer (accum buffer), not an irb */
GLint bpp = _mesa_get_format_bytes(rb->Format);
- GLint rowStride = irb->Base.RowStride;
- *out_map = (GLubyte *) irb->Base.Buffer + y * rowStride + x * bpp;
+ GLint rowStride = srb->RowStride;
+ *out_map = (GLubyte *) srb->Buffer + y * rowStride + x * bpp;
*out_stride = rowStride;
return;
}
@@ -180,12 +181,13 @@ intel_unmap_renderbuffer(struct gl_context *ctx,
struct gl_renderbuffer *rb)
{
struct intel_context *intel = intel_context(ctx);
+ struct swrast_renderbuffer *srb = (struct swrast_renderbuffer *)rb;
struct intel_renderbuffer *irb = intel_renderbuffer(rb);
DBG("%s: rb %d (%s)\n", __FUNCTION__,
rb->Name, _mesa_get_format_name(rb->Format));
- if (!irb && irb->Base.Buffer) {
+ if (srb->Buffer) {
/* this is a malloc'd renderbuffer (accum buffer) */
/* nothing to do */
return;