From da31e2c22d72af041a4558b30eb354ff17f000ba Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Fri, 10 Nov 2017 13:46:19 +1000 Subject: [PATCH] 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 --- src/gallium/drivers/r600/evergreen_state.c | 3 +++ 1 file changed, 3 insertions(+) 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]; -- 2.30.2