Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Shag

Graphics Card Memory Usage

This topic is 6159 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

How do you query the graphics card to find out how much memory has been used, and for what purpose? I know there are tools (AGPWiz) which tell you how much memory if available etc ... but how do you do it in software? I know you could add up image sizes etc, but that is no good if texture compression is used! I''m thinking in particular about reducing texture sizes for cards with less memory Regards

Share this post


Link to post
Share on other sites
Advertisement
I don''t know the answer to your question ... but i do know that hueristically you should use the amount of available space and perhaps the cards specs (chipset .. DDcaps etc) and video mode to make this desision .. you should NOT be reverse engineering the arangement from lists of images / surfaces / textures etc .. this would just cause your program to work against the driver .. becasue the driver is going to allocate new surfaces based on their requests and the memory allocated at the time ...

In DirectX it is possible to ask the card for some of this information ... and then you can use the answer to make your decisions .. but this should really be done ahead of time .. NOT on the fly ... like this:

when they run your app .. check to see if there is a stored configuration .. if so use it ... if not ... query the driver for it''s capabilities ... then use this info to generate a default configuration ... if you want to be REALLY sophisticated ... you also test your desired config ... and/or give the user the ability to manually adjust it ... then you save it for next time the run the app (hence the stored config check at the begining of this process).

This way the user gets to make the decisions about detail vs. performance .. cause some people demand absolutely smooth play .. other prefer more eye candy and are willing to deal with a few hicups now and then ... as long as your default choices are good and you give them the option to revert to defaults if they screw up there config .. then they can''t bitch when 1600x1200 doesn''t boot on a matrox G450 ... lol.

good luck

Share this post


Link to post
Share on other sites
There is no way to find out how much memory is being used. There was ways to get an approximate answer, like the dwAvailableVidMem or whatever it''s called of DDCAPS, but it''s not very accurate.

You can usually find out the total video memory though, for example there''s a dwTotalVidMemory (or something) is DDCAPS. I''m not sure if there''s an opengl equivalent, but I''m pretty sure you can use the WinAPI if not...

There isn''t really ever any need to find out how much is free anyway. Your app should just let the user turn the texture detail down himself if things are running a bit choppy.


War Worlds - A 3D Real-Time Strategy game in development.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!