object GPU


Summary

Public functions

external GPUInstance

Creates a new WebGPU instance object.

external GPUSupportedInstanceFeatures

Gets the set of instance features supported by the implementation.

external GPUInstanceLimits

Gets the limits supported by the instance.

external Boolean

Checks if a specific instance feature is supported by the implementation.

Public functions

createInstance

Added in 1.0.0-alpha02
@FastNative
external fun createInstance(descriptor: GPUInstanceDescriptor? = null): GPUInstance

Creates a new WebGPU instance object.

Parameters
descriptor: GPUInstanceDescriptor? = null

A descriptor specifying creation options for the instance.

Returns
GPUInstance

The newly created WebGPU instance.

getInstanceFeatures

Added in 1.0.0-alpha02
@FastNative
external fun getInstanceFeatures(features: GPUSupportedInstanceFeatures): GPUSupportedInstanceFeatures

Gets the set of instance features supported by the implementation.

Parameters
features: GPUSupportedInstanceFeatures

A structure to be filled with the supported instance features.

getInstanceLimits

Added in 1.0.0-alpha02
@FastNative
external fun getInstanceLimits(limits: GPUInstanceLimits = GPUInstanceLimits()): GPUInstanceLimits

Gets the limits supported by the instance.

Parameters
limits: GPUInstanceLimits = GPUInstanceLimits()

A structure to be filled with the instance limits.

Returns
GPUInstanceLimits

Status code of the operation.

hasInstanceFeature

Added in 1.0.0-alpha02
@FastNative
external fun hasInstanceFeature(feature: Int): Boolean

Checks if a specific instance feature is supported by the implementation.

Parameters
feature: Int

The instance feature to query.

Returns
Boolean

True if the feature is supported, {@code false} otherwise.