Class MinMax
Namespace: Holoride.ElasticSDK.Compute
Assembly: Holoride.ElasticSDK.Library.Runtime.dll
Syntax
[PublicAPI]
public static class MinMax
Methods
DispatchAsync(ComputeBuffer, IList<ComputeBuffer>, int, MinMaxResultConsumer, CancellationToken)
Computes the global minimum and maximum in float
a compute buffer that is expected to
semantically be a 2D array. This uses the push step of the push-pull algorithm, and thus needs
to run asynchronously. Results are provided using a callback for this reason.
Declaration
public static UniTask DispatchAsync(ComputeBuffer input, IList<ComputeBuffer> pyramid, int resolution, MinMax.MinMaxResultConsumer resultConsumer, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
ComputeBuffer | input | The buffer to compute the min and max in. |
IList<ComputeBuffer> | pyramid | The pyramid of buffers used by the algorithm. Typically created via AllocatePyramid(IList<ComputeBuffer>, int, int, uint). |
int | resolution | The edge length/resolution of the 2D data stored in the buffer. |
MinMax.MinMaxResultConsumer | resultConsumer | Callback invoked with the minimum and maximum when they have been computed. |
CancellationToken | cancellationToken | The token to monitor for cancellation requests. |
Returns
Type | Description |
---|---|
Cysharp.Threading.Tasks.UniTask | An enumerator over the progress of the algorithm, expected to run in a Unity coroutine. |
Exceptions
Type | Condition |
---|---|
ArgumentException |
|
DispatchAsync(ComputeBuffer, int, MinMaxResultConsumer, CancellationToken)
Computes the global minimum and maximum in float
a compute buffer that is expected to
semantically be a 2D array. This uses the push step of the push-pull algorithm, and thus needs
to run asynchronously. Results are provided using a callback for this reason.
Declaration
public static UniTask DispatchAsync(ComputeBuffer input, int resolution, MinMax.MinMaxResultConsumer resultConsumer, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
ComputeBuffer | input | The buffer to compute the min and max in. |
int | resolution | The edge length/resolution of the 2D data stored in the buffer. |
MinMax.MinMaxResultConsumer | resultConsumer | Callback invoked with the minimum and maximum when they have been computed. |
CancellationToken | cancellationToken | The token to monitor for cancellation requests. |
Returns
Type | Description |
---|---|
Cysharp.Threading.Tasks.UniTask | An enumerator over the progress of the algorithm, expected to run in a Unity coroutine. |
Exceptions
Type | Condition |
---|---|
ArgumentException |
|
Initialize()
Declaration
public static void Initialize()