3D texture and GL_OUT_OF_MEMORY

Greetings,

My OpenGL-based application has a problem with the GeForce FX5600 (256 MB) card.
I use 3D texturing, and I can load upto 512x512x256 textures with 1 GB RAM of system memory. There is no problem when I load a volume for the first time. However when I replace an existing volume-texture with a bigger one, I sometimes get a GL_OUT_OF_MEMORY error, even when there is plenty of memory available.

The behaviour is not consistent, and is triggered by certain combinations of texture sizes. e.g. when I first load a 512x512x128 texture, and try to replace it with a 512x512x200 texture, it fails. However if I load a 512x512x200 texture initially, then I don’t have a problem replacing it with another 512x512x200 texture.

I currently use the 45.23 drivers.

I would appreciate any suggestions.

Bala

What texture format are you using? If it’s 32bit uncompressed, that’s no surprise, as 512x512x256x32bit are 256 MiB of texture data (without mipmaps). Since your card doesn’t support virtual texturing, that data has to fit entirely either into video memory or AGP memory. Whether you have 1 GiB or 2 GiB of system RAM doesn’t matter.

How do you load your textures exactly?

Originally posted by Xmas:
What texture format are you using? If it’s 32bit uncompressed, that’s no surprise, as 512x512x256x32bit are 256 MiB of texture data (without mipmaps). …
How do you load your textures exactly?

Sorry, I forgot to mention: I use 8-bit textures, so I am not even close to using the card’s capability. I use the glTextureImage3d extension to load the texture. This call generates a GL_OUT_OF_MEMORY error (inconsistently, as I explained in my original post)

Originally posted by clunis_immensus:
Sorry, I forgot to mention: I use 8-bit textures, so I am not even close to using the card’s capability.

What’s your internal format?

Even though you only need 8-bit per texel, the implementation might allocate more, for several reasons. Use a texture proxy to check if the size you want would fit.

This was copied from the GL_EXT_texture extension.Pay attention to the last sentence.


All implementations of this extension support the base formats ALPHA,
LUMINANCE, LUMINANCE_ALPHA, RGB, and RGBA. All implementations also
accept all the tokens in the table above, but may not allocate storage
exactly equal to that indicated in the table. Instead, storage is
allocated to best match the resolutions in the table. The determination
of best match is left to the implementation. Storage allocation for the
base formats (as well as for formats “1”, “2”, “3”, and “4”) is an
implementation dependent compromise of component resolution,
performance, image size, and memory availability.

[This message has been edited by roffe (edited 10-20-2003).]

The GL_OUT_OF_MEMORY errors stopped since I switched to the 52.16 drivers.

Bala