RequestAdapterOptions¶
data class RequestAdapterOptions(
val featureLevel: GPUFeatureLevel = GPUFeatureLevel.Core,
val powerPreference: GPUPowerPreference? = null,
val forceFallbackAdapter: Boolean = false,
val xrCompatible: Boolean = false
) : GPURequestAdapterOptions
Constructors¶
RequestAdapterOptions¶
Properties¶
featureLevel¶
open override val featureLevel: GPUFeatureLevel
Requests an adapter that supports at least a particular set of capabilities. This influences the [default feature level] of devices created from this adapter. The capabilities for each level are defined below, and the exact steps are defined in requestAdapter() and "a new device". If the implementation or system does not support all of the capabilities in the requested feature level, requestAdapter() will return null.
forceFallbackAdapter¶
open override val forceFallbackAdapter: Boolean
When set to true indicates that only a fallback adapter may be returned. If the user agent does not support a fallback adapter, will cause requestAdapter() to resolve to null. Note: requestAdapter() may still return a fallback adapter if forceFallbackAdapter is set to false and either no other appropriate adapter is available or the user agent chooses to return a fallback adapter. Developers that wish to prevent their applications from running on fallback adapters should check the info.isFallbackAdapter attribute prior to requesting a GPUDevice.
powerPreference¶
open override val powerPreference: GPUPowerPreference?
Optionally provides a hint indicating what class of adapter should be selected from the system’s available adapters. The value of this hint may influence which adapter is chosen, but it must not influence whether an adapter is returned or not.
xrCompatible¶
open override val xrCompatible: Boolean
When set to true indicates that the best adapter for rendering to a WebXR session must be returned. If the user agent or system does not support WebXR sessions then adapter selection may ignore this value. Note: If xrCompatible is not set to true when the adapter is requested, GPUDevices created from the adapter cannot be used to render for WebXR sessions.