Aww, lambda expressions unavailable in Metal. @warrenm is there a good way to switch between functions from within a fragment shader?
@BitShapeSoft Not sure I understand the question. Switching based on what criteria? Compile-time or run-time?
-
-
@warrenm run-time. I was trying to call functions based on in-app changes, so a shader could run fooA(), fooB(), then later fooZ(), fooA() -
@warrenm function pointers (and thereby arrays of functions) aren't supported, so I guess I'm stuck with looping over a switch()? -
@BitShapeSoft Sure, but shader compilers tend to flatten (inline) everything, so this may lead to exponential code growth, depending. -
@warrenm good to know, thanks!
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.