View Full Version : Number of varying variables on NVidia?
11-08-2005, 12:26 AM
I am wondering why I can only use 8 vec4 varying Variables on my NV4x Cards with GLSL. The cards support up to 10 float4 on Cg but GLSL doesn´t recognize these.
Is there any way around this limitation?
11-08-2005, 03:13 AM
I have the same problem with my gf6800, when querying GL_MAX_VARYING_FLOATS value, it returns 32 when it should be 40. I didn't find any details on this, so I just limit my varying to 32 floats.
I have a similar issue with GL_MAX_VERTEX_UNIFORM_COMPONENTS which should be at least 512 (according to GLSL spec, orange book page 109) but when queried, it returns only 256 (driver version 81.85).
About uniforms, I've made a post where someone (I guess he's Overmind) said that how much useable uniforms slots could depend on how you use the fixed pipeline. Ie, if you use all lights and all textures from the fixed pipeline, you'll have less useable uniforms.
Since recent cards emulate the fixed pipeline, this seems true.
Also, trust what you cary says instead of what the graphic card specs says: I'm not sure if it's fully related but everyone knows that not all geforce 6 (for example) have the same amount of programmable pipelines. This might be why.
Hope that's not completly wrong :)
11-08-2005, 10:05 PM
As far as i know, all the cards (even modern ones) support 8 interpolators i.e. 8 vec4 varyings. I didn't read anywhere about GF6800 supporting 10 interpolators (or is it part of being SM3.0 compliant?). If there is any information online then please enlighten me.
11-09-2005, 06:41 AM
I think the 10 useable interpolators include the color and secondary color. So use them. It's very well know, I think, that color and secondary color are interpolated on float basis instead on fixed point basis as on GF FX.
Hopefully I am not wrong.
11-09-2005, 09:45 AM
Shouldn't the compiler use the color interpolators for us automatically if it's unused and the precision is the same?
At least that's what a high-level language is for, I don't want to know these details ;)
EDIT: Just looked at the spec. gl_Position is the only exception, everything else counts against the GL_MAX_VARYING_FLOATS limit. So GL_MAX_VARYING_FLOATS should include the color interpolators...
Of course that doesn't mean that's what really is implemented ;)
11-09-2005, 10:22 AM
Shouldn't the compiler use the color interpolators for us automatically if it's unused and the precision is the same?Do recall that compilers aren't exactly the easiest thing to write. Consider that, before getting involved in such optimizations that the IHVs should first fix their compiler bugs.
Just looked at the spec. gl_Position is the only exception, everything else counts against the GL_MAX_VARYING_FLOATS limit. So GL_MAX_VARYING_FLOATS should include the color interpolators...Yes, but nobody actually follows this part of the spec (except perhaps 3DLabs).
11-10-2005, 06:43 AM
Originally posted by Korval:
Do recall that compilers aren't exactly the easiest thing to write. Consider that, before getting involved in such optimizations that the IHVs should first fix their compiler bugs.I know, but I wouldn't really call that an optimization from the compiler builders point of view. The color interpolator need not be a special case to begin with, the only difference is that doesn't need to be declared explicitly.
Of course that's assuming it uses the same hardware, and I know that's not true for old hardware (at least GFFX). For these it's perfectly all right to not use it automatically, since it would also affect the result because of less precision.
Is it really true that the color interpolators have full float precision on NV4x? If not there's no way for the compiler to automatically use them.
Yes, but nobody actually follows this part of the spec (except perhaps 3DLabs).I didn't mean to say that's a spec violation. They should count against the limit, but it's not strictly required.
If you can use up to 32 custom varying floats plus the two color interpolators that would be no violation to the spec. The spec states that above the limit it "may work" if the compiler is able to optimize (in this case, special case the color interpolators with different hardware reserved for them, perhaps with lower precision).
Still it would be nice if the limit included the color interpolators because I can not rely on them not counting against the limit.
11-11-2005, 08:31 AM
I suggest you to find a pdf file named "NVIDIA OPENGL 2.0 Supports"(maybe~~)
They are improving their hardware design now...
Powered by vBulletin® Version 4.2.3 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.