Light | Dark

# docs.GL

OpenGL 4
OpenGL 3
OpenGL ES 3

# glBindBufferBase

## Name

glBindBufferBase — bind a buffer object to an indexed buffer target

## C Specification

`void glBindBufferBase(` | GLenum target,
| GLuint index,
| GLuint buffer`)`;

## Parameters

`target`

  Specify the target of the bind operation. `target` must be one of `GL_ATOMIC_COUNTER_BUFFER`, `GL_SHADER_STORAGE_BUFFER`, `GL_TRANSFORM_FEEDBACK_BUFFER` or `GL_UNIFORM_BUFFER`.

`index`

  Specify the index of the binding point within the array specified by `target`.

`buffer`

  The name of a buffer object to bind to the specified binding point.

## Description

`glBindBufferBase` binds the buffer object `buffer` to the binding point at index `index` of the array of targets specified by `target`. Each `target` represents an indexed array of buffer binding points, as well as a single general binding point that can be used by other buffer manipulation functions such as glBindBuffer or glMapBufferRange. In addition to binding `buffer` to the indexed buffer binding target, `glBindBufferBase` also binds `buffer` to the generic buffer binding point specified by `target`.

## Notes

Calling `glBindBufferBase` binds the entire buffer, even when the size of the buffer is changed after the binding is established. The starting offset is zero, and the amount of data that can be read from or written to the buffer is determined by the size of the bound buffer at the time the binding is used.

The `GL_ATOMIC_COUNTER_BUFFER` and `GL_SHADER_STORAGE_BUFFER` targets are available only if the GL ES version is 3.1 or greater.

## Errors

`GL_INVALID_ENUM` is generated if `target` is not `GL_ATOMIC_COUNTER_BUFFER`, `GL_SHADER_STORAGE_BUFFER`, `GL_TRANSFORM_FEEDBACK_BUFFER` or `GL_UNIFORM_BUFFER`.

`GL_INVALID_VALUE` is generated if `index` is greater than or equal to the number of `target`-specific indexed binding points.

## Associated Gets

glGet with argument `GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS`, `GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS`, `GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS` or `GL_MAX_UNIFORM_BUFFER_BINDINGS`.

## Tutorials

## API Version Support

| OpenGL ES API Version
--- | ---
Function Name | 2.0 | 3.0 | 3.1
glBindBufferBase | - | ✔ | ✔

## See Also

glGenBuffers, glDeleteBuffers, glBindBuffer, glBindBufferRange, glMapBufferRange, glUnmapBuffer,

## 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. https://opencontent.org/openpub/.

Think you can improve this page? Edit this page on GitHub.