From: Bas Nieuwenhuizen Date: Thu, 4 Jul 2019 00:11:27 +0000 (+0200) Subject: radeonsi: Fix some warnings. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bbbcb49f9bb450a6db4ce61a6f15b1d61b9c5b1d;p=mesa.git radeonsi: Fix some warnings. ../mesa/src/gallium/drivers/radeonsi/si_compute_blit.c: In function ‘si_clear_buffer’: ../mesa/src/gallium/drivers/radeonsi/si_compute_blit.c:195:11: warning: unused variable ‘clear_alignment’ [-Wunused-variable] unsigned clear_alignment = MIN2(clear_value_size, 4); ^~~~~~~~~~~~~~~ [23/60] Compiling C object 'src/gallium/drivers/radeonsi/3cdc30e@@radeonsi@sta/si_compute_prim_discard.c.o'. ../mesa/src/gallium/drivers/radeonsi/si_compute_prim_discard.c: In function ‘si_prepare_prim_discard_or_split_draw’: ../mesa/src/gallium/drivers/radeonsi/si_compute_prim_discard.c:1106:7: warning: unused variable ‘compute_has_space’ [-Wunused-variable] bool compute_has_space = sctx->ws->cs_check_space(cs, need_compute_dw, false); Reviewed-by: Timothy Arceri Reviewed-by: Marek Olšák --- diff --git a/src/gallium/drivers/radeonsi/si_compute_blit.c b/src/gallium/drivers/radeonsi/si_compute_blit.c index 29ead4cdfaa..240baa4b164 100644 --- a/src/gallium/drivers/radeonsi/si_compute_blit.c +++ b/src/gallium/drivers/radeonsi/si_compute_blit.c @@ -192,7 +192,7 @@ void si_clear_buffer(struct si_context *sctx, struct pipe_resource *dst, if (!size) return; - unsigned clear_alignment = MIN2(clear_value_size, 4); + MAYBE_UNUSED unsigned clear_alignment = MIN2(clear_value_size, 4); assert(clear_value_size != 3 && clear_value_size != 6); /* 12 is allowed. */ assert(offset % clear_alignment == 0); diff --git a/src/gallium/drivers/radeonsi/si_compute_prim_discard.c b/src/gallium/drivers/radeonsi/si_compute_prim_discard.c index c25a5b270c1..42401506107 100644 --- a/src/gallium/drivers/radeonsi/si_compute_prim_discard.c +++ b/src/gallium/drivers/radeonsi/si_compute_prim_discard.c @@ -1103,7 +1103,7 @@ si_prepare_prim_discard_or_split_draw(struct si_context *sctx, /* The compute IB is always chained, but we need to call cs_check_space to add more space. */ struct radeon_cmdbuf *cs = sctx->prim_discard_compute_cs; - bool compute_has_space = sctx->ws->cs_check_space(cs, need_compute_dw, false); + MAYBE_UNUSED bool compute_has_space = sctx->ws->cs_check_space(cs, need_compute_dw, false); assert(compute_has_space); assert(si_check_ring_space(sctx, out_indexbuf_size)); return SI_PRIM_DISCARD_ENABLED;