Top Description Fields Constructors Methods
org.lwjgl.opengl

public Class ARBMapBufferRange

extends Object
Class Inheritance
Imports
javax.annotation.*, java.nio.*, org.lwjgl.system.*

Native bindings to the ARB_map_buffer_range extension.

ARB_map_buffer_range expands the buffer object API to allow greater performance when a client application only needs to write to a sub-range of a buffer object. To that end, this extension introduces two new buffer object features: non-serialized buffer modification and explicit sub-range flushing for mapped buffer objects.

OpenGL requires that commands occur in a FIFO manner meaning that any changes to buffer objects either block until the data has been processed by the OpenGL pipeline or else create extra copies to avoid such a block. By providing a method to asynchronously modify buffer object data, an application is then able to manage the synchronization points themselves and modify ranges of data contained by a buffer object even though OpenGL might still be using other parts of it.

This extension also provides a method for explicitly flushing ranges of a mapped buffer object so OpenGL does not have to assume that the entire range may have been modified. Further, it allows the application to more precisely specify its intent with respect to reading, writing, and whether the previous contents of a mapped range of interest need be preserved prior to modification.

Requires OpenGL 2.1. Promoted to core in OpenGL 3.0.

Field Summary

Modifier and TypeField and Description
public static final int
GL_MAP_FLUSH_EXPLICIT_BIT

Accepted by the access parameter of MapBufferRange.

public static final int
GL_MAP_INVALIDATE_BUFFER_BIT

Accepted by the access parameter of MapBufferRange.

public static final int
GL_MAP_INVALIDATE_RANGE_BIT

Accepted by the access parameter of MapBufferRange.

public static final int
GL_MAP_READ_BIT

Accepted by the access parameter of MapBufferRange.

public static final int
GL_MAP_UNSYNCHRONIZED_BIT

Accepted by the access parameter of MapBufferRange.

public static final int
GL_MAP_WRITE_BIT

Accepted by the access parameter of MapBufferRange.

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public static void
glFlushMappedBufferRange(int target, long
the start of the buffer subrange, in basic machine units
offset
,
long
the length of the buffer subrange, in basic machine units
length
)

Indicates modifications to a range of a mapped buffer.

public static ByteBuffer
glMapBufferRange(int target, long
the starting offset within the buffer of the range to be mapped
offset
,
long
the length of the range to be mapped
length
,
int
a combination of access flags indicating the desired access to the range. One or more of:
MAP_READ_BITMAP_WRITE_BITMAP_INVALIDATE_RANGE_BITMAP_INVALIDATE_BUFFER_BIT
MAP_FLUSH_EXPLICIT_BITMAP_UNSYNCHRONIZED_BIT
access
)

Maps a section of a buffer object's data store.

public static ByteBuffer
glMapBufferRange(int target, long
the starting offset within the buffer of the range to be mapped
offset
,
long
the length of the range to be mapped
length
,
int
a combination of access flags indicating the desired access to the range. One or more of:
MAP_READ_BITMAP_WRITE_BITMAP_INVALIDATE_RANGE_BITMAP_INVALIDATE_BUFFER_BIT
MAP_FLUSH_EXPLICIT_BITMAP_UNSYNCHRONIZED_BIT
access
,
ByteBuffer old_buffer)

Maps a section of a buffer object's data store.

public static long
nglMapBufferRange(int target, long offset, long length, int access)

Unsafe version of: MapBufferRange

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

GL_MAP_FLUSH_EXPLICIT_BITback to summary
public static final int GL_MAP_FLUSH_EXPLICIT_BIT

Accepted by the access parameter of MapBufferRange.

GL_MAP_INVALIDATE_BUFFER_BITback to summary
public static final int GL_MAP_INVALIDATE_BUFFER_BIT

Accepted by the access parameter of MapBufferRange.

GL_MAP_INVALIDATE_RANGE_BITback to summary
public static final int GL_MAP_INVALIDATE_RANGE_BIT

Accepted by the access parameter of MapBufferRange.

GL_MAP_READ_BITback to summary
public static final int GL_MAP_READ_BIT

Accepted by the access parameter of MapBufferRange.

GL_MAP_UNSYNCHRONIZED_BITback to summary
public static final int GL_MAP_UNSYNCHRONIZED_BIT

Accepted by the access parameter of MapBufferRange.

