diff options
author | Xiang, Haihao <[email protected]> | 2008-01-10 16:45:35 +0800 |
---|---|---|
committer | Xiang, Haihao <[email protected]> | 2008-01-10 16:45:35 +0800 |
commit | c30392f187dc45412e579283989992ed4dd2fed8 (patch) | |
tree | 540da73413d0ffa3383dacee9c93f25d73394595 /src | |
parent | e131c46b20241737ceba4856dbe01dcca6dd2c03 (diff) |
i965: fix segfault caused by commit e131c46b20241737ceba4856dbe01dcca6dd2c03.
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/drivers/dri/i965/intel_context.c | 30 | ||||
-rw-r--r-- | src/mesa/drivers/dri/intel/intel_span.c | 12 |
2 files changed, 21 insertions, 21 deletions
diff --git a/src/mesa/drivers/dri/i965/intel_context.c b/src/mesa/drivers/dri/i965/intel_context.c index 4ee7ca6a261..973eed50f98 100644 --- a/src/mesa/drivers/dri/i965/intel_context.c +++ b/src/mesa/drivers/dri/i965/intel_context.c @@ -670,27 +670,27 @@ GLboolean intelMakeCurrent(__DRIcontextPrivate *driContextPriv, */ { struct intel_renderbuffer *irbDepth - = intel_get_renderbuffer(&intel_fb->Base, BUFFER_DEPTH); + = intel_get_renderbuffer(&intel_fb->Base, BUFFER_DEPTH); struct intel_renderbuffer *irbStencil - = intel_get_renderbuffer(&intel_fb->Base, BUFFER_STENCIL); + = intel_get_renderbuffer(&intel_fb->Base, BUFFER_STENCIL); - if (intel_fb->color_rb[0] && !intel_fb->color_rb[0]->region) { - intel_region_reference(&intel_fb->color_rb[0]->region, - intel->front_region); + if (intel_fb->color_rb[0]) { + intel_renderbuffer_set_region(intel_fb->color_rb[0], + intel->front_region); } - if (intel_fb->color_rb[1] && !intel_fb->color_rb[1]->region) { - intel_region_reference(&intel_fb->color_rb[1]->region, - intel->back_region); + if (intel_fb->color_rb[1]) { + intel_renderbuffer_set_region(intel_fb->color_rb[1], + intel->back_region); } - if (intel_fb->color_rb[2] && !intel_fb->color_rb[2]->region) { - intel_region_reference(&intel_fb->color_rb[2]->region, - intel->third_region); + if (intel_fb->color_rb[2]) { + intel_renderbuffer_set_region(intel_fb->color_rb[2], + intel->third_region); } - if (irbDepth && !irbDepth->region) { - intel_region_reference(&irbDepth->region, intel->depth_region); + if (irbDepth) { + intel_renderbuffer_set_region(irbDepth, intel->depth_region); } - if (irbStencil && !irbStencil->region) { - intel_region_reference(&irbStencil->region, intel->depth_region); + if (irbStencil) { + intel_renderbuffer_set_region(irbStencil, intel->depth_region); } } diff --git a/src/mesa/drivers/dri/intel/intel_span.c b/src/mesa/drivers/dri/intel/intel_span.c index 298e453c428..df4f5927a0f 100644 --- a/src/mesa/drivers/dri/intel/intel_span.c +++ b/src/mesa/drivers/dri/intel/intel_span.c @@ -264,7 +264,7 @@ intel_map_unmap_buffers(struct intel_context *intel, GLboolean map) /* depth buffer (Note wrapper!) */ if (ctx->DrawBuffer->_DepthBuffer) { irb = intel_renderbuffer(ctx->DrawBuffer->_DepthBuffer->Wrapped); - if (irb && irb->region && irb->Base.Name != 0) { + if (irb && irb->region) { if (map) { intel_region_map(intel, irb->region); irb->pfMap = irb->region->map; @@ -272,8 +272,8 @@ intel_map_unmap_buffers(struct intel_context *intel, GLboolean map) } else { intel_region_unmap(intel, irb->region); - irb->pfMap = NULL; - irb->pfPitch = 0; + irb->pfMap = irb->region->map; + irb->pfPitch = irb->region->pitch; } } } @@ -281,7 +281,7 @@ intel_map_unmap_buffers(struct intel_context *intel, GLboolean map) /* stencil buffer (Note wrapper!) */ if (ctx->DrawBuffer->_StencilBuffer) { irb = intel_renderbuffer(ctx->DrawBuffer->_StencilBuffer->Wrapped); - if (irb && irb->region && irb->Base.Name != 0) { + if (irb && irb->region) { if (map) { intel_region_map(intel, irb->region); irb->pfMap = irb->region->map; @@ -289,8 +289,8 @@ intel_map_unmap_buffers(struct intel_context *intel, GLboolean map) } else { intel_region_unmap(intel, irb->region); - irb->pfMap = NULL; - irb->pfPitch = 0; + irb->pfMap = irb->region->map; + irb->pfPitch = irb->region->pitch; } } } |