glNamedBufferData

glBufferData: man4/glBufferData.xml

glBufferData and glNamedBufferData create a new data store for a buffer object. In case of glBufferData, the buffer object currently bound to target is used. For glNamedBufferData, a buffer object associated with ID specified by the caller in buffer will be used instead. While creating the new storage, any pre-existing data store is deleted. The new data store is created with the specified size in bytes and usage. If data is not null, the data store is initialized with data from this pointer. In its initial state, the new data store is not mapped, it has a null mapped pointer, and its mapped access is GL_READ_WRITE. usage is a hint to the GL implementation as to how a buffer object's data store will be accessed. This enables the GL implementation to make more intelligent decisions that may significantly impact buffer object performance. It does not, however, constrain the actual usage of the data store. usage can be broken down into two parts: first, the frequency of access (modification and usage), and second, the nature of that access. The frequency of access may be one of these: The nature of access may be one of these:

If data is null, a data store of the specified size is still created, but its contents remain uninitialized and thus undefined. Clients must align data elements consistently with the requirements of the client platform, with an additional base-level requirement that an offset within a buffer to a datum comprising N bytes be a multiple of N. 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.

@OpenGL_Version(OGLIntroducedIn.V4P5)
@OpenGL_Extension("GL_ARB_direct_state_access")
fn_glNamedBufferData glNamedBufferData;

See Also

glBindBuffer, glBufferSubData, glMapBuffer, glUnmapBuffer

Meta