GL_MAP_WRITE_BITback to summary
public static final int GL_MAP_WRITE_BIT

Accepted by the access parameter of MapBufferRange.

Constructor Detail

ARBMapBufferRangeback to summary
protected ARBMapBufferRange()

Method Detail

glFlushMappedBufferRangeback to summary
public static void glFlushMappedBufferRange(int target, long offset, long length)

Indicates modifications to a range of a mapped buffer.

Parameters
target:int

the target of the flush operation. One of:

ARRAY_BUFFERELEMENT_ARRAY_BUFFERPIXEL_PACK_BUFFERPIXEL_UNPACK_BUFFER
TRANSFORM_FEEDBACK_BUFFERUNIFORM_BUFFERTEXTURE_BUFFERCOPY_READ_BUFFER
COPY_WRITE_BUFFERDRAW_INDIRECT_BUFFERATOMIC_COUNTER_BUFFERDISPATCH_INDIRECT_BUFFER
SHADER_STORAGE_BUFFERPARAMETER_BUFFER_ARB
offset:long

the start of the buffer subrange, in basic machine units

length:long

the length of the buffer subrange, in basic machine units

glMapBufferRangeback to summary
public static ByteBuffer glMapBufferRange(int target, long offset, long length, int access)

Maps a section of a buffer object's data store.

LWJGL note: This method comes in 2 flavors:

  1. glMapBufferRange(int, long, long, int) - Always returns a new ByteBuffer instance.
  2. glMapBufferRange(int, long, long, int, ByteBuffer) - The old_buffer parameter is reused if not null.
Parameters
target:int

a binding to which the target buffer is bound. One of:

ARRAY_BUFFERELEMENT_ARRAY_BUFFERPIXEL_PACK_BUFFERPIXEL_UNPACK_BUFFER
TRANSFORM_FEEDBACK_BUFFERUNIFORM_BUFFERTEXTURE_BUFFERCOPY_READ_BUFFER
COPY_WRITE_BUFFERDRAW_INDIRECT_BUFFERATOMIC_COUNTER_BUFFERDISPATCH_INDIRECT_BUFFER
SHADER_STORAGE_BUFFERPARAMETER_BUFFER_ARB
offset:long

the starting offset within the buffer of the range to be mapped

length:long

the length of the range to be mapped

access:int

a combination of access flags indicating the desired access to the range. One or more of:

MAP_READ_BITMAP_WRITE_BITMAP_INVALIDATE_RANGE_BITMAP_INVALIDATE_BUFFER_BIT
MAP_FLUSH_EXPLICIT_BITMAP_UNSYNCHRONIZED_BIT
Annotations
@Nullable
@NativeType:void *
glMapBufferRangeback to summary
public static ByteBuffer glMapBufferRange(int target, long offset, long length, int access, ByteBuffer old_buffer)

Maps a section of a buffer object's data store.

LWJGL note: This method comes in 2 flavors:

  1. glMapBufferRange(int, long, long, int) - Always returns a new ByteBuffer instance.
  2. glMapBufferRange(int, long, long, int, ByteBuffer) - The old_buffer parameter is reused if not null.
Parameters
target:int

a binding to which the target buffer is bound. One of:

ARRAY_BUFFERELEMENT_ARRAY_BUFFERPIXEL_PACK_BUFFERPIXEL_UNPACK_BUFFER
TRANSFORM_FEEDBACK_BUFFERUNIFORM_BUFFERTEXTURE_BUFFERCOPY_READ_BUFFER
COPY_WRITE_BUFFERDRAW_INDIRECT_BUFFERATOMIC_COUNTER_BUFFERDISPATCH_INDIRECT_BUFFER
SHADER_STORAGE_BUFFERPARAMETER_BUFFER_ARB
offset:long

the starting offset within the buffer of the range to be mapped

length:long

the length of the range to be mapped

access:int

a combination of access flags indicating the desired access to the range. One or more of:

MAP_READ_BITMAP_WRITE_BITMAP_INVALIDATE_RANGE_BITMAP_INVALIDATE_BUFFER_BIT
MAP_FLUSH_EXPLICIT_BITMAP_UNSYNCHRONIZED_BIT
Annotations
@Nullable
@NativeType:void *
nglMapBufferRangeback to summary
public static long nglMapBufferRange(int target, long offset, long length, int access)

Unsafe version of: MapBufferRange