i965: Stop passing num_samples to intel_miptree_alloc_hiz().
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 15d3918110cb7b50548a8c9cb9a63fc898791abe..6730d263fa200b141f89553f9015e5ee7119e765 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 12a4a2207867259805787178e71d108a12bdee04..c5f9f1fc8afc28c3d8d4347002acbefb2bfa59d3 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 29cd09d91940697c2d67f52ea64aef5599e9c28f..b7376e03055f22c0d5baa7f0a71cbd3a77ba6569 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,