Are parameters to functions in Metal “inout” (GLSL) by default?
If not, how can I achieve “inout” in Metal?
L. Spiro
The equivalent of inout in Metal shading language is using non-const references (or pointers), just like C++. However, you need to put the appropriate address space, and it depends on what you pass as argument (see section 4.2 of Metal shading language reference). If you are passing local variables, then the address space should be thread.
--
Francois