object GPU


Summary

Public functions

external GPUInstance

Creates a new WebGPU instance.

external GPUSupportedInstanceFeatures

Retrieves the list of features supported by the instance.

external GPUInstanceLimits

Retrieves the limits supported by the instance.

external Boolean

Checks if a specific feature is supported by the instance.

Public functions

createInstance

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

Creates a new WebGPU instance.

Parameters
descriptor: GPUInstanceDescriptor? = null

The descriptor for the instance.

Returns
GPUInstance

A handle to the created instance.

getInstanceFeatures

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

Retrieves the list of features supported by the instance.

Parameters
features: GPUSupportedInstanceFeatures

A structure to be filled with the supported features.

getInstanceLimits

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

Retrieves the limits supported by the instance.

Parameters
limits: GPUInstanceLimits = GPUInstanceLimits()

A structure to be filled with the supported limits.

Returns
GPUInstanceLimits

The status of the operation.

hasInstanceFeature

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

Checks if a specific feature is supported by the instance.

Parameters
feature: Int

The feature to check for.

Returns
Boolean

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