GLPRIORITIZETEXTURES(3G)

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

πŸ’… GLPRIORITIZETEXTURES(3G) β€” or, how to tell your textures who's the main character

okay bestie, welcome to the 3G manual, babe β€” this is glPrioritizeTextures, and it's literally the tool that lets you rank your textures like a group chat ranking of who's most likely to show up. 🌸


✨ NAME ✨

glPrioritizeTextures β€” set texture residence priority πŸ‘‘


πŸ“œ C SPECIFICATION πŸ“œ

void glPrioritizeTextures( GLsizei n,
                           const GLuint *textures,
                           const GLclampf *priorities )

no cap, that's the whole signature, copy it exactly bestie 🫢


πŸŽ€ PARAMETERS πŸŽ€

  • n β€” the number of textures you're out here prioritizing. how many glow-ups are we doing today, queen?
  • textures β€” an array holding the names of the textures getting the priority treatment. it's the guest list πŸ’Œ
  • priorities β€” an array holding the actual texture priorities. and the way this works is: a priority sitting in one element of priorities applies to the texture named by the corresponding element of textures. so element 0 matches element 0, element 1 matches element 1, it's giving matched set energy πŸ”₯

🌈 DESCRIPTION 🌈

glPrioritizeTextures assigns the n texture priorities in priorities to the n textures named in textures. simple as that, fr fr.

so here's the tea: the GL keeps a "working set" of textures that are resident in texture memory. ✨ these resident textures can be bound to a texture target way more efficiently than textures that aren't resident. by letting you specify a priority for each texture, glPrioritizeTextures lets your application guide the GL implementation in deciding which textures should be the resident ones. it's basically you being the group chat admin of texture memory πŸ‘‘

the priorities in priorities get clamped to the range [0,1] before they're assigned. here's the vibe check:

  • 0 = the lowest priority. textures with priority 0 are the least likely to be resident. they're the ones left on read 😭
  • 1 = the highest priority. textures with priority 1 are the most likely to be resident. main character energy only πŸ’…
but β€” and this is important β€” textures are not guaranteed to be resident until they are actually used. so don't come for me if your priority-1 texture is still not showing up, bestie, the GL said what it said.

glPrioritizeTextures silently ignores attempts to prioritize texture 0, or any texture name that doesn't correspond to an existing texture. like, no error, no drama, just ignored. πŸ’€

also: glPrioritizeTextures does not require any of the textures named by textures to be bound to a texture target. glTexParameter may also be used to set a texture's priority, but only if the texture is currently bound. and heads up β€” that's the only way to set the priority of a default texture. iykyk πŸ™ˆ


πŸ“ NOTES πŸ“

glPrioritizeTextures is available only if the GL version is 1.1 or greater. so check your version before you get too excited, gorgeous. ⭐


πŸ’€ ERRORS πŸ’€

  • GL_INVALID_VALUE is generated if n is negative. negative count?? not on my watch πŸ™…β€β™€οΈ
  • GL_INVALID_OPERATION is generated if glPrioritizeTextures is executed between the execution of glBegin and the corresponding execution of glEnd. so do NOT call it inside a begin/end pair, bestie, that's the forbidden zone 🚫

πŸ” ASSOCIATED GETS πŸ”

glGetTexParameter with parameter name GL_TEXTURE_PRIORITY retrieves the priority of a currently bound texture. that's your little peek-behind-the-curtain, go look at what priority your bound texture actually got πŸ¦‹


πŸ‘‘ SEE ALSO πŸ‘‘

  • glAreTexturesResident(3G)
  • glBindTexture(3G)
  • glCopyTexImage1D(3G)
  • glCopyTexImage2D(3G)
  • glTexImage1D(3G)
  • glTexImage2D(3G)
  • glTexImage3D(3G)
  • glTexParameter(3G)

okay that's the whole page, no notes, ate and left no crumbs πŸ“πŸ’– and for the cute sign-off: this little masterpiece is filed under GLPRIORITIZETEXTURES(3G) β€” that's the source/version-and-date footer, bestie, so if you ever need to cite it, that's the one. mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from