radeonsi: Fix some warnings.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Thu, 4 Jul 2019 00:11:27 +0000 (02:11 +0200)
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Thu, 4 Jul 2019 11:12:27 +0000 (11:12 +0000)
../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 <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/drivers/radeonsi/si_compute_blit.c
src/gallium/drivers/radeonsi/si_compute_prim_discard.c

index 29ead4cdfaad730b0da28eb5e9db6756f676ae97..240baa4b164e3526e46c8fd9b24ee034db644a41 100644 (file)
@@ -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);
index c25a5b270c1acd5760ff2cb53e73045e5ca62ecd..424015061074a35120786dbcc68b30bfddeb3850 100644 (file)
@@ -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;