GLTEXBUFFER(3G)
π GLTEXBUFFER(3G) β glTexBuffer, glTextureBuffer β from [FIXME: manual]
okay bestie, welcome to the iconic buffer-texture manual page. This is part 1, and we are keeping every single detail, no cap.
πΈ NAME πΈ
glTexBuffer, glTextureBuffer β attach a buffer object's data store to a buffer texture object.
π» C SPECIFICATION π»
void glTexBuffer(GLenum target, GLenum internalformat, GLuint buffer);
void glTextureBuffer(GLuint texture, GLenum internalformat,
GLuint buffer);
π PARAMETERS π
targetβ specifies the target to which the texture is bound forglTexBuffer. It must beGL_TEXTURE_BUFFER.textureβ specifies the texture object name forglTextureBuffer.internalformatβ specifies the internal format of the data in the store belonging tobuffer.bufferβ specifies the name of the buffer object whose storage to attach to the active buffer texture.
π¦ DESCRIPTION π¦
okay so here's the vibe: glTexBuffer and glTextureBuffer attach the data store of a specified buffer object to a specified texture object, and they specify the storage format for the texture image found in the buffer object. The texture object must be a buffer texture. That part is not optional, bestie.
If buffer is zero, any buffer object attached to the buffer texture is detached and no new buffer object is attached. If buffer is non-zero, it must be the name of an existing buffer object. periodt.
bestie, lowkey important:buffer=0does the detach thing.bufferβ0has to be an existing buffer object. no cap.
internalformat specifies the storage format, and must be one of the following sized internal formats:
and yes, the original page literally says that sentence twice, so here it is again because I am not dropping a detail: internalformat specifies the storage format, and must be one of the following sized internal formats. iconic of them to repeat it, honestly.
π§ the sized internal formats β all 33 of them π§
each line below gives you the sized internal format, then its base type, components, norm, and the component slots 0, 1, 2, 3 exactly like the original table:
GL_R8β base typeubyte; components1; normYES; component slots:0=R,1=0,2=0,3=1.GL_R16β base typeushort; components1; normYES; component slots:0=R,1=0,2=0,3=1.GL_R16Fβ base typehalf; components1; normNO; component slots:0=R,1=0,2=0,3=1.GL_R32Fβ base typefloat; components1; normNO; component slots:0=R,1=0,2=0,3=1.GL_R8Iβ base typebyte; components1; normNO; component slots:0=R,1=0,2=0,3=1.GL_R16Iβ base typeshort; components1; normNO; component slots:0=R,1=0,2=0,3=1.GL_R32Iβ base typeint; components1; normNO; component slots:0=R,1=0,2=0,3=1.GL_R8UIβ base typeubyte; components1; normNO; component slots:0=R,1=0,2=0,3=1.GL_R16UIβ base typeushort; components1; normNO; component slots:0=R,1=0,2=0,3=1.GL_R32UIβ base typeuint; components1; normNO; component slots:0=R,1=0,2=0,3=1.GL_RG8β base typeubyte; components2; normYES; component slots:0=R,1=G,2=0,3=1.GL_RG16β base typeushort; components2; normYES; component slots:0=R,1=G,2=0,3=1.GL_RG16Fβ base typehalf; components2; normNO; component slots:0=R,1=G,2=0,3=1.GL_RG32Fβ base typefloat; components2; normNO; component slots:0=R,1=G,2=0,3=1.GL_RG8Iβ base typebyte; components2; normNO; component slots:0=R,1=G,2=0,3=1.GL_RG16Iβ base typeshort; components2; normNO; component slots:0=R,1=G,2=0,3=1.GL_RG32Iβ base typeint; components2; normNO; component slots:0=R,1=G,2=0,3=1.GL_RG8UIβ base typeubyte; components2; normNO; component slots:0=R,1=G,2=0,3=1.GL_RG16UIβ base typeushort; components2; normNO; component slots:0=R,1=G,2=0,3=1.GL_RG32UIβ base typeuint; components2; normNO; component slots:0=R,1=G,2=0,3=1.GL_RGB32Fβ base typefloat; components3; normNO; component slots:0=R,1=G,2=B,3=1.GL_RGB32Iβ base typeint; components3; normNO; component slots:0=R,1=G,2=B,3=1.GL_RGB32UIβ base typeuint; components3; normNO; component slots:0=R,1=G,2=B,3=1.GL_RGBA8β base typeuint; components4; normYES; component slots:0=R,1=G,2=B,3=A.GL_RGBA16β base typeshort; components4; normYES; component slots:0=R,1=G,2=B,3=A.GL_RGBA16Fβ base typehalf; components4; normNO; component slots:0=R,1=G,2=B,3=A.GL_RGBA32Fβ base typefloat; components4; normNO; component slots:0=R,1=G,2=B,3=A.GL_RGBA8Iβ base typebyte; components4; normNO; component slots:0=R,1=G,2=B,3=A.GL_RGBA16Iβ base typeshort; components4; normNO; component slots:0=R,1=G,2=B,3=A.GL_RGBA32Iβ base typeint; components4; normNO; component slots:0=R,1=G,2=B,3=A.GL_RGBA8UIβ base typeubyte; components4; normNO; component slots:0=R,1=G,2=B,3=A.GL_RGBA16UIβ base typeushort; components4; normNO; component slots:0=R,1=G,2=B,3=A.GL_RGBA32UIβ base typeuint; components4; normNO; component slots:0=R,1=G,2=B,3=A.
Okay so when a buffer object gets attached to a buffer texture, the buffer object's data store becomes the texture's texel array β like, that's the whole vibe. π«
The number of texels in the buffer texture's texel array is given by:
$$ \left\lfloor {
size \over { components \times sizeof(base\_type) } } \right\rfloor $$
where $size$ is the size of the buffer object in basic machine units (aka the value of GL_BUFFER_SIZE for buffer), and $components$ and $base_type$ are the element count and base data type for elements, exactly as specified in that table up above. π
Then the number of texels in the texel array gets clamped to the value of the implementation-dependent limit GL_MAX_TEXTURE_BUFFER_SIZE. And heads up bestie β when a buffer texture is accessed in a shader, the results of a texel fetch are undefined if the specified texel coordinate is negative, or greater than or equal to the clamped number of texels in the texel array. So likeβ¦ don't do that. π
π ERRORS π
GL_INVALID_ENUMis generated byglTexBufferif target is notGL_TEXTURE_BUFFER.GL_INVALID_OPERATIONis generated byglTextureBufferif texture is not the name of an existing texture object.GL_INVALID_ENUMis generated byglTextureBufferif the effective target of texture is notGL_TEXTURE_BUFFER.GL_INVALID_ENUMis generated if internalformat is not one of the sized internal formats described above.GL_INVALID_OPERATIONis generated if buffer is not zero and is not the name of an existing buffer object.
π ASSOCIATED GETS π
glGet()with argumentGL_MAX_TEXTURE_BUFFER_SIZEglGet()with argumentGL_TEXTURE_BINDING_BUFFERglGetTexLevelParameter()with argumentGL_TEXTURE_BUFFER_DATA_STORE_BINDING
π VERSION SUPPORT π
So the original slaps this in a big grid β imma give you the same tea in list form so nothing gets lost. β¨
glTexBuffer β no cap, here's exactly when it showed up:
- OpenGL 2.0 β
- - OpenGL 2.1 β
- - OpenGL 3.0 β
- - OpenGL 3.1 β
β - OpenGL 3.2 β
β - OpenGL 3.3 β
β - OpenGL 4.0 β
β - OpenGL 4.1 β
β - OpenGL 4.2 β
β - OpenGL 4.3 β
β - OpenGL 4.4 β
β - OpenGL 4.5 β
β
glTextureBuffer β the late bloomer, honestly:
- OpenGL 2.0 β
- - OpenGL 2.1 β
- - OpenGL 3.0 β
- - OpenGL 3.1 β
- - OpenGL 3.2 β
- - OpenGL 3.3 β
- - OpenGL 4.0 β
- - OpenGL 4.1 β
- - OpenGL 4.2 β
- - OpenGL 4.3 β
- - OpenGL 4.4 β
- - OpenGL 4.5 β
β
Lowkey iconic that glTextureBuffer waited until literally 4.5 to make its debut. Main character energy, honestly. π
π«Ά SEE ALSO π«Ά
glGenBuffers()glBindBuffer()glBufferData()glDeleteBuffers()glGenTextures()glBindTexture()glDeleteTextures()
π COPYRIGHT π
Copyright Β© 2010-2014 Khronos Group. This material may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1.0, 8 June 1999. http://opencontent.org/openpub/.
Copyright Β© 2010-2014 Khronos Group
Okay that's the whole page, bestie β you ate that. π
β¨ This one's from the <pink>[FIXME: source]</pink> fam, dated <purple>08/09/2021</purple>, and it answers to the name GLTEXBUFFER(3G) β go forth and texture your buffers responsibly, mwah π¦ππ
π¦ where this page comes from
- centos-stream 9: gl-manpages 1.1-24.20190306.el9 Β· MIT and Open Publication
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms