GPUAdapter
public final class GPUAdapter implements AutoCloseable
Represents a physical graphics adapter.
Summary
Public methods |
|
|---|---|
external void |
close()Decrements the reference count of the object and frees resources when the count reaches zero. |
boolean |
|
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 |
@FastNativeChecks if a specific feature is supported by the adapter. |
int |
hashCode() |
final @NonNull GPUDevice |
requestDevice(GPUDeviceDescriptor descriptor)Asynchronously requests a device from the adapter. |
final external void |
@FastNativeAsynchronously requests a device from the adapter. |
Public methods
close
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.
getFeatures
@FastNative
public final external @NonNull GPUSupportedFeatures getFeatures()
Retrieves the list of features supported by the adapter.
getInfo
@FastNative
public final external @NonNull GPUAdapterInfo getInfo()
Retrieves detailed information about the adapter.
| Returns | |
|---|---|
@NonNull GPUAdapterInfo |
The status of the operation. |
getLimits
@FastNative
public final external @NonNull GPULimits getLimits()
Retrieves the limits supported by the adapter.
hasFeature
@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. |
requestDevice
public final @NonNull GPUDevice requestDevice(GPUDeviceDescriptor descriptor)
Asynchronously requests a device from the adapter.
| Parameters | |
|---|---|
GPUDeviceDescriptor descriptor |
The descriptor for the device. |
requestDevice
@FastNative
public final external void requestDevice(
@NonNull Executor callbackExecutor,
GPUDeviceDescriptor descriptor,
@NonNull GPURequestCallback<@NonNull GPUDevice> callback
)
Asynchronously requests a device from the adapter.