GPUAdapter


public final class GPUAdapter implements AutoCloseable


Represents a physical graphics adapter.

Summary

Public methods

external void

Decrements the reference count of the object and frees resources when the count reaches zero.

boolean
equals(Object other)
final external @NonNull GPUSupportedFeatures

Retrieves the list of features supported by the adapter.

final long
final external @NonNull GPUAdapterInfo

Retrieves detailed information about the adapter.

final external @NonNull GPULimits

Retrieves the limits supported by the adapter.

final external boolean
@FastNative
hasFeature(int feature)

Checks if a specific feature is supported by the adapter.

int
final @NonNull GPUDevice

Asynchronously requests a device from the adapter.

final external void
@FastNative
requestDevice(
    @NonNull Executor callbackExecutor,
    GPUDeviceDescriptor descriptor,
    @NonNull GPURequestCallback<@NonNull GPUDevice> callback
)

Asynchronously requests a device from the adapter.

Public methods

close

Added in 1.0.0-alpha04
public external void close()

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.

equals

public boolean equals(Object other)

getFeatures

Added in 1.0.0-alpha04
@FastNative
public final external @NonNull GPUSupportedFeatures getFeatures()

Retrieves the list of features supported by the adapter.

getHandle

Added in 1.0.0-alpha04
public final long getHandle()

getInfo

Added in 1.0.0-alpha04
@FastNative
public final external @NonNull GPUAdapterInfo getInfo()

Retrieves detailed information about the adapter.

Returns
@NonNull GPUAdapterInfo

The status of the operation.

getLimits

Added in 1.0.0-alpha04
@FastNative
public final external @NonNull GPULimits getLimits()

Retrieves the limits supported by the adapter.

Returns
@NonNull GPULimits

The status of the operation.

hasFeature

Added in 1.0.0-alpha04
@FastNative
public final external boolean hasFeature(int feature)

Checks if a specific feature is supported by the adapter.

Parameters
int feature

The feature to check for.

Returns
boolean

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

hashCode

public int hashCode()

requestDevice

public final @NonNull GPUDevice requestDevice(GPUDeviceDescriptor descriptor)

Asynchronously requests a device from the adapter.

Parameters
GPUDeviceDescriptor descriptor

The descriptor for the device.

requestDevice

Added in 1.0.0-alpha04
@FastNative
public final external void requestDevice(
    @NonNull Executor callbackExecutor,
    GPUDeviceDescriptor descriptor,
    @NonNull GPURequestCallback<@NonNull GPUDevice> callback
)

Asynchronously requests a device from the adapter.