i965: Stop passing num_samples to intel_miptree_alloc_hiz(). 21/6321/1
authorPaul Berry <stereotype441@gmail.com>
Thu, 25 Apr 2013 17:57:48 +0000 (10:57 -0700)
committerPaul Berry <stereotype441@gmail.com>
Tue, 30 Apr 2013 20:46:57 +0000 (13:46 -0700)
The number of samples is already available in the miptree data
structure, so there's no need to pass it in.

I suspect this may fix a subtle bug because in one case
(intel_renderbuffer_update_wrapper) we were always passing zero for
num_samples, even though the buffer in question was not guaranteed to
be single-sampled.  But I wasn't able to find a failing test case.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/intel/intel_fbo.c
src/mesa/drivers/dri/intel/intel_mipmap_tree.c
src/mesa/drivers/dri/intel/intel_mipmap_tree.h

index 15d3918..6730d26 100644 (file)
@@ -526,7 +526,7 @@ intel_renderbuffer_update_wrapper(struct intel_context *intel,
 
    if (mt->hiz_mt == NULL &&
        intel->vtbl.is_hiz_depth_format(intel, rb->Format)) {
-      intel_miptree_alloc_hiz(intel, mt, 0 /* num_samples */);
+      intel_miptree_alloc_hiz(intel, mt);
       if (!mt->hiz_mt)
         return false;
    }
@@ -1025,7 +1025,7 @@ intel_renderbuffer_move_to_temp(struct intel_context *intel,
                                  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_alloc_hiz(intel, new_mt);
    }
 
    intel_miptree_copy_teximage(intel, intel_image, new_mt, invalidate);
index 12a4a22..c5f9f1f 100644 (file)
@@ -573,7 +573,7 @@ intel_miptree_create_for_renderbuffer(struct intel_context *intel,
       goto fail;
 
    if (intel->vtbl.is_hiz_depth_format(intel, format)) {
-      ok = intel_miptree_alloc_hiz(intel, mt, num_samples);
+      ok = intel_miptree_alloc_hiz(intel, mt);
       if (!ok)
          goto fail;
    }
@@ -1066,8 +1066,7 @@ intel_miptree_slice_enable_hiz(struct intel_context *intel,
 
 bool
 intel_miptree_alloc_hiz(struct intel_context *intel,
-                       struct intel_mipmap_tree *mt,
-                        GLuint num_samples)
+                       struct intel_mipmap_tree *mt)
 {
    assert(mt->hiz_mt == NULL);
    mt->hiz_mt = intel_miptree_create(intel,
@@ -1079,7 +1078,7 @@ intel_miptree_alloc_hiz(struct intel_context *intel,
                                      mt->logical_height0,
                                      mt->logical_depth0,
                                      true,
-                                     num_samples,
+                                     mt->num_samples,
                                      false /* force_y_tiling */);
 
    if (!mt->hiz_mt)
index 29cd09d..b7376e0 100644 (file)
@@ -540,8 +540,7 @@ intel_miptree_alloc_mcs(struct intel_context *intel,
 
 bool
 intel_miptree_alloc_hiz(struct intel_context *intel,
-                       struct intel_mipmap_tree *mt,
-                        GLuint num_samples);
+                       struct intel_mipmap_tree *mt);
 
 bool
 intel_miptree_slice_has_hiz(struct intel_mipmap_tree *mt,