Skip to content

gallium/tc: Optimize buffer uploads which replace the entire valid range

Rob Clark requested to merge robclark/mesa:tc/opt-subdata-overwrite into main

This, at least for tilers which cannot safely use the CP to push updates to a buffer (ie. because we need the old value for earlier draws in the next tile/bin), significantly improves this benchmark. That particular benchmark was inspired by a performance issue in virgl fixed in !838 (merged).

Unfortunately that benchmark triggers runaway memory usage (allocating a new 1MB buffer every draw), so I also added a way to put an upper limit on buffer replacement.

The limits I landed on for freedreno work well for that particular benchmark.. unfortunately I can't find a trace of the game mentioned in !838 (merged), and the glmark2 tests which were mentioned don't seem to trigger the problem that this optimization fixes (either something that has been fixed in glmark2 since !838 (merged) or maybe TC was already handling that case). I guess we can see if there are any changes in the perf traces.

Also, idk if this should be an opt-in optimization. Maybe status-quo is better for IMRs?

Merge request reports