PDA

View Full Version : Detecting Video Memory Available



Gadget
03-06-2003, 08:06 PM
Is this possible? Also, how many 800 x 600 x 16 bit surfaces would you expect to be able to fit into an 8Mb gfx card? Does Windows hog some of it, or can I use all of the 8Mb for surfaces?

Alimonster
05-06-2003, 02:49 PM
There are 2 bytes for 16 bits (16/8 ), so you get each surface taking up: 800x600x2 = 960000 bytes. 8 Mb = 8 * 1024 * 1024 bytes = 8388608. So dividing them gives you approximately 8.7 (i.e., 8 ) textures then. This ain't taking account of the pitch of the surfaces, which may cause them to use up a little more memory, or mipmaps in 3d (which again will consume a fair bit of memory if used). Hope my calculations aren't wrong -- I'm a little tired.

The easiest way would be to get hold of an 8meg graphics card and see for yourself. ;)

Gadget
06-06-2003, 08:30 AM
There are 2 bytes for 16 bits (16/8 ), so you get each surface taking up: 800x600x2 = 960000 bytes. 8 Mb = 8 * 1024 * 1024 bytes = 8388608. So dividing them gives you approximately 8.7 (i.e., 8 ) textures then. This ain't taking account of the pitch of the surfaces, which may cause them to use up a little more memory, or mipmaps in 3d (which again will consume a fair bit of memory if used). Hope my calculations aren't wrong -- I'm a little tired.

The easiest way would be to get hold of an 8meg graphics card and see for yourself. ;)

Thanks, I worked it out the same myself, I just don't seem to be able to fit more than 4 or 5 Mb worth of surfaces into 8Mb... I think I need an 8Mb card to test myself.

:)

noeska
10-06-2003, 06:11 PM
Is it possible to read out through directx or opengl how much memory is available on a graphics card? When that is known you can use optimized textures.

Gadget
17-03-2005, 11:40 AM
I know this is an old post, but I thought I should reply with the solution:-

Device.GetAvailableVideoMemory

If you do this at the start you can decide what to put into VRAM ;)

NOTE: Value returned will also include AGP Aperture RAM! So if it's 128Mb, and you have a 128Mb card, 256Mb will be reported!