View Full Version : everything is inlined, right ?

03-07-2007, 04:16 AM

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,

03-07-2007, 06:23 AM
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.

03-07-2007, 11:14 PM
Okay, thank you very much for your answer Zengar.