ARB_fragment_program: Float precision

Hi,

My ARB2 path (ARB_vp & ARB_fp) is half as fast as my NV20 path (NV_vp & reg.combs.) in many cases, despite ARB2 is one pass and NV20 is 2 passes.

So I thought it might be because of s23e8 precision (I send most data as texcoords).

Then I read Kilgards post: http://www.opengl.org/discussion_boards/ubb/Forum3/HTML/010154.html

Then I looked in the ARP_fp spec, and found a comment about “ARB_precision_hint_fastest”.
But that doesn’t exist, at least I can’t find it.

Is there any good docs about precision per instruction and precision per vertex-channel anywhere?

ARB_fp is can use only a single precision globally. You cannot set the precision on a per-instruction basis.

Originally posted by esc:
Then I looked in the ARP_fp spec, and found a comment about “ARB_precision_hint_fastest”.
But that doesn’t exist, at least I can’t find it.

What do you mean with “doesn’t exist” / “can’t find it”?

Add this on top of your shader, and it should do the trick:

OPTION ARB_precision_hint_fastest;

Originally posted by Humus:
Add this on top of your shader, and it should do the trick:
OPTION ARB_precision_hint_fastest;

Of course, stupid me, thanks!

However, I’m still confused about Kilgards post (link above) about Geforce FX’s varying precision:

Originally posted by Mark Kilgard:

The per-fragment fragment program operations (ARB_fragment_program) are performed with s23e8, s10e5, or s1.10 numerics depending on the instruction & register formats.

Is there anyway of finding nVidias specs for this? Or does it change per driver or hardware chip?

I just thought that knowing this more closely would help optimizing, or should we (app. programmers) leave it all to the drivers people?

/Chris

You don’t get access to these different precision modes with ARB_fp. Unfortunately, the precision hint doesn’t seem to make much difference either. The only way to exploit the multiple precisions fully is to use NV_fp.

– Tom

Currently, precision hint is not used (as Tom said). Expect future drivers to use precision hint more, though it is still a hint and subject to interpretation between drivers/chips/vendors etc.

Eric