[Mesa-dev] [PATCH 5/5] intel: Remove intel_renderbuffer::hiz_region
Eric Anholt
eric at anholt.net
Tue Oct 18 15:57:24 PDT 2011
On Mon, 17 Oct 2011 07:40:28 -0700, Chad Versace <chad at chad-versace.us> wrote:
> Replace it with intel_renderbuffer::region::hiz::region.
>
> Signed-off-by: Chad Versace <chad at chad-versace.us>
> ---
> src/mesa/drivers/dri/i965/brw_misc_state.c | 27 +++++++++--------
> src/mesa/drivers/dri/intel/intel_context.c | 10 ++++--
> src/mesa/drivers/dri/intel/intel_fbo.c | 36 +++++------------------
> src/mesa/drivers/dri/intel/intel_fbo.h | 3 --
> src/mesa/drivers/dri/intel/intel_mipmap_tree.c | 1 -
> src/mesa/drivers/dri/intel/intel_mipmap_tree.h | 14 ---------
> 6 files changed, 29 insertions(+), 62 deletions(-)
>
> diff --git a/src/mesa/drivers/dri/i965/brw_misc_state.c b/src/mesa/drivers/dri/i965/brw_misc_state.c
> index 2e6780b..6b521e0 100644
> --- a/src/mesa/drivers/dri/i965/brw_misc_state.c
> +++ b/src/mesa/drivers/dri/i965/brw_misc_state.c
> @@ -583,21 +574,10 @@ intel_update_tex_wrapper_regions(struct intel_context *intel,
>
> /* Allocate the texture's hiz region if necessary. */
> if (intel->vtbl.is_hiz_depth_format(intel, rb->Format)
> - && !intel_image->mt->hiz_region) {
> - intel_image->mt->hiz_region =
> - intel_region_alloc(intel->intelScreen,
> - I915_TILING_Y,
> - _mesa_get_format_bytes(rb->Format),
> - rb->Width,
> - rb->Height,
> - GL_TRUE);
> - if (!intel_image->mt->hiz_region)
> - return GL_FALSE;
> - }
> -
> - /* Point the renderbuffer's hiz region to the texture's hiz region. */
> - if (irb->hiz_region != intel_image->mt->hiz_region) {
> - intel_region_reference(&irb->hiz_region, intel_image->mt->hiz_region);
> + && irb->region->hiz.region == NULL) {
> + bool ok = intel_renderbuffer_alloc_hiz(intel, irb);
> + if (!ok)
> + return false;
> }
I think you're aware of this already, but just in case:
The hiz region allocated here using the new rb_alloc_hiz looks like it
will be based on the size of the whole texture miptree (since it looks
up the region's size, not rb w/h), while all that should be needed is
the maximum size of any texture image.
I think we could just use Width/Height, if we resolved at
FinishRenderTexture time and freed the renderbuffer's hiz region (which
I think would be reasonable for now, and should make mipmapped depth hiz
pretty straightforward).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20111018/d65f814f/attachment-0001.pgp>
More information about the mesa-dev
mailing list