summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolai Hähnle <nicolai.haehnle@amd.com>2017-07-27 19:41:26 +0200
committerNicolai Hähnle <nicolai.haehnle@amd.com>2017-07-31 18:32:09 +0200
commit45037532fa9c4ecdd74bd48dc01883ca97547d8c (patch)
tree9c4994c0a6239ddfca4870444bb2cf4b08fe06af
parent14a8430d1df989209ba80bfb3995bbadd761c695 (diff)
radeonsi: avoid redundant SET_PREDICATION packet with QBO workaround
The QBO workaround compute grid launch emits the render condition atom when dirty, so install the render condition in the context only after launching the compute grid. This avoids a redundant SET_PREDICATION.
-rw-r--r--src/gallium/drivers/radeon/r600_query.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/gallium/drivers/radeon/r600_query.c b/src/gallium/drivers/radeon/r600_query.c
index 67ffa9af1e..ccdefb4f6a 100644
--- a/src/gallium/drivers/radeon/r600_query.c
+++ b/src/gallium/drivers/radeon/r600_query.c
@@ -1788,10 +1788,6 @@ static void r600_render_condition(struct pipe_context *ctx,
struct r600_query_buffer *qbuf;
struct r600_atom *atom = &rctx->render_cond_atom;
- rctx->render_cond = query;
- rctx->render_cond_invert = condition;
- rctx->render_cond_mode = mode;
-
/* Compute the size of SET_PREDICATION packets. */
atom->num_dw = 0;
if (query) {
@@ -1818,6 +1814,11 @@ static void r600_render_condition(struct pipe_context *ctx,
&rquery->workaround_offset,
(struct pipe_resource **)&rquery->workaround_buf);
+ /* Reset to NULL to avoid a redundant SET_PREDICATION
+ * from launching the compute grid.
+ */
+ rctx->render_cond = NULL;
+
ctx->get_query_result_resource(
ctx, query, true, PIPE_QUERY_TYPE_U64, 0,
&rquery->workaround_buf->b.b, rquery->workaround_offset);
@@ -1834,6 +1835,10 @@ static void r600_render_condition(struct pipe_context *ctx,
}
}
+ rctx->render_cond = query;
+ rctx->render_cond_invert = condition;
+ rctx->render_cond_mode = mode;
+
rctx->set_atom_dirty(rctx, atom, query != NULL);
}