I have been working with Metal for a little while now and I have encountered the
threadgroup address space. After reading a little about it in Apple’s MSL reference, I am aware of how thread groups are formed and how they can be split into SIMD groups; however, I have not yet seen
threadgroup memory in action. Can someone give me some examples of when/how
threadgroup memory is used?
Specifically, how is the
[[threadgroup(n)]] attribute used in both kernel and fragment shaders? References to WWDC videos, articles, and/or other resources would be appreciated.