Previous: glStencilOpSeparate Table of Contents (GL) Next: glTexBufferRange

glTexBuffer

attach the storage for a buffer object to the active buffer texture

Signature

glTexBuffer( GLenum ( target ) , GLenum ( internalFormat ) , Gluint( buffer ) )-> void
glTexBuffer( target , internalformat , buffer )

Parameters

VariablesDescription
target
Specifies the target of the operation and must be GL_TEXTURE_BUFFER .
internalFormat
Specifies the internal format of the data in the store belonging to buffer .
buffer
Specifies the name of the buffer object whose storage to attach to the active buffer texture.

Description

glTexBuffer attaches the storage for the buffer object named buffer to the active buffer texture, and specifies the internal format for the texel array found in the attached buffer object. 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. target must be GL_TEXTURE_BUFFER . internalformat specifies the storage format, and must be one of the following sized internal formats:
Component
Sized Internal Format Base Type Components Norm 0123
GL_R8 ubyte1YESR001
GL_R16 ushort1YESR001
GL_R16F half1NOR001
GL_R32F float1NOR001
GL_R8I byte1NOR001
GL_R16I short1NOR001
GL_R32I int1NOR001
GL_R8UI ubyte1NOR001
GL_R16UI ushort1NOR001
GL_R32UI uint1NOR001
GL_RG8 ubyte2YESRG01
GL_RG16 ushort2YESRG01
GL_RG16F half2NORG01
GL_RG32F float2NORG01
GL_RG8I byte2NORG01
GL_RG16I short2NORG01
GL_RG32I int2NORG01
GL_RG8UI ubyte2NORG01
GL_RG16UI ushort2NORG01
GL_RG32UI uint2NORG01
GL_RGB32F float3NORGB1
GL_RGB32I int3NORGB1
GL_RGB32UI uint3NORGB1
GL_RGBA8 uint4YESRGBA
GL_RGBA16 short4YESRGBA
GL_RGBA16F half4NORGBA
GL_RGBA32F float4NORGBA
GL_RGBA8I byte4NORGBA
GL_RGBA16I short4NORGBA
GL_RGBA32I int4NORGBA
GL_RGBA8UI ubyte4NORGBA
GL_RGBA16UI ushort4NORGBA
GL_RGBA32UI uint4NORGBA
When a buffer object is attached to a buffer texture, the buffer object's data store is taken as the texture's texel array. The number of texels in the buffer texture's texel array is given by
buffer_size
components
×
sizeof
(
base_type
)
where buffer_size is the size of the buffer object, in basic machine units and components and base type are the element count and base data type for elements, as specified in the table above. The number of texels in the texel array is then clamped to the implementation-dependent limit GL_MAX_TEXTURE_BUFFER_SIZE . 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.

Errors

GL_INVALID_ENUM is generated if target is not GL_TEXTURE_BUFFER .
GL_INVALID_ENUM is generated if internalFormat is not one of the accepted tokens.
GL_INVALID_OPERATION is generated if buffer is not zero or the name of an existing buffer object.

Notes

glTexBuffer is available only if the GL version is 3.1 or greater.

Associated Gets

glGet with argument GL_MAX_TEXTURE_BUFFER_SIZE
glGet with argument GL_TEXTURE_BINDING_BUFFER
glGetTexLevelParameter with argument GL_TEXTURE_BUFFER_DATA_STORE_BINDING

See Also

Sample Code References

The following code samples have been found which appear to reference the functions described here. Take care that the code may be old, broken or not even use PyOpenGL.

glTexBuffer
OpenGLContext OpenGLContext/scenegraph/shaders.py Lines: 252

MathML Rendering

Powered by MathJax
Previous: glStencilOpSeparate Table of Contents (GL) Next: glTexBufferRange