assert(brw->gen == 7);
- /* Reset the SO buffer offsets to 0. */
- intel_batchbuffer_flush(brw);
- brw->batch.needs_sol_reset = true;
-
/* We're about to lose the information needed to compute the number of
* vertices written during the last Begin/EndTransformFeedback section,
* so we can't delay it any further.
/* Store the starting value of the SO_NUM_PRIMS_WRITTEN counters. */
brw_save_primitives_written_counters(brw, brw_obj);
+ /* Reset the SO buffer offsets to 0. */
+ if (!can_do_pipelined_register_writes(brw->screen)) {
+ intel_batchbuffer_flush(brw);
+ brw->batch.needs_sol_reset = true;
+ } else {
+ for (int i = 0; i < 4; i++) {
+ BEGIN_BATCH(3);
+ OUT_BATCH(MI_LOAD_REGISTER_IMM | (3 - 2));
+ OUT_BATCH(GEN7_SO_WRITE_OFFSET(i));
+ OUT_BATCH(0);
+ ADVANCE_BATCH();
+ }
+ }
+
brw_obj->primitive_mode = mode;
}