Skip to content

agx: Add helper for calculating occupancy

Alyssa Rosenzweig requested to merge alyssa/mesa:agx/occupancy into main

Add information about the relationship between program register usage and program occupancy (the maximum number of threads that may execute concurrently on a single shader core). This table is derived from studying the maxTotalThreadsPerThreadgroup property in Metal while varying the register usage, something I blogged about a few years back. It's probably not 100% accurate and it hasn't been tested against hardware, but it matters "only" for performance (not correctness) so I'm not super stressed about the details.

In the (near) future, RA will be able to make use of this information to know exactly when it can use more registers without hurting performance. In the present, it's just used for better shader-db statistics.

Signed-off-by: Alyssa Rosenzweig alyssa@rosenzweig.io

Merge request reports