From: Dave Airlie Date: Fri, 10 Nov 2017 03:46:19 +0000 (+1000) Subject: r600: don't emit atomic save if we have no atomic counters. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=da31e2c22d72af041a4558b30eb354ff17f000ba;p=mesa.git r600: don't emit atomic save if we have no atomic counters. Otherwise we end up emitting the fence. Tested-By: Gert Wollny Signed-off-by: Dave Airlie --- diff --git a/src/gallium/drivers/r600/evergreen_state.c b/src/gallium/drivers/r600/evergreen_state.c index eb8b139910d..68977bb36de 100644 --- a/src/gallium/drivers/r600/evergreen_state.c +++ b/src/gallium/drivers/r600/evergreen_state.c @@ -4221,6 +4221,9 @@ void evergreen_emit_atomic_buffer_save(struct r600_context *rctx, unsigned reloc; mask = *atomic_used_mask_p; + if (!mask) + return; + while (mask) { unsigned atomic_index = u_bit_scan(&mask); struct r600_shader_atomic *atomic = &combined_atomics[atomic_index];