shader-slang / slang

Making it easier to work with shaders
MIT License
1.81k stars 161 forks source link

Metal: Kernel function input argument types #4288

Closed skallweitNV closed 1 month ago

skallweitNV commented 1 month ago

Most metal kernel function input arguments need to have uint or ushort types, but slang currently doesn't transform signed to unsigned types. For example int3 tid: SV_DispatchThreadID is emitted as int3 tid_0 [[thread_position_in_grid]] which leads to a error in the metal compiler.

The supported types are documented in table 5.8 in https://developer.apple.com/metal/Metal-Shading-Language-Specification.pdf