radeonsi: update predicate condition for compute dispatches
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Tue, 5 Apr 2016 15:38:38 +0000 (17:38 +0200)
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Tue, 19 Apr 2016 16:10:31 +0000 (18:10 +0200)
Signed-off-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
src/gallium/drivers/radeonsi/si_compute.c
src/gallium/drivers/radeonsi/si_pipe.h

index 1cdaf6c9ecf1a102191e82e2c60757497b2f9986..e0750314e76a8d6c8c618a365259c594f2a0872a 100644 (file)
@@ -450,6 +450,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);
 
index ff60dcf67dcc1264243c4ffefd063cdd02e24338..5a5249cd8c6bebcc9b5618ad5e1a8cf7ae87d7c5 100644 (file)
@@ -421,6 +421,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)