PDA

View Full Version : 3D Textures in GPU(VPU) memory only ?



boila
01-13-2004, 02:13 PM
I've to render really large volumes and the texture mem of the available board is really huge. Is there a way to avoid that OGL holds a copy of the 3D-Texture in host memory, since I need that mem for other stuff like running the OS or to compute some stuff ?
With the ARB_render_texture extension one can use pixel buffers as 1D and 2D but not as 3D textures without this (sometimes) un-necessary copy in host mem. Some ideas ?

orbano
01-13-2004, 02:23 PM
3d textures threated the same way as 3d textures (except a few thing), so when glTexImage is called, it is copied to the host memory if available (or to host memory if not). You can control this only with PrioritizeTextures. To not waste your system memory, delete the texture source (which was used by teximage). If you want it more detailed, see ogl specs (1.2.1 for example)

boila
01-14-2004, 03:00 AM
That seems all true (funny 1st sentence;) but doesn't come up with a solution. The result of my observation ist that OGL holds a copy in host mem regardless of having a copy in GPU mem or not. If a texture >would< be in either host or GPU mem then OGL would have to download a texture via AGP to make space for a new one if GPU mem is low. I think thats not the case. Of course I freed the mem used during invocation of glTexImage.
The second observation I've made with an ATI Radeon 9500 is that if using RGBA-textures the host memory consumed is precisely half the size of the texture (seen in the TaskManager of WinXP). Does that mean that ATIs OGL pre-compresses the texture with the CPU ? I know that ATI has a magic lossless fixed-factor color compression to save GPU to MEM bandwidth. Can anyone comfirm that with some facts ?

jwatte
01-14-2004, 09:42 AM
OpenGL typically needs to keep a copy in system memory, no matter whether it's currently uploaded or not. This is for two reasons:

1) If the VRAM is needed for other things, reading back the texture to preserve it would be slow. Instead, that VRAM can be re-used without concern, if there's a backing copy in system RAM.

2) Windows manages video memory in an "interesting" fashion such that the driver can be told that "oh, by the way, you lost this memory now" without prior warning. In that case, without a system memory copy, the texture would be irrevocably lost, which would violate the spec.

Thus, if you need large textures, buy more memory.

boila
01-14-2004, 11:27 AM
... and buy an OS that can handle enough virtual address space