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.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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.