Skip to content

turnip: Skip load/stores for tiles with no geometry

When HW binning is used tile loads/stores could be skipped if there is no geometry in the tile.

Loads could be skipped when:

  • The attachment won't be resolved, otherwise if load is skipped there would be holes in the resolved attachment;
  • There is no vkCmdClearAttachments afterwards since it is likely a partial clear done via 2d blit (2d blit doesn't produce geometry).

Stores could be skipped when:

  • The attachment was not cleared, which may happen by load_op or vkCmdClearAttachments;
  • When store is not a resolve.

I chose to predicate each load/store separately to allow them to be skipped when only some attachments are cleared or resolved.

GMEM loads are moved into separate cs because whether to emit CP_COND_REG_EXEC depends on HW binning being enabled and usage of vkCmdClearAttachments.

CP_COND_REG_EXEC predicate could be changed during draw_cs only by perf query, in such case the predicate should be re-emitted. (At the moment it is always re-emitted before stores)


Stats of how many load/stores are skipped per second could be obtained with TU_DEBUG=log_skip_gmem_ops

Not sure if this debug option should be merged.


Perf stats

No stats for now, I'm expecting stats from AetherSX2 (ps2 emulator) in nearby future.

Games already optimized for tilers are not expected to gain anything, however it's emulators and translation layers who should benefit the most.

Merge request reports