intel: Allocate hiz in intel_renderbuffer_move_to_temp()
authorChad Versace <chad.versace@linux.intel.com>
Fri, 5 Apr 2013 22:18:00 +0000 (15:18 -0700)
committerChad Versace <chad.versace@linux.intel.com>
Mon, 8 Apr 2013 23:09:26 +0000 (16:09 -0700)
When moving the renderbuffer to a new miptree, we neglected to allocate
the hiz buffer for the new miptree. Oops.

Fixes all Piglit depthstencil-render-miplevels tests from crash to pass on
Sandybridge.

Note: This is a candidate for the 9.1 branch.
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
src/mesa/drivers/dri/intel/intel_fbo.c

index b91d6e0b8d53806a6b09c4983d59987e4311d0af..29775687cc9890cfc47530a151c24a193bc79d2f 100644 (file)
@@ -1010,6 +1010,10 @@ intel_renderbuffer_move_to_temp(struct intel_context *intel,
                                  irb->mt->num_samples,
                                  false /* force_y_tiling */);
 
+   if (intel->vtbl.is_hiz_depth_format(intel, new_mt->format)) {
+      intel_miptree_alloc_hiz(intel, new_mt, irb->mt->num_samples);
+   }
+
    intel_miptree_copy_teximage(intel, intel_image, new_mt, invalidate);
 
    intel_miptree_reference(&irb->mt, intel_image->mt);