Table of Contents

Method CopyFrom

Namespace
Pinwheel.Vista
Assembly
Pinwheel.Vista.Runtime.dll

CopyFrom<T>(ComputeBuffer, Rect, Rect)

Creates a destination buffer by remapping sample positions from source bounds into destination bounds.

public static ComputeBuffer CopyFrom<T>(ComputeBuffer srcBuffer, Rect inBounds, Rect outBounds)

Parameters

srcBuffer ComputeBuffer

Source compute buffer storing packed float data for one supported sample type. The buffer length must be an exact multiple of that sample type's float count.

inBounds Rect

Source rectangle in normalized sample space. Samples are interpreted relative to this region before being remapped.

outBounds Rect

Destination rectangle in normalized sample space. Output sample positions are written relative to this region.

Returns

ComputeBuffer

A newly allocated compute buffer with the same packed layout as srcBuffer, cleared to zero before remapped samples are appended.

Type Parameters

T

Sample layout stored in the buffer. Supported values are InstanceSample and PositionSample.

Remarks

The runtime allocates one float-based destination buffer sized for the full source sample count, then lets the compute shader append remapped samples into it. Callers own the returned buffer and are responsible for releasing it.

Exceptions

ArgumentException

Thrown when T is not a supported packed sample type, or when the source buffer size does not match that packed layout.