FP24 vs FP32 pixel shader precision

Tensor

Newcomer
Are there any examples of discernable image quality difference between these two precisions as of now? If not, in what instances are there expected to be noticable differences in quality?
 
I've been wondering about that aswell. Haven't seen any pictures showing any differences yet though. Maybe because there isn't any?
 
If you want an artificial example you can download the mandlebrot set viewer from humuss' site. It will show precision differences to infinity.
In practical terms as I understand it, if you use your pixel shader to generate texture co-ordinates, 24bit limits you to 2048x2048 textures with sub-pixel preciison. I believe Nvidia supports 4096x4096 textures as they have 32bit addressing. I believe there was a console emulator that displayed some differences between the two. It was discussed a while ago.
 
Tensor said:
Are there any examples of discernable image quality difference between these two precisions as of now? If not, in what instances are there expected to be noticable differences in quality?
It depends on what the shader is doing. For basic Phong lighting with specular, you won't see any difference at all. For procedural textures, FP32 can achieve a much higher level of detail -- though you might have to zoom in quite a bit to notice. FP24 might also result in artifacts in especially long shaders (in the same way the FP16 can) as precision errors accumulate. How long a shader? No idea. :)
 
Reverend said:
There are a bunch of threads that have been discussing about this topic. You can try our search function. The following are threads I participated in (that are kept in my "Favourites").

http://www.beyond3d.com/forum/viewtopic.php?t=6223&highlight=dx9+vs+ieee32

http://www.beyond3d.com/forum/viewtopic.php?p=130096#130096

http://www.beyond3d.com/forum/viewtopic.php?p=91712#91712

Thanks Reverend. I've probably read through a few of those threads partially, as I've been lurking here forever. After finals are over, and I'm officially a chemist, I'll read through them.
 
Precision: mantissa

By the way, I'm looking for the precision of the operations on the 24-bits shaders, and by that I mean the number of precise bits in the mantissa after an operation (arithmetic, but also trig, exp.,...).

Couldn't find it anywhere. :?

Before I start to try to download all of ATI's site...

...does someone knows where I could find it ?

Thanks for any (relevant) answer!
 
Me said:
I think its 16b
15 mantissa,1sign, 8exp
with the implied bit gives you 16 bits mantissa.

http://www.beyond3d.com/forum/viewtopic.php?t=7826&view=next
Thanks for the link, it's a good reading! :D

What they did get there is the length of the mantissa, however it isn't the number of precise bits in it after a math operation (what I'm looking after). They should be close, but I don't think they are equal in a pixel shader...

Again, if someone have a clue where I can find the info... Don't be shy, thanks in advance! ;)
 
That depends on the operation, and on the specific hardware implementation.

The DX9 spec defines some minimum requirements, e.g.
sincos - "The maximum absolute error is 0.002."
rcp - "Precision should be at least 1.0/(222) absolute error over the range (1.0, 2.0) because common implementations will separate mantissa and exponent. "
rsq - "Precision should be at least 1.0/(222) absolute error over the range (1.0, 4.0) because common implementations will separate mantissa and exponent."

Basic operations like ADD and MUL should have the last bit rounded, but there are different rounding modes.
 
Re: Precision: mantissa

Remi said:
By the way, I'm looking for the precision of the operations on the 24-bits shaders, and by that I mean the number of precise bits in the mantissa after an operation (arithmetic, but also trig, exp.,...).

Couldn't find it anywhere. :?

Before I start to try to download all of ATI's site...

...does someone knows where I could find it ?

Thanks for any (relevant) answer!
ATI's FP24 format is 's16e7' (16 bit + 1 implied bit in the mantissa, 7-bit exponent):
http://www.beyond3d.com/forum/viewtopic.php?t=4791&postdays=0&postorder=asc&start=80,
look for posts by sireric.

