So, i'm thinking of calculating the VRAM in use.
Now, i don't intend to track every single byte in the VRAM (nor do i think it's possible), i was just thinking of keeping track of how much memory
I upload to the GPU, to get an estimate of the VRAM that is in use (by keeping track of the amount of memory textures, VBOs,buffers, etc occupy).
Of course i'd have to keep in mind packing, compression, etc. My question is mostly about the color/depth/stencil/etc buffers.
Say i create a window, single buffered, with a 32-bit (RGBA) color depth and a 16-bit depth buffer.
I know that the color buffer occupies 4 bytes per pixel, and has the same size as the window (say 800x600).
The depth buffer occupies 2 bytes per pixel and also has has the same size as the window.
My first question would be. If i switch to fullscreen mode with a bigger resolution (say 1280x800), am i correct to assume that they are expanded to match the new window size?
And if i return to windowed mode again, assuming the buffers are, once again, resized to match the window size, to the memory the buffers occupy in the VRAM actually shrinks, or is just a part of the memory that was used for the larger (fullscreen) size is unused?
Also, for double buffering, the window requires 2 color buffers, basically doubling the memory needed for the color buffers, right?
I also assume that using double buffering and support for stereoscopic 3D means 4 color buffers (back left & right, front left & right).
Another question would be, does the stencil buffer uses it's own memory, or is it shared with another buffer (say the depth buffer)?
Also, i've read somewhere that multisample requires a buffer per sample (say a 4x Multisample would require 4 buffers). If anyone could enlighten me at this, i'd appreciate it very much.
I'm nol yet accounting for user created buffers (like geometry buffers user for deferred shading, or a custom, floating point, depth buffer for HDR).
As a last note, is it correct to assume that all this things that can be created by the graphics API (OpenGL in this case) reside on the VRAM, or are there exceptions?
If something is not clear, then i'll be happy to explain.
Thanks in advance.