Everything is inlined, right?

Hi,

I just wanted confirmation that everything (at least as far as branching is not concerned) is inlined in a shader ?

Meaning that if I want to clear up my code with someting like :

vec3	tangent = gl_MultiTexCoord1.xyz;
vec3	binormal = gl_MultiTexCoord2.xyz;
vec3	normal = gl_MultiTexCoord3.xyz;

or using several functions per shader, I shouldn’t worry about preformance drop.

Thanks in advance,
wizzo

It depends on the driver. I am sure that compilers of both Nvidia and ATI will optimize this situation, but this is not enforced by the specification. In respect to you questions shaders are like usual programs. In your case, consider using generic attributes for tangent etc. instead the texture coordinates.

Okay, thank you very much for your answer Zengar.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.