Sign in to follow this  

Fbo texture takes more mermory than expected

This topic is 3193 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi! I'm doing some simple tests to determine the size in memory of a 3D texture. I got these results from Video Memory Watcher. A RGB 3D texture, 256*256*256 texels, using GL_RGB16F_ARB to store it on the video memory, should take: 256*256*256*3(RGB)*2(16bits) = 96Mo But, when binding the fbo, the free video memory amount decrease by 254Mo (158Mo more than 96Mo)! Did anybody already solve this issue? I working on NVDIA 8800 GTX. Thanks in advance! [Edited by - mattlic on March 17, 2009 3:51:07 PM]

Share this post


Link to post
Share on other sites
this is a odd error the only thing I can think of is that the card creates a depth buffer for the texture, plus perhaps your card does not support true RGB textures and internally raise it to a RGBA.. Still dont think this would account for 254MB but would be a lot closer..

Maybe someone can shead more light on the subject...
also are you doing more then just creating a FBO and binding it? The card will (should) cache any other FBO's or textures for speed reasons... and what are you using to get the free memory? That itself might be more of a estimate then a true value..

actuly now that I think about your math may be off, your mult'ing it by 2 for 2bytes but if your diving it by 1024(bits) you will get the wrong value... tryed it with multing it by 16 and came out right

[Edited by - cherryyosh on March 17, 2009 2:28:28 PM]

Share this post


Link to post
Share on other sites
Here is the shortest piece of code that can replay my problem:

GLuint fbo_id;
GLuint texture_id;

// Bind FBO.
glGenFramebuffersEXT (1, &fbo_id);
glBindFramebufferEXT (GL_FRAMEBUFFER_EXT, fbo_id);

// Texture creation.
glGenTextures (1, &texture_id);
glBindTexture (GL_TEXTURE_3D, texture_id);
glTexParameteri (GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexImage3D (GL_TEXTURE_3D, 0, GL_RGB16F_ARB, 256, 256, 256,
0, GL_RGB, GL_FLOAT, 0);

// Texture attachment.
glFramebufferTexture3DEXT (GL_FRAMEBUFFER_EXT,
GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_3D, texture_id,
/*mipmap_level*/0, /*slice*/0);
fbo_check_validity();

No other textures or fbo are present on the memory. I've been looking
on the web for hours but I didn't found any response :(

For my maths, here is the detail:
256*256*256*3(RGB: 3 chanels)*2(16bits = 2 bytes) = 100663296 bytes
100663296 o = 100663296/1024 Kbytes = 98304 KBytes
98304 KBytes = 98304/1024 MBytes = 96MBytes

You was right, a RGBA texture take the same amount of memory.
But as you told me, even a RGBA texture should take 128MB, not 254MB.. :(

Share this post


Link to post
Share on other sites
I did some tests with other opengl internal format.
Here is the amount of memory that takes the 256^3 texture
with the different formats.

GL_LUMINANCE_FLOAT16_ATI: 62Mo.
GL_LUMINANCE_FLOAT16_APPLE: 62Mo.

GL_LUMINANCE_FLOAT32_ATI: 126Mo.
GL_LUMINANCE_FLOAT32_APPLE: 126Mo.

GL_RGBA16F_ARB: 254Mo.
GL_RGBA16_EXT: 254Mo.

GL_RGBA32F_ARB: 510Mo.

Maybe the fact that it always takes [expected size]*2-2 Mo
it's a clue..

Share this post


Link to post
Share on other sites
Quote:
Original post by HuntsMan
How are you measuring free video RAM?


Yes.

In my case, I need to attach 3 rgb textures 256^3 to a fbo.
It should take only 3*128=384Mo but It don't feet on
the NVIDIA 8800 GTX (Video RAM: 768Mo)

Share this post


Link to post
Share on other sites
Quote:
Original post by mattlic
Quote:
Original post by HuntsMan
How are you measuring free video RAM?


Yes.


Sorry, I read your question to fast :).
I'm measuring the free video RAM with
Video Memory Watcher

Share this post


Link to post
Share on other sites

This topic is 3193 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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