Interface IGpuDevice
interface IGpuDevice
Extends com.amazon.apmf.IStandard
3D display render device
Methods
createContextConfig()
Creates a context config object based on the provided attributes for the context configuration. System would try it’s best to create a config closely matching the attributes.IContextConfig*createContextConfig(ContextConfigAttributes*contextConfigAttributes)
Parameters
contextConfigAttributes
ContextConfigAttributes* — Required
The context config attribute object representing the set of client preferred
attributes.
Returns
IContextConfig*
IContextConfig configuration object closely matching the attributes.
Throws
DeviceError— if IGpuDevice is not in valid stateInvalidArgumentError— if contextConfigAttributes is not a valid one or if native config attributes couldn’t be supported.OutOfMemoryError— if device is out of memory
createContext()
Creates rendering context and optionally take another context and treat both of them belonging to the same shared group.IContext*createContext(IContext?sharedContext,IContextConfig?contextConfig)
Parameters
sharedContext
IContext? — Optional
The shared context, could be null as well if this is not a shared context.
contextConfig
IContextConfig? — Optional
The desired context configuration, could be null as well if this is a shared context
in which case, the same context configuration of the shared context will be used. If sharedContext
is null, contextConfig has to be valid object.
Returns
IContext*
Created context
Throws
DeviceError— if IGpuDevice is not in valid stateInvalidArgumentError— if sharedContext is not a valid one.OutOfMemoryError— if device is out of memory
createScreenSurface()
Creates on screen rendering surface for the rendering API supported by the GPU and compatible with window.IGraphicsSurface*createScreenSurface(i64windowSharedHandle,IContextConfig*contextConfig)
Parameters
windowSharedHandle
i64 — Required
Handle of the window which the surface will
be associated with
contextConfig
IContextConfig* — Required
The desired context configuration to be used for surface creation. Please note,
this has to be same or compatible with the IContextConfig of the IContext which would potentially
use this surface when calling IContext#makeCurrent().
Returns
IGraphicsSurface*
The created rendering surface
Throws
DeviceError— if IGpuDevice is not in valid stateNullPointerError— if any input argument is null pointer while a non-null one is expectedInvalidArgumentError— if any input argument is invalidOutOfMemoryError— if device is out of memory
createOffscreenSurface()
Creates off screen surfaceIGraphicsSurface*createOffscreenSurface(com.amazon.kepler.buffer.IBufferGroup*buffer,IContextConfig*contextConfig)
Parameters
buffer
com.amazon.kepler.buffer.IBufferGroup* — Required
Target buffer that will be rendered to.
contextConfig
IContextConfig* — Required
The desired context configuration to be used for surface creation. Please note,
this has to be same or compatible with the IContextConfig of the IContext which would potentially
use this surface when calling IContext#makeCurrent().
Returns
IGraphicsSurface*
Created rendering surface
Throws
DeviceError— if IGpuDevice is not in valid stateNullPointerError— if any input argument is null pointer while a non-null one is expectedInvalidArgumentError— if any input argument is invalidOutOfMemoryError— if device is out of memory
getExtensionAPI()
Query the back-end extension API, returning a pointer of function addresscom.amazon.apmf.NativePointergetExtensionAPI(stringfunctionName)
Parameters
functionName
string — Required
Function name
Returns
com.amazon.apmf.NativePointer
Null NativePointer If function failed or current back-end does not support a get API
operation, otherwise return a valid NativePointer which contains the address for function.
Throws
DeviceError— if IGpuDevice is not in valid stateInvalidArgumentError— if any input argument is invalid
getRenderingCapabilities()
RenderingCapabilities getRenderingCapabilities()
Query the current rendering usage
Returns
RenderingCapabilities
RenderingCapabilities that the current GPU/Context supports
Throws
DeviceError— if IGpuDevice is not in valid state
getNativeHandle()
com.amazon.apmf.NativePointer getNativeHandle()
Query the native handle of current GPU device based on platforms.
Returns
com.amazon.apmf.NativePointer
Native handle as NativePointer
Throws
DeviceError— if IGpuDevice is not in valid state

