[Mesa-dev] [PATCH v2 14/20] radeonsi: update predicate condition for compute dispatches

Bas Nieuwenhuizen bas at basnieuwenhuizen.nl
Wed Apr 13 19:29:58 UTC 2016


Signed-off-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
---
 src/gallium/drivers/radeonsi/si_compute.c | 6 ++++++
 src/gallium/drivers/radeonsi/si_pipe.h    | 9 +++++++++
 2 files changed, 15 insertions(+)

diff --git a/src/gallium/drivers/radeonsi/si_compute.c b/src/gallium/drivers/radeonsi/si_compute.c
index 6a4db3a..0b248cb 100644
--- a/src/gallium/drivers/radeonsi/si_compute.c
+++ b/src/gallium/drivers/radeonsi/si_compute.c
@@ -448,6 +448,12 @@ static void si_launch_grid(
 	if (!si_switch_compute_shader(sctx, program, &program->shader, info->pc))
 		return;
 
+	if (si_is_atom_dirty(sctx, sctx->atoms.s.render_cond)) {
+		sctx->atoms.s.render_cond->emit(&sctx->b,
+		                                sctx->atoms.s.render_cond);
+		si_set_atom_dirty(sctx, sctx->atoms.s.render_cond, false);
+	}
+
 	if (program->input_size || program->ir_type == PIPE_SHADER_IR_NATIVE)
 		si_upload_compute_input(sctx, info);
 
diff --git a/src/gallium/drivers/radeonsi/si_pipe.h b/src/gallium/drivers/radeonsi/si_pipe.h
index 3d3d1a9..4a06854 100644
--- a/src/gallium/drivers/radeonsi/si_pipe.h
+++ b/src/gallium/drivers/radeonsi/si_pipe.h
@@ -414,6 +414,15 @@ si_set_atom_dirty(struct si_context *sctx,
 		sctx->dirty_atoms &= ~bit;
 }
 
+static inline bool
+si_is_atom_dirty(struct si_context *sctx,
+		  struct r600_atom *atom)
+{
+	unsigned bit = 1 << (atom->id - 1);
+
+	return sctx->dirty_atoms & bit;
+}
+
 static inline void
 si_mark_atom_dirty(struct si_context *sctx,
 		   struct r600_atom *atom)
-- 
2.8.0



More information about the mesa-dev mailing list