Skip to content

turnip: Implement "bin merging" FDM optimization

Connor Abbott requested to merge cwabbott0/mesa:review/tu-fdm-bin-merging into main

Fragment density map scales down the tiles in GMEM and scales them up when resolving without changing the bin size, which means that only a fraction of GMEM may be used at once, wasting GMEM and causing overhead from bin load/store that could be avoided. a7xx improves this situation by introducing "bin merging", where neighboring bins with the same scaling can be combined into one larger bin. The tricky part about this is that we also have to merge their visibility information, which is accomplished via a mask of bins that can be passed to CP_SET_BIN_DATA5 and friends (and this is actually what is new HW-wise on a7xx). Note, this means that only bins that are part of the same visibility stream/VSC pipe can be merged. There was only room for a 16-bit mask but there can be up to 32 bins, so prior to a750 this means that in some cases we can't merge two bins even if they are in the same VSC pipe. On a750 this is fixed via a new "absolute" mask that modifies CP_SET_BIN_DATA5 to add an extra 32-bit mask.

This MR implements bin merging in turnip. It's only been lightly tested, due to the current lack of users, but least pixelated supertuxkart is working on a750 both with and without absolute bin masks:

Screenshot_from_2025-01-26_17-51-46

Merge request reports

Loading