PDA

View Full Version : TEXTURE_BASE_LEVEL cleverness?



Pentagram
12-09-2004, 12:58 AM
When setting TEXTURE_BASE_LEVEL to a higher miplevel than 0, the hardware shouln't load the highest level in texture memory "in theory". So I was wondering if modern hardware actually does this, is there any inofrmation on this somewhere.
And what with unspecified levels ( teximage with NULL levels, would that help or will it just fill them with white pixels )

Charles

idr
12-10-2004, 06:57 AM
The whole point of LOD clamping is to reduce memory usage. I would be very surprised to see an implementation that did upload textures levels outside the clamped range. I know that the open-source drivers for Linux don't.

evanGLizr
12-10-2004, 09:47 AM
Originally posted by idr:
The whole point of LOD clamping is to reduce memory usage. I would be very surprised to see an implementation that did upload textures levels outside the clamped range. I know that the open-source drivers for Linux don't.Hmmm I don't agree with that, the whole point of LOD clamping is deferred texture uploads, not reduced memory usage.

Otherwise when the LOD clamp changes (and it will change, otherwise you would have created a texture with less resolution from the start) the driver will have to reallocate & copy the texture (assuming that all the mipmap levels have to be contiguous, which afaik they have for current graphics cards).

I don't think you will reduce the video memory usage using LOD clamping, I'm surprised myself that Linux drivers do that ;)

jwatte
12-11-2004, 07:34 AM
NVIDIA has publicly stated that LOD clamping DOES NOT change the resident texture size in "uploaded" VRAM. 3dlabs has publicly stated that LOD clamping DOES change the load on resident texture memory.

Conclusion: different hardware implements things differently. Hooray for an abstract API!

evanGLizr
12-11-2004, 04:23 PM
Originally posted by jwatte:
NVIDIA has publicly stated that LOD clamping DOES NOT change the resident texture size in "uploaded" VRAM. 3dlabs has publicly stated that LOD clamping DOES change the load on resident texture memory.

My guess is that actually both behave the same, both allocate the full mipmap chain disregarding BASE_LEVEL, but because 3Dlabs supports virtual addressing, it only pages in the mipmap levels of the texels actually fetched (a much better behavior than you get just with BASE_LEVEL clamp).

This has more to do with the benefits of virtual memory than with TEXTURE_BASE_LEVEL (you would still get that behavior if you don't set TEXTURE_BASE_LEVEL and just set the MAX_LOD clamp).

jwatte
12-11-2004, 06:31 PM
This has more to do with the benefits of virtual memory than with TEXTURE_BASE_LEVELThat's my guess as well. But setting TEXTURE_BASE_LEVEL means that you will restrict what the highest-detail level will be, so it accomplishes the same thing with regards to VRAM resident size (as I think you're also saying -- just clarifying).