Sebastian Aaltonen

Sebastian Aaltonen

@sebaaltonen · Twitter ·

Slang doesn't yet support descriptor heaps for Metal. We need official support for Metal 4 TextureViewPool indexing in MSL first:

Sebastian Aaltonen

Sebastian Aaltonen

Wrote a minimal test showing Metal 4 TextureViewPool indexing in shader. Metal 4 guarantees that view pools provide contiguous descriptor ranges. It returns the base descriptor and you can add an integer to index. However on MSL (GPU), there's no way to directly add an integer on top of a texture2d<float> handle. Metal guarantees that texture handle is a 64-bit integer, so I reinterpret cast it back to 64-bit integer, add the heap index and cast back. This works on all Metal 4 devices and works in GPU debugger too. Source code here: https://github.com/sebbbi/msl_heap Apple, I need official support! This is blocking perf optimal Slang SM6.6-style texture heap support for Metal (otherwise needs an extra indirection). I can't add Metal 4 support for my new NoGraphicsAPI without Slang MSL target supporting global texture heaps.

Quoted post media