Interface IGlImage
interface IGlImage
Extends com.amazon.apmf.IStandard
Interface that abstracts a GLES image which uses IBufferGroup as it’s backing store.
Methods
attachToCurrentContext()
Attaches the image to the calling thread’s current context using the provided information and moves the image to “attached” state. Should only be called if image is in “detached” state.voidattachToCurrentContext(u64tex_name,u64tex_target,u64active_tex_unit)
Parameters
tex_name
u64 — Required
GLES texture object name to be used
tex_target
u64 — Required
texture target to be used
active_tex_unit
u64 — Required
GLES active texture unit to be used
Throws
DeviceError— if gpu device is not in valid stateInvalidArgumentError— if any input argument is invalidInvalidOperationError— if no context is bound to the calling thread or image is not in “detached” state.OutOfMemoryError— if device is out of memory
detachFromContext()
void detachFromContext()
Detaches the image from the calling thread’s current context and move it to “detached” state.
Should only be called if image is in “attached” state and the current context is same as the one
when attachToContext() was called.
Throws
DeviceError— if gpu device is not in valid stateInvalidOperationError— if different context is bound to the calling thread or image is not in “attached” state.OutOfMemoryError— if device is out of memory
bindBuffer()
Binds the buffer as the backing store of the image. Can only be called when image is in “attached” state and the same context is bound to the current thread.voidbindBuffer(com.amazon.kepler.buffer.IBufferGroup*buffer_group)
Parameters
buffer_group
com.amazon.kepler.buffer.IBufferGroup* — Required
buffer to be set as the backing store of the image.
Throws
DeviceError— if gpu device is not in valid stateInvalidArgumentError— if any input argument is invalidInvalidOperationError— if different context is bound to the calling thread or image is not in “attached” state.OutOfMemoryError— if device is out of memory
unbindCurrentBuffer()
void unbindCurrentBuffer()
Unbinds the currently bound buffer from the image. Make sure, all operations on this
image is completed before calling this function. bindBuffer() must be called after calling
unbindCurrentBuffer() before client can use this image again for an operation.
Throws
DeviceError— if gpu device is not in valid stateInvalidOperationError— if different context is bound to the calling thread or image doesn’t have a backing buffer or it is not in “attached” state.

