GPUAdapter
class GPUAdapter : AutoCloseable
Represents a physical graphics adapter.
Summary
Public functions |
|
|---|---|
open external Unit |
close()Decrements the reference count of the object and frees resources when the count reaches zero. |
open operator Boolean |
|
external GPUSupportedFeatures |
Retrieves the list of features supported by the adapter. |
external GPUAdapterInfo |
Retrieves detailed information about the adapter. |
external GPULimits |
Retrieves the limits supported by the adapter. |
external Boolean |
@FastNativeChecks if a specific feature is supported by the adapter. |
open Int |
hashCode() |
suspend GPUDevice |
requestDevice(descriptor: GPUDeviceDescriptor?)Asynchronously requests a device from the adapter. |
external Unit |
@FastNativeAsynchronously requests a device from the adapter. |
Public functions
close
open external fun close(): Unit
Decrements the reference count of the object and frees resources when the count reaches zero.
This is the standard way to manage object lifetimes and should be used in use blocks. After calling this, the object is no longer usable.
getFeatures
@FastNative
external fun getFeatures(): GPUSupportedFeatures
Retrieves the list of features supported by the adapter.
getInfo
@FastNative
external fun getInfo(): GPUAdapterInfo
Retrieves detailed information about the adapter.
| Returns | |
|---|---|
GPUAdapterInfo |
The status of the operation. |
getLimits
@FastNative
external fun getLimits(): GPULimits
Retrieves the limits supported by the adapter.
| Returns | |
|---|---|
GPULimits |
The status of the operation. |
hasFeature
@FastNative
external fun hasFeature(feature: Int): Boolean
Checks if a specific feature is supported by the adapter.
| Parameters | |
|---|---|
feature: Int |
The feature to check for. |
| Returns | |
|---|---|
Boolean |
{@code true} if the feature is supported, {@code false} otherwise. |
requestDevice
suspend fun requestDevice(descriptor: GPUDeviceDescriptor? = null): GPUDevice
Asynchronously requests a device from the adapter.
| Parameters | |
|---|---|
descriptor: GPUDeviceDescriptor? = null |
The descriptor for the device. |
requestDevice
@FastNative
external fun requestDevice(
callbackExecutor: Executor,
descriptor: GPUDeviceDescriptor? = null,
callback: GPURequestCallback<GPUDevice>
): Unit
Asynchronously requests a device from the adapter.