[SharpDX] DXGI Adapter Video Memory problem

Started by
1 comment, last by karnaltaB 7 years, 10 months ago

Hi,

My video card has 4gb of dedicated memory but when I query the DXGI adapter description for DedicatedVideoMemory property, it return me a negative value of -1073741824.

How can I get my real video memory ? Look like it's bugging with large memory video card.

Thank for your help.

Advertisement

Looking at the documentation https://msdn.microsoft.com/en-us/library/windows/desktop/bb173058%28v=vs.85%29.aspx you can see the size is stored in a SIZE_T type, which on a 32-bit PC will be an unsigned 32-bit integer.

If you treat -1073741824 as an unsigned value, it's actually 3GB.

It's possible you will get a different result if you compile your program as 64-bit.

Yes you are right, if I compil my application with a 64 bit target, I got the correct 4Gb value from the DXGI Adapter Description.

That throw me another problem... I need to store that value into a Int64, cause the Int32 throw me an overflow exception.. Now I need to think how to manage 32 bit system correctly, because compiling my application on 64 bits target will not allow a 32 bit system to run it..

I am a "traditionnal" application developper, I am doing SharpDX engine just for fun so that kind of 32/64 bit problems are new to me ;)

This topic is closed to new replies.

Advertisement