SetBufferData
Adds a command to set the buffer with values from an array.
Read time 8 minutesLast updated 4 days ago
Definition
- Type: Method
- Namespace: UnityEngine.Rendering
- Assembly: UnityEngine.CoreModule
SetBufferData(ComputeBuffer, Array)
Adds a command to set the buffer with values from an array.
public void SetBufferData(ComputeBuffer buffer, Array data)
Parameters
Remarks
The input data must follow the data layout rules of the graphics API in use. See Compute Shaders for cross-platform compatibility information.
Note: Because only blittable data types can be copied from the array to the buffer, the array must only contain elements of a blittable type. If you attempt to use non-blittable types, an exception will be raised.
SetBufferData<T>(ComputeBuffer, List<T>)
Adds a command to set the buffer with values from an array.
public void SetBufferData<T>(ComputeBuffer buffer, List<T> data) where T : struct
Parameters
Remarks
The input data must follow the data layout rules of the graphics API in use. See Compute Shaders for cross-platform compatibility information.
Note: Because only blittable data types can be copied from the array to the buffer, the array must only contain elements of a blittable type. If you attempt to use non-blittable types, an exception will be raised.
SetBufferData<T>(ComputeBuffer, NativeArray<T>)
Adds a command to set the buffer with values from an array.
public void SetBufferData<T>(ComputeBuffer buffer, NativeArray<T> data) where T : struct
Parameters
Remarks
The input data must follow the data layout rules of the graphics API in use. See Compute Shaders for cross-platform compatibility information.
Note: Because only blittable data types can be copied from the array to the buffer, the array must only contain elements of a blittable type. If you attempt to use non-blittable types, an exception will be raised.
SetBufferData(ComputeBuffer, Array, int, int, int)
Adds a command to process a partial copy of data values from an array into the buffer.
public void SetBufferData(ComputeBuffer buffer, Array data, int managedBufferStartIndex, int graphicsBufferStartIndex, int count)
Parameters
The destination buffer.
Array of values to fill the buffer.
The first element index in data to copy to the compute buffer.
The first element index in compute buffer to receive the data.
The number of elements to copy.
Remarks
The input data must follow the data layout rules of the graphics API in use. See Compute Shaders for cross-platform compatibility information.
Note: Because only blittable data types can be copied from the array to the buffer, the array must only contain elements of a blittable type. If you attempt to use non-blittable types, an exception will be raised.
SetBufferData<T>(ComputeBuffer, List<T>, int, int, int)
Adds a command to process a partial copy of data values from an array into the buffer.
public void SetBufferData<T>(ComputeBuffer buffer, List<T> data, int managedBufferStartIndex, int graphicsBufferStartIndex, int count) where T : struct
Parameters
The destination buffer.
Array of values to fill the buffer.
The first element index in data to copy to the compute buffer.
The first element index in compute buffer to receive the data.
The number of elements to copy.
Remarks
The input data must follow the data layout rules of the graphics API in use. See Compute Shaders for cross-platform compatibility information.
Note: Because only blittable data types can be copied from the array to the buffer, the array must only contain elements of a blittable type. If you attempt to use non-blittable types, an exception will be raised.
SetBufferData<T>(ComputeBuffer, NativeArray<T>, int, int, int)
Adds a command to process a partial copy of data values from an array into the buffer.
public void SetBufferData<T>(ComputeBuffer buffer, NativeArray<T> data, int nativeBufferStartIndex, int graphicsBufferStartIndex, int count) where T : struct
Parameters
The destination buffer.
Array of values to fill the buffer.
The first element index in data to copy to the compute buffer.
The first element index in compute buffer to receive the data.
The number of elements to copy.
Remarks
The input data must follow the data layout rules of the graphics API in use. See Compute Shaders for cross-platform compatibility information.
Note: Because only blittable data types can be copied from the array to the buffer, the array must only contain elements of a blittable type. If you attempt to use non-blittable types, an exception will be raised.
SetBufferData(GraphicsBuffer, Array)
Adds a command to set the buffer with values from an array.
public void SetBufferData(GraphicsBuffer buffer, Array data)
Parameters
Remarks
The input data must follow the data layout rules of the graphics API in use. See Compute Shaders for cross-platform compatibility information.
Note: Because only blittable data types can be copied from the array to the buffer, the array must only contain elements of a blittable type. If you attempt to use non-blittable types, an exception will be raised.
SetBufferData<T>(GraphicsBuffer, List<T>)
Adds a command to set the buffer with values from an array.
public void SetBufferData<T>(GraphicsBuffer buffer, List<T> data) where T : struct
Parameters
Remarks
The input data must follow the data layout rules of the graphics API in use. See Compute Shaders for cross-platform compatibility information.
Note: Because only blittable data types can be copied from the array to the buffer, the array must only contain elements of a blittable type. If you attempt to use non-blittable types, an exception will be raised.
SetBufferData<T>(GraphicsBuffer, NativeArray<T>)
Adds a command to set the buffer with values from an array.
public void SetBufferData<T>(GraphicsBuffer buffer, NativeArray<T> data) where T : struct
Parameters
Remarks
The input data must follow the data layout rules of the graphics API in use. See Compute Shaders for cross-platform compatibility information.
Note: Because only blittable data types can be copied from the array to the buffer, the array must only contain elements of a blittable type. If you attempt to use non-blittable types, an exception will be raised.
SetBufferData(GraphicsBuffer, Array, int, int, int)
Adds a command to process a partial copy of data values from an array into the buffer.
public void SetBufferData(GraphicsBuffer buffer, Array data, int managedBufferStartIndex, int graphicsBufferStartIndex, int count)
Parameters
The destination buffer.
Array of values to fill the buffer.
The first element index in data to copy to the compute buffer.
The first element index in compute buffer to receive the data.
The number of elements to copy.
Remarks
The input data must follow the data layout rules of the graphics API in use. See Compute Shaders for cross-platform compatibility information.
Note: Because only blittable data types can be copied from the array to the buffer, the array must only contain elements of a blittable type. If you attempt to use non-blittable types, an exception will be raised.
SetBufferData<T>(GraphicsBuffer, List<T>, int, int, int)
Adds a command to process a partial copy of data values from an array into the buffer.
public void SetBufferData<T>(GraphicsBuffer buffer, List<T> data, int managedBufferStartIndex, int graphicsBufferStartIndex, int count) where T : struct
Parameters
The destination buffer.
Array of values to fill the buffer.
The first element index in data to copy to the compute buffer.
The first element index in compute buffer to receive the data.
The number of elements to copy.
Remarks
The input data must follow the data layout rules of the graphics API in use. See Compute Shaders for cross-platform compatibility information.
Note: Because only blittable data types can be copied from the array to the buffer, the array must only contain elements of a blittable type. If you attempt to use non-blittable types, an exception will be raised.
SetBufferData<T>(GraphicsBuffer, NativeArray<T>, int, int, int)
Adds a command to process a partial copy of data values from an array into the buffer.
public void SetBufferData<T>(GraphicsBuffer buffer, NativeArray<T> data, int nativeBufferStartIndex, int graphicsBufferStartIndex, int count) where T : struct
Parameters
The destination buffer.
Array of values to fill the buffer.
The first element index in data to copy to the compute buffer.
The first element index in compute buffer to receive the data.
The number of elements to copy.
Remarks
The input data must follow the data layout rules of the graphics API in use. See Compute Shaders for cross-platform compatibility information.
Note: Because only blittable data types can be copied from the array to the buffer, the array must only contain elements of a blittable type. If you attempt to use non-blittable types, an exception will be raised.