PDA

View Full Version : how can I know how much the video memory my program used



pango
07-11-2004, 11:28 PM
my program use a large of video memory,but I don't the accurate size,so does anyone can tell me how to calculate the video memory my program used?Because I need the parameter to optimize my program,thanks!

pleopard
07-12-2004, 09:24 AM
I believe that the correct answer is "OpenGL won't tell you".

PanzerSchreck
07-12-2004, 10:09 AM
OpenGL won't tell you that, but if you mostly use objects whose size is known to you, then why not count the consumption by yourself?
If you for example only use textures and VBOs, then it should be very easy to calculate the rough amount of VRAM that your app consumes, and that's the only way. But as soon as you use displaylists it get's harder, as there is no real formula for getting how much VRAM a DL needs.

SirKnight
07-12-2004, 01:11 PM
Does this really matter?

-SirKnight

Korval
07-12-2004, 04:28 PM
Does this really matter?Yes. Some of us care about performance.

Too many textures/VBO's == texture/VBO thrashing == low performance == bad.

I prefer the estimation approach. Just make assumptions about how much VRAM textures are going to take up by counting bytes. Add 10% to this, plus the size of the framebuffers, and you have a pretty decent estimate to the minimum VRAM that will run your game well.

NitroGL
07-12-2004, 05:19 PM
You can find out with DirectDraw.

SirKnight
07-12-2004, 08:48 PM
Yes. Some of us care about performance.
Wake up on the wrong side of the bed or something? Jeeze. I was just curious why this mattered.

You could have phrased that a different way that didn't insult me buddy. I'm sorry that I'm not as much of a genius as you.

-SirKnight

knackered
07-13-2004, 12:04 AM
You were curious? Wasn't the answer obvious? But you decided to post your inane question anyway? This really is just a chat room for you, isn't it sirknight? Somewhere where you can say the first thing that comes into your head...

SeskaPeel
07-16-2004, 01:50 AM
This morning I had a coffee, and then I went to work. In France the weather is great, I'll probably take my first attempt at surfing tommorrow.

I wonder how I could get that in an OpenGL app, that could run quite smoothly if I don't consume all my videomemory.

And maybe a 3D graph modelling knackered brain could be an interesting stuff too. With a lot of polyline quadstripped lighting bolts, and some blur effect on some parts.

Ho ... but blur effect needs an offscreen rendering, maybe I should think to add this to my VRAM consumption estimation.

SeskaPeel.

JustHanging
07-16-2004, 02:19 AM
You might get away with using the backbuffer for the blur, that way you don't need the extra memory. Unless you were going to render directly to the front buffer. I guess for knack's brain anything chaotic would do, but it propably would cause problems when rendering France.

-Ilkka