[Mesa-dev] [PATCH 3/5] intel: Remove now trivial intel_renderbuffer_set_{hiz_, }region().
Eric Anholt
eric at anholt.net
Wed Jun 29 15:26:50 PDT 2011
Note that as a result of this cleanup a bug in
intel_process_dri2_buffer_no_separate_stencil() beomes quite apparent.
---
src/mesa/drivers/dri/intel/intel_context.c | 40 ++++++++++++----------------
src/mesa/drivers/dri/intel/intel_fbo.c | 19 -------------
src/mesa/drivers/dri/intel/intel_fbo.h | 12 --------
3 files changed, 17 insertions(+), 54 deletions(-)
diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c
index 547d81b..91f6c6d 100644
--- a/src/mesa/drivers/dri/intel/intel_context.c
+++ b/src/mesa/drivers/dri/intel/intel_context.c
@@ -1112,7 +1112,6 @@ intel_query_dri2_buffers_no_separate_stencil(struct intel_context *intel,
*
* \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,
@@ -1124,7 +1123,6 @@ 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)
@@ -1151,20 +1149,18 @@ intel_process_dri2_buffer_no_separate_stencil(struct intel_context *intel,
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);
@@ -1175,7 +1171,8 @@ intel_process_dri2_buffer_no_separate_stencil(struct intel_context *intel,
if (stencil_rb->region && stencil_rb->region->name == buffer->name)
return;
- intel_renderbuffer_set_region(intel, stencil_rb, region);
+ /* XXX: Surely this is incorrect. */
+ intel_region_reference(&stencil_rb->region, NULL);
}
}
@@ -1300,7 +1297,6 @@ intel_query_dri2_buffers_with_separate_stencil(struct intel_context *intel,
*
* \see intel_update_renderbuffers()
* \see intel_region_alloc_for_handle()
- * \see intel_renderbuffer_set_region()
* \see enum intel_dri2_has_hiz
*/
static void
@@ -1360,9 +1356,9 @@ intel_process_dri2_buffer_with_separate_stencil(struct intel_context *intel,
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);
@@ -1511,12 +1507,10 @@ intel_verify_dri2_has_hiz(struct intel_context *intel,
/ 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);
}
}
diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c
index ee656ed..1246002 100644
--- a/src/mesa/drivers/dri/intel/intel_fbo.c
+++ b/src/mesa/drivers/dri/intel/intel_fbo.c
@@ -343,25 +343,6 @@ intel_nop_alloc_storage(struct gl_context * ctx, struct gl_renderbuffer *rb,
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.
diff --git a/src/mesa/drivers/dri/intel/intel_fbo.h b/src/mesa/drivers/dri/intel/intel_fbo.h
index cbf29c8..f7f99a4 100644
--- a/src/mesa/drivers/dri/intel/intel_fbo.h
+++ b/src/mesa/drivers/dri/intel/intel_fbo.h
@@ -155,18 +155,6 @@ intel_framebuffer_has_hiz(struct gl_framebuffer *fb)
return intel_framebuffer_get_hiz_region(fb) != NULL;
}
-
-extern void
-intel_renderbuffer_set_region(struct intel_context *intel,
- struct intel_renderbuffer *irb,
- struct intel_region *region);
-
-extern void
-intel_renderbuffer_set_hiz_region(struct intel_context *intel,
- struct intel_renderbuffer *rb,
- struct intel_region *region);
-
-
extern struct intel_renderbuffer *
intel_create_renderbuffer(gl_format format);
--
1.7.5.4
More information about the mesa-dev
mailing list