[Mesa-dev] [PATCH 17/17] i965: Disentangle batch and state buffer flushing.

Chris Wilson chris at chris-wilson.co.uk
Wed Sep 6 12:26:10 UTC 2017


Quoting Kenneth Graunke (2017-09-06 01:09:50)
> We now flush the batch when either the batchbuffer or statebuffer
> reaches the original intended batch size, instead of when the sum of
> the two reaches a certain size (which makes no sense now that they're
> separate buffers).
> 
> With this change, we also need to update our "are we near the end?"
> estimate to require separate batch and state buffer space.  I obtained
> these estimates by looking at the size of draw calls in the Unreal 4
> Elemental Demo (using INTEL_DEBUG=flush and always_flush_batch=true).
> 
> This will increase the batch size by perhaps 2-4x, which will almost
> certainly have a performance impact, and may impact overall system
> responsiveness.

You also need to update DEBUG_FLUSH:

@@ -823,8 +826,8 @@ _intel_batchbuffer_flush_fence(struct brw_context *brw,
       int bytes_for_state = brw->batch.state_used;
       fprintf(stderr, "%s:%d: Batchbuffer flush with %4db (%0.1f%%) (pkt) + "
               "%4db (%0.1f%%) (state)\n", file, line,
-              bytes_for_commands, 100.0f * bytes_for_commands / BATCH_SZ,
-              bytes_for_state, 100.0f * bytes_for_state / STATE_SZ);
+              bytes_for_commands, 100.0f * bytes_for_commands / brw->batch.bo->size,
+              bytes_for_state, 100.0f * bytes_for_state / brw->batch.state_bo->size);
    }


More information about the mesa-dev mailing list