[Mesa-dev] [PATCH v2 11/15] i965: Grow the batch/state buffers if we need space and can't flush.

Chris Wilson chris at chris-wilson.co.uk
Thu Sep 14 10:21:09 UTC 2017


Quoting Kenneth Graunke (2017-09-13 21:54:13)
> +/**
> + * Target sizes of the batch and state buffers.  We create the initial
> + * buffers at these sizes, and flush when they're nearly full.  If we
> + * underestimate how close we are to the end, and suddenly need more space
> + * in the middle of a draw, we can grow the buffers, and finish the draw.
> + * At that point, we'll be over our target size, so the next operation
> + * should flush.  Each time we flush the batch, we recreate both buffers
> + * at the original target size, so it doesn't grow without bound.

Time for heuristics and testing! :) How about (last_size + base_size) / 2?

You could lose days trying to polish the corner case ;) If it weren't
for cmdparser you would just do batch chaining - worth it for !gen7?
-Chris


More information about the mesa-dev mailing list