TotalVidMem() & AvailVidMem()

Blitz3D Forums/Blitz3D Programming/TotalVidMem() & AvailVidMem()

_PJ_(Posted 2013) [#1]
WHilst these fuinctions work fine and return useful values when I run on Windows XP, under Windows 8 they give different results that cause failure in calculations.

Does anybody know or is it even possible to identify whether this is specific to the DirectX version (Which I suspect to be the issue, and should well be possible to workaround)or something else related to Windows 8?


Rroff(Posted 2013) [#2]


Needs something like that IIRC but it only "fixes" it upto 4GB of VRAM if the system has larger VRAM allocations than that - i.e. some will have 6GB of virtualised memory available to the GPU then it breaks again with no way to reliably handle the roll over.

This is just an off the top of my head "fix" so might be broken or not the best way to do it.


_PJ_(Posted 2013) [#3]
Sorry I took so lomng getting back to you Rrolf, been pretty busy!

Anwyay, what you've done here is great, it works a treat and seems to be accurate for Windows 8 (I got rid of the floats and /1024/1024 to stick with byte values)
Certainly seems to be good enough for me. If anyone has 6G of video RAM then I hardly think space will be an issue, so no worries there!


_PJ_(Posted 2013) [#4]
I just thought, over 4Gb the 32-bit rollover comes into effect, so presumably this would result in the "AvailVidMem() > TotalVidMem()"
This makes it a pretty 'easy' exception to catch!