Class EXTExternalBuffer
Extension EXT_buffer_storage introduced immutable storage buffers to OpenGL ES. This extension allows the data store for an immutable buffer to be
sourced from an external EGLClientBuffer
, allowing sharing of EGL client buffers across APIs, across processes, and across different processing
cores such as the GPU, CPU, and DSP.
Operations can then be performed on the external buffer using standard GL buffer object procedures. The data in the allocation is not copied to the buffer object's data store; the external allocation represents a single memory allocation that can be shared across multiple GL objects -- this aspect is similar to EGL external images. On the other hand, the external buffer does not provide lifetime guarantees including orphaning and sibling behavior as provided by EGL external images.
The EGLClientBuffer
must be allocated in a way which permits this shared access. For example, on Android via a shareable Android hardware
buffer. This extension does not enable support for arbitrary EGLClientBuffers
to be used as an external buffer.
It is the application's responsibility to ensure synchronization between operations performed by separate components (DSP / CPU / GPU) and processes on
the external buffer. Additionally the application is responsible for avoiding violating existing GL spec requirements. For example, mapping a single
shared allocation to two GL buffer objects and then performing CopyBufferSubData
such that the read and write regions overlap would violate the
existing CopyBufferSubData
spec regarding copies performed with the same buffer set for source and destination.
The application must take any steps necessary to ensure memory access to the external buffer behaves as required by the application. For example, preventing compilation differences in data padding from causing data to be inadvertently corrupted by using defined structure alignment methods such as the std140 layout qualifier. The application is responsible for managing the lifetime of the external buffer, ensuring that the external buffer is not deleted as long as there are any GL buffer objects referring to it.
Requires GLES 3.1
and EXT_buffer_storage
.
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
glBufferStorageExternalEXT
(int target, long offset, long size, long clientBuffer, int flags) static void
glNamedBufferStorageExternalEXT
(int buffer, long offset, long size, long clientBuffer, int flags) static void
nglBufferStorageExternalEXT
(int target, long offset, long size, long clientBuffer, int flags) static void
nglNamedBufferStorageExternalEXT
(int buffer, long offset, long size, long clientBuffer, int flags)
-
Method Details
-
nglBufferStorageExternalEXT
public static void nglBufferStorageExternalEXT(int target, long offset, long size, long clientBuffer, int flags) -
glBufferStorageExternalEXT
public static void glBufferStorageExternalEXT(int target, long offset, long size, long clientBuffer, int flags) -
nglNamedBufferStorageExternalEXT
public static void nglNamedBufferStorageExternalEXT(int buffer, long offset, long size, long clientBuffer, int flags) -
glNamedBufferStorageExternalEXT
public static void glNamedBufferStorageExternalEXT(int buffer, long offset, long size, long clientBuffer, int flags)
-