Sign in to follow this  
ade-the-heat

how much GPU memory am I using ?

Recommended Posts

I also forgot to mention that you can manually calculate the GPU RAM used for textures with the following formula:
width*height*(BitDepth/8)
Each texture buffer also uses some extra kb; but they do not mean THAT much. Actually, at least in Direct3D, width value should be replaced by the Pitch value if you're using DirectDrawSurface. They usually are equal, but they may slightly vary among GPU cards
Note that BitDepth should be the bit depth used for your textures in the card, not the original bit depth from the texture in your hard drive
3D textures basically covers the usage of GPU RAM, plus the front+back+Z buffers (use the same formula)
If you're using, for example, Direc3D's Vertex buffers you should count them too. The formula would be: sizeof(MyVertexStruct)*Number_of_Vertices_in_vertex_buffers

Well, I hope you'll find this usefull

Share this post


Link to post
Share on other sites
glIsResident....

a call on a texture to see if that texture is resident in vRAM. Although the specs are hazy when it comes to mipmaps. Also, this only works for textures, not VBOs....

There is no current way to know how much vRAM your occupying, and even counting texture ram doesn't work because they might not be in vram, but in sys ram....

A combination of counting the bytes and glIsResident should do it....

Regards,
DarkProphet

Share this post


Link to post
Share on other sites
Quote:
Original post by darkprophet
glIsResident....

a call on a texture to see if that texture is resident in vRAM. Although the specs are hazy when it comes to mipmaps. Also, this only works for textures, not VBOs....

There is no current way to know how much vRAM your occupying, and even counting texture ram doesn't work because they might not be in vram, but in sys ram....

A combination of counting the bytes and glIsResident should do it....

Regards,
DarkProphet

I assume you talk about glAreTexturesResitend, as there is no glIsResident.

Anyway, the information returned is not reliable at all. The specification only says that a resident texture is a part of a working set. What a working set is, is completely up to the implementation to decide, and it may not even have a working set. A working set could mean something like "dedicated texture memory", but what does that mean? Video memory? Video memory and additional AGP memort for systems that have such memory? Any texture that isn't swapped to disk by the OS?

In the end, the information you get is not very reliable, and I wouldn't be surprised if modern drivers actually ignores the working set completely (returns true no matter what).

Share this post


Link to post
Share on other sites
ah yes, glAreTexturesResident is the function I was speaking on. I was in a rush to get things packed...

Yes, i agree, the specifications are vague. I do wish that they would go back and redo the specifications for that method as it can be very helpful in getting the most out of OGL...

Regards,
DarkProphet

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this