* Write an arbitrary 64-bit register to a buffer via MI_STORE_REGISTER_MEM.
*
* Only TIMESTAMP and PS_DEPTH_COUNT have special PIPE_CONTROL support; other
- * counters have to be read via the generic MI_STORE_REGISTER_MEM. This
- * function also performs a pipeline flush for proper synchronization.
+ * counters have to be read via the generic MI_STORE_REGISTER_MEM.
+ *
+ * Callers must explicitly flush the pipeline to ensure the desired value is
+ * available.
*/
static void
write_reg(struct brw_context *brw,
{
assert(brw->gen >= 6);
- intel_batchbuffer_emit_mi_flush(brw);
-
/* MI_STORE_REGISTER_MEM only stores a single 32-bit value, so to
* read a full 64-bit register, we need to do two of them.
*/
write_primitives_generated(struct brw_context *brw,
drm_intel_bo *query_bo, int idx)
{
+ intel_batchbuffer_emit_mi_flush(brw);
+
write_reg(brw, query_bo, CL_INVOCATION_COUNT, idx);
}
write_xfb_primitives_written(struct brw_context *brw,
drm_intel_bo *query_bo, int idx)
{
+ intel_batchbuffer_emit_mi_flush(brw);
+
if (brw->gen >= 7) {
write_reg(brw, query_bo, GEN7_SO_NUM_PRIMS_WRITTEN(0), idx);
} else {