PDA

View Full Version : [D3D] calculate video-memory-usage



chronozphere
23-05-2006, 02:15 PM
Hi all. ;)

I thought it would be nice to let the engine keep track of the ammount of videomemory used.
Now i do it like this (i add all these numbers):

Displaymode:
>>width * height * bitdepth (can be 2 or 4 bytes)

VertexBuffers
>>VertexCount * SizeOf(VertexRecord)

IndexBuffers
>>IndiceCount * 2 (i use D3DFMT_INDEX16)

Textures
>>Width * Height * BitDepth (Bitdepth depending on the display mode)

I just calculate the ammount of bytes taken by the display and add the sum of the memory-usage of all vertexbuffers, indexbuffers and textures. :)

Is the above way accurate?? Are there better ways?? How do you guys do this???

Thnx in advance. :)

JSoftware
23-05-2006, 03:09 PM
i would guess it's somewhat accurate. only displaymode would be a problem to calculate. are you using color display only or do you have depth buffering, double buffering, alpha, stencil, aux, fsaa?

czar
23-05-2006, 06:13 PM
I use a program called

MemStatus 2.4 by
Kevin Reems (2003)

It shows memory and video memory usage.

It is excellent. I am working on a huge project, a team has been working on it for 12 months, and we found that the software had problems releasing video memory. This program allowed me to discover the problem and I was able to experiment to discover what the problem was and fix it.

I would post it. But a major problem with PGD is that it is impossible attach files directly.