linux icon indicating copy to clipboard operation
linux copied to clipboard

vc4: Do a hilbert walk on the tiles.

Open anholt opened this issue 9 years ago • 3 comments

Currently we call our tiles in raster order. If you do a hilbert fractal-like walk instead it can slightly increase cache locality for the texture sampler.

anholt avatar Feb 15 '16 21:02 anholt

i.e. should vc4_create_rcl_bo differentiate between T and LT-formats when writing tiles into the list?

varadgautam avatar Feb 22 '16 17:02 varadgautam

Nope, you still need to write out your surface the same. Imagine going from one tile to its neighbor -- you're probably mostly reloading your texture cache because there's different content being sampled in the new tile, except that a few of the pixels near the shared edge might be able to share samples loaded from filtering from the other side of the edge. Right now we move to the neighbor tile to the right every time, then start at a new scanline of tiles once we reach the end (which probably doesn't share any samples). If we instead do a hilbert walk (or potentially just swap between left-to-right and right-to-left), we might get that small benefit of cache locality from your neighbor tile a few more times.

anholt avatar Feb 22 '16 17:02 anholt

I'm sure I'm missing something - the manual mentions that "In tile rendering mode, the change from one tile to the next is handled in a pipelined fashion in the hardware". Is the order of processing tiles the same as the order we place them in the rcl for that frame (= order of calling emit_tile(x,y) for a job)?

If not, what determines the order?

varadgautam avatar Feb 23 '16 17:02 varadgautam