GLFLUSHMAPPEDBUFFERR(3G)

🌸 NAME 🌸

okay bestie, welcome to the 3G manual page for glFlushMappedBufferRange and glFlushMappedNamedBufferRange β€” the two functions that indicate modifications to a range of a mapped buffer. yes, that's the whole assignment πŸ’–


✨ C SPECIFICATION ✨

void glFlushMappedBufferRange(GLenum target, GLintptr offset,
                              GLsizeiptr length);

void glFlushMappedNamedBufferRange(GLuint buffer, GLintptr offset,
                                   GLsizeiptr length);

πŸŽ€ PARAMETERS πŸŽ€

  • target β€” Specifies the target to which the buffer object is bound for glFlushMappedBufferRange, which must be one of the buffer binding targets in the following table:
    • 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 β€” Specifies the name of the buffer object for glFlushMappedNamedBufferRange. yes, this is the named-buffer bestie πŸ’…
  • offset β€” Specifies the start of the buffer subrange, in basic machine units.
  • length β€” Specifies the length of the buffer subrange, in basic machine units.

πŸ’« DESCRIPTION πŸ’«

okay so glFlushMappedBufferRange indicates that modifications have been made to a range of a mapped buffer object. The buffer object must previously have been mapped with the GL_MAP_FLUSH_EXPLICIT_BIT flag. no cap, that flag is literally required.

offset and length indicate the modified subrange of the mapping, in basic machine units. The specified subrange to flush is relative to the start of the currently mapped range of the buffer. These commands may be called multiple times to indicate distinct subranges of the mapping which require flushing. yes, you can hit it again and again for different subranges β€” it's giving efficient πŸ’–

If a buffer range is mapped with both GL_MAP_PERSISTENT_BIT and GL_MAP_FLUSH_EXPLICIT_BIT set, then these commands may be called to ensure that data written by the client into the flushed region becomes visible to the server. Data written to a coherent store will always become visible to the server after an unspecified period of time. that last part is the "eventually, not instantly" vibe, iykyk πŸ¦‹


πŸ¦‹ NOTES πŸ¦‹

  • 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 πŸ’€

bestie, these are the red flags 🚩

  • GL_INVALID_ENUM is generated by glFlushMappedBufferRange if target is not one of the buffer binding targets listed above.
  • GL_INVALID_OPERATION is generated by glFlushMappedBufferRange if zero is bound to target.
  • GL_INVALID_OPERATION is generated by glFlushMappedNamedBufferRange if buffer is not the name of an existing buffer object.
  • GL_INVALID_VALUE is generated if offset or length is negative, or if offset + length exceeds the size of the mapping.
  • GL_INVALID_OPERATION is generated if the buffer object is not mapped, or is mapped without the GL_MAP_FLUSH_EXPLICIT_BIT flag.

πŸ‘‘ VERSION SUPPORT πŸ‘‘

here's the vibe check across OpenGL versions, bestie ✨

  • 2.0: glFlushMappedBufferRange β€” -; glFlushMappedNamedBufferRange β€” -
  • 2.1: glFlushMappedBufferRange β€” -; glFlushMappedNamedBufferRange β€” -
  • 3.0: glFlushMappedBufferRange β€” βœ”; glFlushMappedNamedBufferRange β€” -
  • 3.1: glFlushMappedBufferRange β€” βœ”; glFlushMappedNamedBufferRange β€” -
  • 3.2: glFlushMappedBufferRange β€” βœ”; glFlushMappedNamedBufferRange β€” -
  • 3.3: glFlushMappedBufferRange β€” βœ”; glFlushMappedNamedBufferRange β€” -
  • 4.0: glFlushMappedBufferRange β€” βœ”; glFlushMappedNamedBufferRange β€” -
  • 4.1: glFlushMappedBufferRange β€” βœ”; glFlushMappedNamedBufferRange β€” -
  • 4.2: glFlushMappedBufferRange β€” βœ”; glFlushMappedNamedBufferRange β€” -
  • 4.3: glFlushMappedBufferRange β€” βœ”; glFlushMappedNamedBufferRange β€” -
  • 4.4: glFlushMappedBufferRange β€” βœ”; glFlushMappedNamedBufferRange β€” -
  • 4.5: glFlushMappedBufferRange β€” βœ”; glFlushMappedNamedBufferRange β€” βœ”

🌈 SEE ALSO 🌈

  • glMapBufferRange()
  • glMapBuffer()
  • glUnmapBuffer()

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


alright bestie, that's the page πŸ’… this was GLFLUSHMAPPEDBUFFERR(3G) from [FIXME: source], dated 08/09/2021. mwah 🫢

πŸ“¦ where this page comes from