PDA

View Full Version : everything is inlined, right ?



wizzo
03-07-2007, 05:16 AM
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

Zengar
03-07-2007, 07: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.

wizzo
03-08-2007, 12:14 AM
Okay, thank you very much for your answer Zengar.