Results 1 to 3 of 3

Thread: When are textures loaded?

  1. #1
    Junior Member Newbie
    Join Date
    Dec 2002
    Location
    austin, tx, us
    Posts
    20

    When are textures loaded?

    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.

    thanks,
    weston

  2. #2
    Junior Member Newbie
    Join Date
    Dec 2002
    Location
    austin, tx, us
    Posts
    20

    Re: When are textures loaded?

    If anyone cares, I just found a gl method that I had somehow overlooked:

    glAreTexturesResident()

    Queries the hardware to determine if the set of textures are resident (obviously). RTFM indeed.

  3. #3
    Senior Member Regular Contributor
    Join Date
    Apr 2001
    Location
    Greece
    Posts
    477

    Re: When are textures loaded?

    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.

Similar Threads

  1. Is glReadPixels affected by loaded textures?
    By abarrionuevo in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 05-11-2015, 02:27 AM
  2. Manually generate mipmaps for textures loaded using glCompressedTexImage2D
    By imported_Silverlan in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 09-19-2014, 06:20 PM
  3. Fill a GL_TEXTURE_2D_ARRAY with textures already loaded
    By cifacia in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 06-11-2014, 02:53 PM
  4. Limit on no. of textures loaded?
    By Chirag Varde in forum OpenGL: Basic Coding
    Replies: 7
    Last Post: 03-14-2011, 09:22 PM
  5. how are textures loaded?
    By just_started in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 09-16-2003, 11:14 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean