GLGETBUFFERPARAMETER(3G)

🌈 NAME 🌈

okay so this is the GLGETBUFFERPARAMETER page from manual section 3G β€” and yes, the header has [FIXME: manual] just chilling there, we are honoring the chaos. The function squad is:

  • glGetBufferParameteriv
  • glGetBufferParameteri64v
  • glGetNamedBufferParameteriv
  • glGetNamedBufferParameteri64v

and their whole collective job is: return parameters of a buffer object. periodt. πŸ’…


✨ C SPECIFICATION ✨

okay bestie, here are the exact signatures, no cap:

       void glGetBufferParameteriv(GLenum target, GLenum value, GLint * data);

       void glGetBufferParameteri64v(GLenum target, GLenum value,
                                     GLint64 * data);

       void glGetNamedBufferParameteriv(GLuint buffer, GLenum pname,
                                        GLint *params);

       void glGetNamedBufferParameteri64v(GLuint buffer, GLenum pname,
                                          GLint64 *params);

πŸŽ€ PARAMETERS πŸŽ€

  • target β€” this is where you point for glGetBufferParameteriv and glGetBufferParameteri64v. It has to be one of the buffer binding targets in this list:
    • GL_ARRAY_BUFFER β€” Vertex attributes
    • GL_ATOMIC_COUNTER_BUFFER β€” Atomic counter storage
    • GL_COPY_READ_BUFFER β€” Buffer copy source
    • GL_COPY_WRITE_BUFFER β€” Buffer copy destination
    • GL_DISPATCH_INDIRECT_BUFFER β€” Indirect compute dispatch commands
    • GL_DRAW_INDIRECT_BUFFER β€” Indirect command arguments
    • GL_ELEMENT_ARRAY_BUFFER β€” Vertex array indices
    • GL_PIXEL_PACK_BUFFER β€” Pixel read target
    • GL_PIXEL_UNPACK_BUFFER β€” Texture data source
    • GL_QUERY_BUFFER β€” Query result buffer
    • GL_SHADER_STORAGE_BUFFER β€” Read-write storage for shaders
    • GL_TEXTURE_BUFFER β€” Texture data buffer
    • GL_TRANSFORM_FEEDBACK_BUFFER β€” Transform feedback buffer
    • GL_UNIFORM_BUFFER β€” Uniform block storage
  • buffer β€” the name of the buffer object for glGetNamedBufferParameteriv and glGetNamedBufferParameteri64v. lowkey the named-function bestie.
  • value β€” the name of the buffer object parameter to query.
  • data β€” where the requested parameter gets returned. 🫢

πŸ’œ DESCRIPTION πŸ’œ

These functions return in data a selected parameter of the specified buffer object. Like, you ask, they hand it over.

Tiny heads-up: PARAMETERS called this value, and right here the page says pname β€” both names are staying because that is literally what the page says. πŸ™ˆ

pname names a specific buffer object parameter, and here is the whole menu:

  • GL_BUFFER_ACCESS β€” params returns the access policy set while mapping the buffer object β€” the value of the access parameter enum passed to glMapBuffer. If the buffer was mapped with glMapBufferRange, the access policy is determined by translating the bits in that access parameter to one of the supported enums for glMapBuffer, as described in the OpenGL Specification.
  • GL_BUFFER_ACCESS_FLAGS β€” params returns the access policy set while mapping the buffer object β€” the value of the access parameter bitfield passed to glMapBufferRange. If the buffer was mapped with glMapBuffer, the access policy is determined by translating the enums in that access parameter to the corresponding bits for glMapBufferRange, as described in the OpenGL Specification. The initial value is zero.
  • GL_BUFFER_IMMUTABLE_STORAGE β€” params returns a boolean flag indicating whether the buffer object is immutable. The initial value is GL_FALSE.
  • GL_BUFFER_MAPPED β€” params returns a flag indicating whether the buffer object is currently mapped. The initial value is GL_FALSE.
  • GL_BUFFER_MAP_LENGTH β€” params returns the length of the mapping into the buffer object established with glMapBuffer*. The i64v versions of these queries should be used for this parameter. The initial value is zero.
  • GL_BUFFER_MAP_OFFSET β€” params returns the offset of the mapping into the buffer object established with glMapBuffer*. The i64v versions of these queries should be used for this parameter. The initial value is zero.
  • GL_BUFFER_SIZE β€” params returns the size of the buffer object, measured in bytes. The initial value is 0.
  • GL_BUFFER_STORAGE_FLAGS β€” params returns a bitfield indicating the storage flags for the buffer object. If the buffer object is immutable, the value returned will be that specified when the data store was established with glBufferStorage. If the data store was established with glBufferData, the value will be GL_MAP_READ_BIT | GL_MAP_WRITE_BIT | GL_DYNAMIC_STORAGE_BIT | GL_MAP_WRITE_BIT β€” yes, GL_MAP_WRITE_BIT really shows up twice in that expression, and we are not editing it. The initial value is zero.
  • GL_BUFFER_USAGE β€” params returns the buffer object's usage pattern. The initial value is GL_STATIC_DRAW.

