Difference between revisions of "GLAPI/glBindBufferBase"

From OpenGL.org
Jump to: navigation, search
(4.0 API.)
 
(Function Definition)
(11 intermediate revisions by 2 users not shown)
Line 8: Line 8:
 
== Function Definition ==
 
== Function Definition ==
  
   void '''glBindBufferBase'''(GLenum ''target'', GLuint ''index'', GLuint ''buffer'');
+
   void '''glBindBufferBase'''(GLenum {{param|target}}, GLuint {{param|index}}, GLuint {{param|buffer}});
  
; target
+
{{glapi indexbuffertargets}}
: Specify the target of the bind operation. ''target'' must be one of {{code|GL_ATOMIC_COUNTER_BUFFER}}, {{code|GL_TRANSFORM_FEEDBACK_BUFFER}} or {{code|GL_UNIFORM_BUFFER}}.
+
 
; index
 
; index
: Specify the index of the binding point within the array specified by ''target''.
+
: Specify the index of the binding point within the array specified by {{param|target}}.
 
; buffer
 
; buffer
 
: The name of a buffer object to bind to the specified binding point.
 
: The name of a buffer object to bind to the specified binding point.
Line 19: Line 18:
 
== Description ==
 
== 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 [[GLAPI/glBindBuffer|glBindBuffer]] or [[GLAPI/glMapBuffer|glMapBuffer]]. In addition to binding ''buffer'' to the indexed buffer binding target, '''glBindBufferBase''' also binds ''buffer'' to the generic buffer binding point specified by ''target''.
+
'''glBindBufferBase''' binds the buffer object {{param|buffer}} to the binding point at index {{param|index}} of the array of targets specified by {{param|target}}. Each {{param|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 {{apifunc|glBindBuffer}} or {{apifunc|glMapBuffer}}. In addition to binding {{param|buffer}} to the indexed buffer binding target, '''glBindBufferBase''' also binds {{param|buffer}} to the generic buffer binding point specified by {{param|target}}.
  
 
== Notes ==
 
== Notes ==
  
Calling '''glBindBufferBase''' is equivalent to calling [[GLAPI/glBindBufferRange|glBindBufferRange]] with ''offset'' zero and ''size'' equal to the size of the buffer.
+
Calling '''glBindBufferBase''' is equivalent to calling {{apifunc|glBindBufferRange}} with {{param|offset}} zero and {{param|size}} equal to the size of the buffer.
 +
 
 +
The {{enum|GL_ATOMIC_COUNTER_BUFER}} target is available only if the GL version is 4.2 or greater.
 +
 
 +
The {{enum|GL_SHADER_STORAGE_BUFFER}} target is available only if the GL version is 4.3 or greater.
  
 
== Errors ==
 
== Errors ==
  
{{code|GL_INVALID_ENUM}} is generated if ''target'' is not {{code|GL_ATOMIC_COUNTER_BUFFER}}, {{code|GL_TRANSFORM_FEEDBACK_BUFFER}} or {{code|GL_UNIFORM_BUFFER}}.
+
{{enum|GL_INVALID_ENUM}} is generated if {{param|target}} is not {{enum|GL_ATOMIC_COUNTER_BUFFER}}, {{enum|GL_TRANSFORM_FEEDBACK_BUFFER}}, {{enum|GL_UNIFORM_BUFFER}} or {{enum|GL_SHADER_STORAGE_BUFFER}}.
  
{{code|GL_INVALID_VALUE}} is generated if ''index'' is greater than or equal to the number of ''target''-specific indexed binding points.
+
{{enum|GL_INVALID_VALUE}} is generated if {{param|index}} is greater than or equal to the number of {{param|target}}-specific indexed binding points.
  
{{code|GL_INVALID_VALUE}} is generated if ''buffer'' does not have an associated data store, or if the size of that store is zero.
+
{{enum|GL_INVALID_VALUE}} is generated if {{param|buffer}} does not have an associated data store, or if the size of that store is zero.
  
 
== See Also ==
 
== See Also ==
  
[[GLAPI/glGenBuffers|glGenBuffers]], [[GLAPI/glDeleteBuffers|glDeleteBuffers]], [[GLAPI/glBindBuffer|glBindBuffer]], [[GLAPI/glBindBufferRange|glBindBufferRange]], [[GLAPI/glMapBuffer|glMapBuffer]], [[GLAPI/glUnmapBuffer|glUnmapBuffer]],
+
{{apifunc|glGenBuffers}}, {{apifunc|glDeleteBuffers}}, {{apifunc|glIsBuffer}}, {{apifunc|glBindBufferRange}}, {{apifunc|glBindBuffer}}
  
 
== Copyright ==
 
== Copyright ==
Line 41: Line 44:
 
Copyright © 2010-2011 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/ http://opencontent.org/openpub/].
 
Copyright © 2010-2011 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/ http://opencontent.org/openpub/].
  
[[Category:API Reference 4]]
+
[[Category:Core API Ref Buffer Objects|BindBufferBase]]
 +
[[Category:Core API Reference|BindBufferBase]]

Revision as of 10:48, 6 September 2012

glBindBufferBase
Core in version 4.5
Core since version 3.0

glBindBufferBase: bind a buffer object to an indexed buffer target

Function Definition

 void glBindBufferBase(GLenum target​, GLuint index​, GLuint buffer​);
target
Specifies the target buffer object. The symbolic constant must be GL_ATOMIC_COUNTER_BUFFER, GL_TRANSFORM_FEEDBACK_BUFFER, GL_UNIFORM_BUFFER or GL_SHADER_STORAGE_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 glMapBuffer. 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 is equivalent to calling glBindBufferRange with offset​ zero and size​ equal to the size of the buffer.

The GL_ATOMIC_COUNTER_BUFER target is available only if the GL version is 4.2 or greater.

The GL_SHADER_STORAGE_BUFFER target is available only if the GL version is 4.3 or greater.

Errors

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

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

GL_INVALID_VALUE is generated if buffer​ does not have an associated data store, or if the size of that store is zero.

See Also

glGenBuffers, glDeleteBuffers, glIsBuffer, glBindBufferRange, glBindBuffer

Copyright

Copyright © 2010-2011 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/.