View Full Version : When are textures loaded?
12-11-2002, 01:43 PM
It is my understanding that textures are loaded onto the video card when a gluBuild*Mipmaps occurs. But how is this managed? In other words what if the texture memory on the card fills up (does gluBiuld*Mipmaps return an error)? What about different rendering contexts, how/where are the textures for an old context stored when a context switch occurs? Is this all managed by the driver? Is there any method for interrogating the card for what textures are resident?
I'm experiencing a problem rendering with the same textures to different windows sharing a context and I'm not sure what is causing it.
12-12-2002, 11:52 PM
If anyone cares, I just found a gl method that I had somehow overlooked:
Queries the hardware to determine if the set of textures are resident (obviously). RTFM indeed.
Textures are loaded(not necessarily on VRAM) when an glTexImage* command is issued.Where the textures end up is driver dependent but if there's enough VRAM they should end up there(and be resident, although residency isn't defined as "in VRAM").If VRAM is full nothing will fail but some textures will be kept in(swapped out to) system RAM and will need to be reloaded to VRAM when they're bound.Therefore filling the VRAM will result in thrashing(lots of memory copying) and slow performance.gluBuild*Mipmaps is just a utility function that downsamples images and calls glTexImage* to upload them.
I've never tried multiple contexts so I'll just shut up now.
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.