🌸 NOTES 🌸

  • If an error is generated, no change is made to the contents of data. fr fr.
  • The GL_ATOMIC_COUNTER_BUFFER target is available only if the GL version is 4.2 or greater.
  • The GL_DISPATCH_INDIRECT_BUFFER and GL_SHADER_STORAGE_BUFFER targets are available only if the GL version is 4.3 or greater.
  • The GL_QUERY_BUFFER target is available only if the GL version is 4.4 or greater.

πŸ”₯ ERRORS πŸ”₯

  • GL_INVALID_ENUM is generated by glGetBufferParameter* if target is not one of the accepted buffer targets.
  • GL_INVALID_OPERATION is generated by glGetBufferParameter* if zero is bound to target.
  • GL_INVALID_OPERATION is generated by glGetNamedBufferParameter* if buffer is not the name of an existing buffer object.
  • GL_INVALID_ENUM is generated if pname is not one of the buffer object parameter names described above.

✨ VERSION SUPPORT ✨

okay bestie, this is the OpenGL Version vibe check for every Function / Feature Name, fr fr. βœ” means it’s in that version, and - means it’s a no-show there. No cap, every single cell is accounted for:

  • glGetBufferParameteri64v β€” 2.0 -, 2.1 -, 3.0 -, 3.1 -, 3.2 βœ”, 3.3 βœ”, 4.0 βœ”, 4.1 βœ”, 4.2 βœ”, 4.3 βœ”, 4.4 βœ”, 4.5 βœ”.
  • glGetBufferParameteriv β€” 2.0 βœ”, 2.1 βœ”, 3.0 βœ”, 3.1 βœ”, 3.2 βœ”, 3.3 βœ”, 4.0 βœ”, 4.1 βœ”, 4.2 βœ”, 4.3 βœ”, 4.4 βœ”, 4.5 βœ”. literally all of them, periodt πŸ’…
  • glGetNamedBufferParameteri64v β€” 2.0 -, 2.1 -, 3.0 -, 3.1 -, 3.2 -, 3.3 -, 4.0 -, 4.1 -, 4.2 -, 4.3 -, 4.4 -, 4.5 βœ”.
  • glGetNamedBufferParameteriv β€” 2.0 -, 2.1 -, 3.0 -, 3.1 -, 3.2 -, 3.3 -, 4.0 -, 4.1 -, 4.2 -, 4.3 -, 4.4 -, 4.5 βœ”.

🌸 SEE ALSO 🌸

bestie, go peek at these too, they’re all part of the same friend group 🫢

  • glBindBuffer()
  • glBufferData()
  • glGetBufferPointerv()
  • glMapBuffer()
  • glUnmapBuffer()

legal bestie moment, keeping it exact:

  • Copyright Β© 2005 Addison-Wesley.
  • 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/

and here’s the second COPYRIGHT block, because the page said so πŸ’€

  • Copyright Β© 2005 Sams Publishing
  • Copyright Β© 2010-2014 Khronos Group

okay that’s the whole page, bestie πŸ’…βœ¨ source: [FIXME: source], version: GLGETBUFFERPARAMETER(3G), date: 08/09/2021. go be iconic with your buffers πŸ«ΆπŸ’–

πŸ“¦ where this page comes from