Video memory usage

Started by
12 comments, last by InsaDe 20 years, 3 months ago
I have found no way of really knowing how much videocard memory is available, and indeed that causes a problem : there is know way of knowing when the driver resorts to slower memory. The game i''m curretly working on has many large textures, and it does not fit in 3D card memory (or even in RAM for most systems), but the textures needed for one frame do not take that big of an amount of texture memory. ideally, the best would be to keep textures in video memory for as long as possible without forcing the driver to fallback to AGP memory. But to do this, knowing how full the hightspeed memory is is crucial!
The driver cannot know you apps intent.
The next directX, DirectXNext, will have memory queries, associated with speed information.
Act of War - EugenSystems/Atari
Advertisement
quote:Original post by gmkwo
What is the AGP memory?


It is system memory that can be used by both the CPU (to put stuff in there) and by the graphics card (it gets stuff from that memory block using DMA and the AGP bus).
The size is controlled by the BIOS, the ''AGP aperture'' parameter.
I think you''ll find this thread particularly useful - same topic, but gives Yanns take on the problem.

Its useful to determine a rough estimate of the amount of VRAM available, but the figure can only be a very rough estimate at best, due to how the card and drivers use the memory internally. Because of this, the best option seems to be to allow the user to choose the quality levels for the game, and then use this to determine a figure for VRAM. Of course how you use the VRAM should not only depend on the amount available, it should depend on the hardware set-up as a whole (different cards - different strengths/weaknesses), and this is another reason why the user should be allowed to choose.

Kyle
In D3D9 there''s also a function called GetAvailableTextureMem() on the device. I''ve never used it, but looking at the docs it doesn''t seem to have any drawbacks other than some inaccuracy (only returns results in megabytes, and has some alignment issues and such).

Or, if you already know the total amount of memory on the card, you could keep a running total of how much memory you''re allocating on your own. It wouldn''t be perfectly accurate, but it''d give you a rough idea.

For instance, in my code I have a static variable in my Texture class that keeps track of how much texture memory I''ve allocated, and every time I create a new texture I add the approximate memory taken to that total. It''s not perfect, but it gives me a rough idea how much memory I''ve used, which is usefull because I''m trying to keep my memory usage under 64MB or so.

Anyway, just a couple of ideas there.

----------------------------------------
"Before criticizing someone, walk a mile in their shoes.
Then, when you do criticize them, you will be a mile away and have their shoes." -- Deep Thoughts
"If you have any trouble sounding condescending, find a Unix user to show you how it''s done." - Scott Adams
FaceHat Software -- Wear the hat.

This topic is closed to new replies.

Advertisement