View Full Version : 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?
03-25-2000, 12:51 AM
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.
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.
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 !
03-29-2000, 11:55 AM
I'm back again http://www.opengl.org/discussion_boards/ubb/smile.gif
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)
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.