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)
The “expected” cost of a function call is unknown.
In general, many functions can and will be inlined by the linker (on good compilers), so there is no actual cost except in the number of instructions. On hardware that actually supports branches, some functions may be actual function calls.
Ok, so the branching hardware can infact branch function calls? Would it correct to say if a compile inlines functions to the point where it goes above the instrucion limit (instead of doing a branch), its a compiler bug?
Ok, so the branching hardware can infact branch function calls? Would it correct to say if a compile inlines functions to the point where it goes above the instrucion limit (instead of doing a branch), its a compiler bug?
Maybe.
I would point out, however, that instruction counts for branching hardware are well beyond the means of most graphical needs. So if it does exceed the instruction counts, you probably have bigger things to worry about.