Do functions have a performance penalty in GLSL (especially on iOS and Android implementations)?
Under performance penalty I imply additional time necessary for function invocation.
This depends on how the function is used. If it's written in a way that it can be inlined by the compiler, then there's no penality. If however the function can not be inlined, then of course there's a bit of overhead. However a simple texture access is already more expensive than a function call, so I wouldn't bother about it. GLSL compilers, fortunately, have become quite capable.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With