What is the purpose of threadgroup memory in Metal?

I have started to work with the Metal API and have encountered the threadgroup address space in Metal Shading Language (MSL). Reading some of the MSL specification provided by Apple has given me some clue as to how threadgroups are formed and can be further partitioned into SIMD groups; however, I haven't yet come across an example where I have seen threadgroup memory in action. Can you give some examples of when it is used for both compute kernels and fragment shaders?

Further, specifically regarding the latter of the two shaders as threadgroup may only occur with a parameter in a fragment shader, how is the [[threadgroup(n)]] attribute properly used? Any references to WWDC videos, articles, and/or other sources would be much appreciated.



from Recent Questions - Stack Overflow https://ift.tt/3mYJfF2
https://ift.tt/eA8V8J

Comments

Popular posts from this blog

Today Walkin 14th-Sept

Spring Elasticsearch Operations

Hibernate Search - Elasticsearch with JSON manipulation