MalcolmB
03-21-2006, 01:40 PM
Lets say I have a simple vertex shader like this
vec3 deform(vec3 input)
{
vec3 result;
// Deform stuff here
return result;
}
vec4 deform(vec4 input)
{
vec4 result;
// Deform stuff here
return result;
}
varying vec3 vNormal;
void main()
{
gl_Position = deform(gl_Position);
vNormal = deform(gl_Normal);
}
Now, here's the question, say I input another vector attribute, e.g a Tangent, and I deform that the same way as the normal. Should the instruction count of my program increase significantly? I'm seeing that it inlines every function call to the point where I go above the instruction count limit of the vertex shader.
With dynamic branching is this expected? Is dynamic branching only used for avoiding code but not to reuse it?
This is on a Quadrio 4500 (7800 equivalent if you dont know)
Thanks
vec3 deform(vec3 input)
{
vec3 result;
// Deform stuff here
return result;
}
vec4 deform(vec4 input)
{
vec4 result;
// Deform stuff here
return result;
}
varying vec3 vNormal;
void main()
{
gl_Position = deform(gl_Position);
vNormal = deform(gl_Normal);
}
Now, here's the question, say I input another vector attribute, e.g a Tangent, and I deform that the same way as the normal. Should the instruction count of my program increase significantly? I'm seeing that it inlines every function call to the point where I go above the instruction count limit of the vertex shader.
With dynamic branching is this expected? Is dynamic branching only used for avoiding code but not to reuse it?
This is on a Quadrio 4500 (7800 equivalent if you dont know)
Thanks