As for actual precision, I would expect IEEE754-like 'nearest' rounding on ADD and MUL. Composite operations like MAD, DP3, DP4 will most likely exhibit precision errors corresponding to the worst case errors you can achieve of decomposing them into properly rounded ADD/MUL operations. Note sure about RCP/RSQ, but would guess at errors being no more than +/-1 unit of the lowest bit. SINCOS is specified to have a worst-case error of +/- 0.002, indicating only 9 bits of precision.
 
Reverend provided a real world example here
Reverend said:
nelg said:
With respect to the shaders that you are writting do you think that, perhaps, they could be re-written in order to produce the same results using FP24.
Yes, but only for specific cases. For the cases I mentioned in those threads, artifacts and errors will be seen on anything less than FP32. For sure, I can avoid noticeable precision loss if I wanted to (like not using pixel shaders for positional computations) -- it depends on what you're trying to achieve and how annoyed one can get when he notices the artifacts... and these artifacts can be easily overlooked by those who do not regard as important what I perceive as crucial within the scheme of my research. I suppose it's a matter of perception. For example, how annoyed will one be when they see the R300's internal FP24 pixel pipeline limitation when it comes to float textures (example, see the shadow floats part)? I can overlook this floating-point-related limitation, for example. For others, it's a bit difficult.
 
I doubt we will ever see much difference between FP24 and FP32 in games targeted for PS2. Why would any competent developer write code that shows major precision errors with FP24 (but not FP32) in such a game?
 
Reverend said:
There are a bunch of threads that have been discussing about this topic. You can try our search function. The following are threads I participated in (that are kept in my "Favourites").

http://www.beyond3d.com/forum/viewtopic.php?t=6223&highlight=dx9+vs+ieee32 ...
That is, IMHO, the best thread ever. After re-reading it two things stand out for me. The limits of FP24 have not been breached and Dave is clairvoient. ;)
Dave Baumann said:
Rev, where is the suggestion that this will or won't be replaced? We're only on the second iteration of shader architectures and we've jumped from 8-12 bit integer to fast 24bit FP - this is quite a leap. More than likely the precision will increase on a general level but this is unlikely to happen until newer silicon process (90nm) allow the footprint needed for it to occur at higher performance levels and we see newer API's.
And thats probably a reasonable statement most of the time for the types and sizes of shaders available in DX9. I'd guess that by the time DX10 gets here FP32 may well be the baseline, but thats also probably a resonable time scale for the FP24 baseline to have been around and the shader specifications available in DX10 will also probably make it more worthwhile more of the time.
Yes, and he seems to be talking in relation to DX9, not any future revisions, since his NDA prevents him talking about things that may occur in the future. "R400" (or whatever is next) is likely still to be a DX9 part so that will probably stay FP24 as well, I would expect DX10 parts to have different base precisions.
 
Thanks for the info, Xmas, arjan de lumens & nelg!

So, what we've got so far is...
  • Sireric's comment saying in a discussion that "for each operation, assuming ½ lsb of error is correct" (in this post)
  • The DX9 specification from the Driver Development Kit
The DX9 specs doesn't say much. Sincos precise to +/- 0.002? Ok, but it's a bit surprizing to me. Isn't the hardware at least a bit more precise?

Sireric's comment, on the opposite, is indicating more precision than I expect. Was he thinking in this instance of a generic rule or was he talking of the Rxxx hardware? If yes, does that include all the operations or was he thinking of the basic arithmetic ones? I mean, I would be surprized to learn it's that precise on all operations, particularily after having read in this forum that (from memory) a fp24 multiplier unit with 0.8 lsb of maximum error instead of 0.5 would save about 25% of the transistors required for the unit. If that's correct... ...I know what I would do if I had to design a card positioned for gaming as much as the Radeons!

It looks like I might have to adapt and run a numerical precision test suite... :|

Lezmaka said:
I doubt we will ever see much difference between FP24 and FP32 in games targeted for PS2. Why would any competent developer write code that shows major precision errors with FP24 (but not FP32) in such a game?
Well, it all depends which games you're playing at. There's a perfect exemple on B3D's homepage today (thread here)... ;)
 
Back
Top