GLARETEXTURESRESIDENT(3G)

πŸ“¦ version 24.3.3, in opensuse-leap 16.0

✨ NAME ✨

glAreTexturesResident β€” bestie, this one tells you if your textures are actually loaded in texture memory or just, like, vibing in the void πŸ’–


πŸŽ€ C SPECIFICATION πŸŽ€

GLboolean glAreTexturesResident( GLsizei n,
                                 const GLuint *textures,
                                 GLboolean *residences )

🌸 PARAMETERS 🌸

  • n β€” how many textures you wanna interrogate, queen. The count of the query.
  • textures β€” an array holding the names of the textures you're asking about. Yes, the names. Not the vibes, the names.
  • residences β€” the array where the answer gets dropped off 🫢 The residence status of a texture named by an element of textures comes back in the corresponding element of residences. Same index, same bestie, no shuffling.

πŸ’… DESCRIPTION πŸ’…

So GL keeps a ``working set'' of textures that are resident in texture memory. And the way that these resident textures can be bound to a texture target is so much more efficient than the textures that are not resident. It's giving fast lane vs. back of the line, honestly.

glAreTexturesResident queries the texture residence status of the n textures named by the elements of textures. Here's the tea:

  • If all the named textures are resident β†’ it returns GL_TRUE, and the contents of residences are left undisturbed. We don't touch, we don't poke, we just say yes ✨
  • If not all the named textures are resident β†’ it returns GL_FALSE, and the detailed status gets returned in the n elements of residences. If an element of residences is GL_TRUE, then the texture named by the corresponding element of textures is resident. Index matching, periodt.

Also, lowkey, you can check the residence status of a single bound texture by calling glGetTexParameter with the target argument set to the target to which the texture is bound, and the pname argument set to GL_TEXTURE_RESIDENT. And heads up bestie β€” this is the only way that the residence status of a default texture can be queried. The only one. Don't come at me with other ideas.


πŸ‘‘ NOTES πŸ‘‘

  • glAreTexturesResident is available only if the GL version is 1.1 or greater. Older GL, sorry babe, no dice.
  • It returns the residency status of the textures at the time of invocation. It does not guarantee the textures will remain resident at any other time. So don't screenshot this answer and frame it, okay? It's a moment, not a promise 😭
  • If textures reside in virtual memory (there is no texture memory), they are considered always resident. Always. Iconic behavior.
  • Some implementations may not load a texture until the first use of that texture. So like, it might be shy until you actually use it πŸ™ˆ

πŸ’€ ERRORS πŸ’€

  • GL_INVALID_VALUE is generated if n is negative. Negative count? Bestie no.
  • GL_INVALID_VALUE is generated if any element in textures is 0 or does not name a texture. And in that case, the function returns GL_FALSE and the contents of residences is indeterminate β€” aka, don't trust it, it's chaos.
  • GL_INVALID_OPERATION is generated if glAreTexturesResident is executed between the execution of glBegin and the corresponding execution of glEnd. Not inside that block, babe. Read the room.
Fr fr, do not call this between glBegin and glEnd. It will absolutely not slay there.

πŸ”₯ ASSOCIATED GETS πŸ”₯

glGetTexParameter with parameter name GL_TEXTURE_RESIDENT retrieves the residence status of a currently bound texture. That's the one, iykyk πŸ’œ


πŸ¦‹ SEE ALSO πŸ¦‹

glBindTexture(3G), glGetTexParameter(3G), glPrioritizeTextures(3G), glTexImage1D(3G), glTexImage2D(3G), glTexImage3D(3G), glTexParameter(3G)


And that's the whole page, bestie πŸ’– This was the GLARETEXTURESRESIDENT(3G) manual page β€” same name up top, same name down at the bottom as the source/version footer. Go check your textures, tell them they're resident, and have the best day πŸŽ€βœ¨πŸ«Ά

πŸ“¦ where this page comes from