i965: Move brw_emit_query_begin() to the render ring prelude.
authorKenneth Graunke <kenneth@whitecape.org>
Wed, 16 Oct 2013 02:32:53 +0000 (19:32 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 21 Nov 2013 23:01:13 +0000 (15:01 -0800)
commita4bf7f6b6e612626c4e4fc21507ac213a7ba4b00
tree40afa9ca9e17152f8c7339d06a543ee78edc6dfb
parentbb9d2eab8934fe526e7128e5902fffc2f5a050d3
i965: Move brw_emit_query_begin() to the render ring prelude.

Without hardware contexts, the pipeline statistics registers are
free-running and include data from every 3D application running.

In order to find out the contributions of one particular context, we
need to take a snapshot at the start and end of each batch.

Previously, we emitted the PIPE_CONTROL necessary to capture
PS_DEPTH_COUNT when drawing primitives.  Special tracking ensured it
happened only on the first draw of the batch, rather than on every draw.

Moving this to brw_new_batch increases symmetry, since the final
snapshot has always been in brw_finish_batch, which is just a few lines
below.  It should be basically equivalent.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/mesa/drivers/dri/i965/brw_draw_upload.c
src/mesa/drivers/dri/i965/intel_batchbuffer.c