[Mesa-dev] [PATCH] r600: don't emit atomic save if we have no atomic counters.

Dave Airlie airlied at gmail.com
Fri Nov 10 03:47:35 UTC 2017


From: Dave Airlie <airlied at redhat.com>

Otherwise we end up emitting the fence.

Signed-off-by: Dave Airlie <airlied at redhat.com>
---
 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 c1d13fd..30819ae 100644
--- a/src/gallium/drivers/r600/evergreen_state.c
+++ b/src/gallium/drivers/r600/evergreen_state.c
@@ -4634,6 +4634,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.9.5



More information about the mesa-dev mailing list