*
* \see intel_update_renderbuffers()
* \see intel_region_alloc_for_handle()
- * \see intel_renderbuffer_set_region()
*/
static void
intel_process_dri2_buffer_no_separate_stencil(struct intel_context *intel,
assert(!intel->must_use_separate_stencil);
struct gl_framebuffer *fb = drawable->driverPrivate;
- struct intel_region *region = NULL;
struct intel_renderbuffer *depth_rb = NULL;
if (!rb)
if (unlikely(INTEL_DEBUG & DEBUG_DRI)) {
fprintf(stderr, "(reusing depth buffer as stencil)\n");
}
- intel_region_reference(®ion, depth_rb->region);
+ intel_region_reference(&rb->region, depth_rb->region);
} else {
- region = intel_region_alloc_for_handle(intel->intelScreen,
- buffer->cpp,
- drawable->w,
- drawable->h,
- buffer->pitch / buffer->cpp,
- buffer->name,
- buffer_name);
+ intel_region_release(&rb->region);
+ rb->region = intel_region_alloc_for_handle(intel->intelScreen,
+ buffer->cpp,
+ drawable->w,
+ drawable->h,
+ buffer->pitch / buffer->cpp,
+ buffer->name,
+ buffer_name);
}
- intel_renderbuffer_set_region(intel, rb, region);
- intel_region_release(®ion);
-
if (buffer->attachment == __DRI_BUFFER_DEPTH_STENCIL) {
struct intel_renderbuffer *stencil_rb =
intel_get_renderbuffer(fb, BUFFER_STENCIL);
if (!stencil_rb)
return;
- if (stencil_rb->region && stencil_rb->region->name == buffer->name)
- return;
-
- intel_renderbuffer_set_region(intel, stencil_rb, region);
+ /* The rb passed in is the BUFFER_DEPTH attachment, and we need
+ * to associate this region to BUFFER_STENCIL as well.
+ */
+ intel_region_reference(&stencil_rb->region, rb->region);
}
}
*
* \see intel_update_renderbuffers()
* \see intel_region_alloc_for_handle()
- * \see intel_renderbuffer_set_region()
* \see enum intel_dri2_has_hiz
*/
static void
buffer_name);
if (buffer->attachment == __DRI_BUFFER_HIZ) {
- intel_renderbuffer_set_hiz_region(intel, rb, region);
+ intel_region_reference(&rb->hiz_region, region);
} else {
- intel_renderbuffer_set_region(intel, rb, region);
+ intel_region_reference(&rb->region, region);
}
intel_region_release(®ion);
/ depth_stencil_buffer->cpp,
depth_stencil_buffer->name,
"dri2 depth / stencil buffer");
- intel_renderbuffer_set_region(intel,
- intel_get_renderbuffer(fb, BUFFER_DEPTH),
- region);
- intel_renderbuffer_set_region(intel,
- intel_get_renderbuffer(fb, BUFFER_STENCIL),
- region);
+ intel_region_reference(&intel_get_renderbuffer(fb, BUFFER_DEPTH)->region,
+ region);
+ intel_region_reference(&intel_get_renderbuffer(fb, BUFFER_STENCIL)->region,
+ region);
intel_region_release(®ion);
}
}
return GL_FALSE;
}
-
-void
-intel_renderbuffer_set_region(struct intel_context *intel,
- struct intel_renderbuffer *rb,
- struct intel_region *region)
-{
- intel_region_reference(&rb->region, region);
-}
-
-
-void
-intel_renderbuffer_set_hiz_region(struct intel_context *intel,
- struct intel_renderbuffer *rb,
- struct intel_region *region)
-{
- intel_region_reference(&rb->hiz_region, region);
-}
-
-
/**
* Create a new intel_renderbuffer which corresponds to an on-screen window,
* not a user-created renderbuffer.