From 68573f57eeba1229a7963440428c3229c7ad7ff6 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Tue, 17 Feb 2015 16:10:10 -0700 Subject: ilo: fix compiler warnings Fix -Wmaybe-uninitialized warnings. The change to ilo_blit_resolve_slices_for_hiz() is a potential bug fix. --- src/gallium/drivers/ilo/ilo_blit.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src/gallium/drivers/ilo/ilo_blit.c') diff --git a/src/gallium/drivers/ilo/ilo_blit.c b/src/gallium/drivers/ilo/ilo_blit.c index ad6aa801602..42072c2fed0 100644 --- a/src/gallium/drivers/ilo/ilo_blit.c +++ b/src/gallium/drivers/ilo/ilo_blit.c @@ -190,8 +190,9 @@ ilo_blit_resolve_slices_for_hiz(struct ilo_context *ilo, assert(!(resolve_flags & (other_writers | any_reader))); if (!(resolve_flags & ILO_TEXTURE_CLEAR)) { + const uint32_t first_clear_value = ilo_texture_get_slice(tex, + level, first_slice)->clear_value; bool set_clear_value = false; - uint32_t first_clear_value; for (i = 0; i < num_slices; i++) { const struct ilo_texture_slice *slice = @@ -200,12 +201,8 @@ ilo_blit_resolve_slices_for_hiz(struct ilo_context *ilo, if (slice->flags & other_writers) { ilo_blitter_rectlist_resolve_hiz(ilo->blitter, res, level, first_slice + i); - } - else if (i == 0) { - first_clear_value = slice->clear_value; - } - else if (slice->clear_value != first_clear_value && - (slice->flags & ILO_TEXTURE_RENDER_WRITE)) { + } else if (slice->clear_value != first_clear_value && + (slice->flags & ILO_TEXTURE_RENDER_WRITE)) { ilo_blitter_rectlist_resolve_z(ilo->blitter, res, level, first_slice + i); set_clear_value = true; -- cgit v1.2.3