I'm a bit confused on the circumstances in which a constant Attribute should be used. Presumably changing a uniform may end up with the shader being recompiled, whereas attributes will not attempt optimisation.Â
Using PVR OGLES2.0 emulation i found that passing regularly changing values as constant attributes gave a significant performance advantage. Is this true on actual devices? Or is it entirely driver dependant?
I'm a bit confused on the circumstances in which a constant Attribute should be used. Presumably changing a uniform may end up with the shader being recompiled, whereas attributes will not attempt optimisation.
Constant attributes are merely a convenience feature so you don't have to modify a shader for just a few meshes which happen to have a constant value for an attribute. Plus you can fit a few more constants if you run out of uniform space.
Apart from that, you should use them for what they were intended: attributes for values that may change per vertex, uniforms for values that may change per draw call.
Quote:
Using PVR OGLES2.0 emulation i found that passing regularly changing values as constant attributes gave a significant performance advantage. Is this true on actual devices? Or is it entirely driver dependant?
PC Emulation performance is very much dependent on the underlying desktop OpenGL driver.