Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / D3D Device Flags

Author
Message
jezza
16
Years of Service
User Offline
Joined: 8th Mar 2008
Location: Bham, UK
Posted: 28th Jul 2008 12:31
I have a problem whereby my calculations are not precise enough, because when a D3D device is created, by default DirectX limits the CPU's calculations to float values, but this is ot good enough for me. You can stop this by using a CreateFlags.FpuPreserve option when creating the device, but of course this cannot be done when using GDK. Or can it? I need it.
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 28th Jul 2008 20:18
So, if I call an outside function that uses doubles from a DarkGDK app, will they be used as floats?

Windows Vista Home Premium Intel Pentium Dual-Core 1.6 Ghz 1GB DDR2 RAM GeForce 8600GT Twin Turbo
jezza
16
Years of Service
User Offline
Joined: 8th Mar 2008
Location: Bham, UK
Posted: 28th Jul 2008 21:02
I think so yeah. in calculations
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 28th Jul 2008 21:15


v.v

Windows Vista Home Premium Intel Pentium Dual-Core 1.6 Ghz 1GB DDR2 RAM GeForce 8600GT Twin Turbo
pirogoth
16
Years of Service
User Offline
Joined: 6th Apr 2008
Location: Good Old California
Posted: 29th Jul 2008 02:30 Edited at: 29th Jul 2008 02:35
That isn't quite correct. DirectX does not limit your CPU calculations to floats or doubles or anything else. You will however notice that all DirectX functions/methods use floats however. The reason for this being the GPU (Video Card) is highly optimized for floating point calculations. Naturally DirectX will internally do everything with floating point values and offload anything it can onto the GPU. This simply makes sense.

However this does not limit you on the CPU in the slightest. Also as a quick note, the issue of changing the runtime to default to floating point over double precision only affects users of Managed DirectX (.NET/CLR). So as a user of the DarkGDK or DarkGDK.NET, this should not affect you. Source: http://msdn.microsoft.com/en-us/library/bb322733(VS.85).aspx

-Piro

One last Edit: While I'm seeing references to this affecting standard DirectX as well, I can't actually find anything on it on the MSDN, or any code samples that are not in .NET languages (C# specifically). So it's possible it does affect you, but I find it unlikely.
jezza
16
Years of Service
User Offline
Joined: 8th Mar 2008
Location: Bham, UK
Posted: 29th Jul 2008 11:07
well, I ran this:

in a GDK program and i get:


exactly the same thing in a normal command line app:


the difference seen in the GDK one really does make a difference to me when using radians on a large scale.
Morcilla
21
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 30th Jul 2008 12:44 Edited at: 30th Jul 2008 12:45
Quote: "when a D3D device is created, by default DirectX limits the CPU's calculations to float values"


Uh, I never heard of this. Perhaps you could post the whole code so we can run it ourselves in different machines.
jezza
16
Years of Service
User Offline
Joined: 8th Mar 2008
Location: Bham, UK
Posted: 30th Jul 2008 18:22
Ummm, no because the thing I really need it for uses physX so that would be pointless, unless you have the physX SDK installed
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 30th Jul 2008 18:46
I am curious about this issue, though.

Windows Vista Home Premium Intel Pentium Dual-Core 1.6 Ghz 1GB DDR2 RAM GeForce 8600GT Twin Turbo

Login to post a reply

Server time is: 2024-09-30 03:23:15
Your offset time is: 2024-09-30 03:23:15