PDA

View Full Version : vram memory management



TheSillyJester
08-26-2003, 12:49 PM
Hello,

In order to optimize my rendering pipeline, I need to know the amount of vram. I will use it to determine how much cache for textures and VBOs.

The only article I found is this: http://www.delphi3d.net/articles/viewarticle.php?article=texman.htm
And it's really a bad way (And just doens't work on on-board GPU which share memory with CPU.

Well isn't there a way to get something related to the GPU memory amount?

TheSillyJester
08-26-2003, 01:17 PM
By triyng some new keyword i found more related materials:

A good idea of extension to query available memorys blocks: http://groups.yahoo.com/group/opengl-gamedev-l/message/19028

The official OpenGL way, which will faill with on_board GPUs: http://www.opengl.org/developers/faqs/technical/texture.htm#text0120

I search on the extension registry, Win32 memory management on MSDN, and find nothing.

Which sort of heuristics do you use?

Korval
08-26-2003, 02:57 PM
In order to optimize my rendering pipeline, I need to know the amount of vram. I will use it to determine how much cache for textures and VBOs.

Drivers are written to do caching for you. So leverage this; don't worry too much about the amount of VRAM.

jwatte
08-26-2003, 06:33 PM
You can't know. Even if you measure when you start up, the user could change display mode from 16 bit to 32, or dynamically enable a second screen (at 1600x1200 or bigger), or do one of a million other things.

I'd provide a slider saying "faster <--> prettier" and let the user decide. Default to the middle.

A laptop (or other machine) running an internal and external screen, each at 1600x1200, with unified back and depth buffers, at 32 bpp, will take at least this much graphics memory:

3200x1200x4x3 == 46080000 bytes. That's 43.9 MB, just for frame buffers.

Korval
08-26-2003, 08:00 PM
I'd provide a slider saying "faster <--> prettier" and let the user decide. Default to the middle.

I don't necessarily agree with this. The user should have some say in different details and effects: texture quality, shadows, number of real lights, etc. I do agree, however, that the program should not try to balance these bars based on the size of video memory.

If you want to auto-fit your graphical effects, do it a better & more reliable way: profile the user's machine at boot-up time (or give him a button to push to auto-profile). Run a series of tests to see how much texture resolution/other effects the user's machine can take.

TheSillyJester
08-27-2003, 04:23 AM
Well the problem is that I want to allocate a unique VBO that wil fit on the VRAM without disturbing too much textures (let say 16Mo on a 64Mo board, on a 16Mo board I will allocate it on the AGP mem). It size is important because all the static geometry on a view must fit on this VBO (if not lod is applied). That's because all the scene geometry will not fit the VRAM, and I don't want to waste system mem (I can have >50Mo of geometry loaded so having it twice isn't so good).

Well, i'm not very clear:-).