Closed psilord closed 6 years ago
Ah ok, so the error message is a bit bad here. The problem is that varjo needs to be able to resolve function calls statically and there is no way to know the value of easing-func
until runtime. Of course if we had constant propagation there would be resolvable in more cases, however this would still apply sometimes.
I'll close this once I've made a better error for this case
What I really need, though is the ability to have an array of higher order functions and then index it in the shader. Is this concept possible in Varjo? Thank you!
Nope, the only way would involve passing around an identifier (e.g. an int) and having a switch at every call site. This would work but would have non-obvious implications on performance (think divergence) which would require folks to always debug against the glsl (as it would be too hard to predict the resulting code)
It's a bummer though as otherwise it would be a dope feature :D
Pushed a better error message for the cases when the all the branches of the or
type are functions
Hello,
The intention of this code is to select a function and bind it to a symbol.
The shader code:
Thank you!