-
float vs. double forms of OpenGL functions
Is there any speed hit associated with using the double version of the OpenGL functions, as compared to the float version? i.e. is glVertex3f better/faster to use than glVertex3d?
-
Senior Member
OpenGL Guru
Re: float vs. double forms of OpenGL functions
Well, double consumes twice the memory bandwidth and can't be used with SIMD extensions like 3dnow or sse since they only operate on singleprecision data.
Double also take longer time to do calculations with, especially divisions and squareroots.
-
Member
Regular Contributor
Re: float vs. double forms of OpenGL functions
i have made some tests on G200 and TNT, and i found that the float versions are faster.
on the NV10 i don't know.
Dolo/\/\ightY
-
Re: float vs. double forms of OpenGL functions
I have recently changed the way I used my compiled vertex arrays (i.e. changed from double to float) on my ELSA Erazor X2 (GeForce DDR).
So the answer is : yes, it's much faster !
Eric
-
Junior Member
Regular Contributor
Re: float vs. double forms of OpenGL functions
Hi there!
I'm back again 
You should use floats there are ton's faster.
Here are the reason:
1. With floats the cpu can cache twice the amount of data in the 1st and 2sec level cache.
2. the cpu only has to transmit only halfe of the data via the PCI/AGP port to the gfx card
3. there is a MAJOR BUG in Win95/98 (at least I call it a BUG)! Win95/98 allocates memory only 4 byte aligned witch gives you a 3 clock penalty for each access (on intel machines, 1 clock on AMD) Check it out!!!
By the way. Internally the Cpu works with double values by default. that means it internaly converts a float into a double, performs the operation and stores the result
as a float (this behaviour can be changed via some cpu intructions, like DirectX does it to gain some extra speed).
Oh, while we are at it (this is off topic I know) Intel cpu's are using the floatingpoint pipeline to perform INTEGER multiplications and divisions (AMD does not)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules