i965: Stop passing num_samples to intel_miptree_alloc_hiz().

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>
This commit is contained in:
Paul Berry
2013-04-25 10:57:48 -07:00
parent d48054ff22
commit bdf13dc832
3 changed files with 6 additions and 8 deletions
+2 -2
View 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);
@@ -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)
@@ -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,