View Full Version : How much space is taken up?

07-06-2002, 06:34 AM
How much space does the depth buffer use on the video card? In Megabytes? I once read that a 1024x768 window takes up 9 megs of space on a video card, is this correct? And how would I find out other window sizes??

07-06-2002, 07:29 AM
You can never know fore sure how much is allocated for the Z-buffer. But in general you can calculate it very easily.

total number of pixels = width * height.
total number of bytes in depth buffer = total number of pixels * bytes per pixel

For a 16 bit depth buffer, you have 2 bytes per pixel, and therefore the depth buffer information for that region consumes 1024*768*2 = 1.5 MByte.

The actual memorybuffer allocated by the card is at least this size, but it can also be more, due to padding, line pitch (store each scan line on a power of two boundary for example), and other internal information about the depht buffer.