diff options
author | Chris Wilson <[email protected]> | 2016-10-06 21:07:18 +0100 |
---|---|---|
committer | Chris Wilson <[email protected]> | 2017-06-03 13:38:45 +0100 |
commit | 8d07cb125c6afc11b6b8c7a97ec848868814b1d6 (patch) | |
tree | 69ceef558c8bec9d95f1cecdbd30b286688bca8a /src/mesa | |
parent | 98fc0243ef7b0ce1e11061738756b0827c0d3c42 (diff) |
i965: Order write of query availablity with earlier writes
Currently we signal the availabilty of the query result using an
unordered pipe-control write. As it is unordered, it may be executed
before the write of the query result itself - and so an observer may
read the query result too early. Fix this by requesting that the write
of the availablity flag is ordered after earlier pipe control writes.
Testcase: piglit/arb_query_buffer_object-qbo/*async*
Signed-off-by: Chris Wilson <[email protected]>
Reviewed-by: Alejandro PiƱeiro <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/drivers/dri/i965/gen6_queryobj.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/i965/gen6_queryobj.c b/src/mesa/drivers/dri/i965/gen6_queryobj.c index cb4f46c28be..a28f83af1d6 100644 --- a/src/mesa/drivers/dri/i965/gen6_queryobj.c +++ b/src/mesa/drivers/dri/i965/gen6_queryobj.c @@ -60,8 +60,17 @@ set_query_availability(struct brw_context *brw, struct brw_query_object *query, */ if (brw->ctx.Extensions.ARB_query_buffer_object && brw_is_query_pipelined(query)) { - brw_emit_pipe_control_write(brw, - PIPE_CONTROL_WRITE_IMMEDIATE, + unsigned flags = PIPE_CONTROL_WRITE_IMMEDIATE; + + if (available) { + /* Order available *after* the query results. */ + flags |= PIPE_CONTROL_FLUSH_ENABLE; + } else { + /* Make it unavailable *before* any pipelined reads. */ + flags |= PIPE_CONTROL_CS_STALL; + } + + brw_emit_pipe_control_write(brw, flags, query->bo, 2 * sizeof(uint64_t), available, 0); } |