Struct FixedAttachmentArray<DataType>
A fixed-size array that can contain up to maximum render target attachment amount of items.
Inherited Members
Namespace: UnityEngine .Rendering.RenderGraphModule .NativeRenderPassCompiler
Assembly: Unity.RenderPipelines.Core.Runtime.dll
Syntax
public struct FixedAttachmentArray<DataType> where DataType : unmanaged
Type Parameters
Name | Description |
---|---|
DataType | The type of data to store in the array. |
Constructors
FixedAttachmentArray(int)
Created an new array with the specified number of attachments.
Declaration
public FixedAttachmentArray(int numAttachments)
Parameters
Type | Name | Description |
---|---|---|
int | numAttachments | Number of attachments to consider valid. |
Exceptions
Type | Condition |
---|---|
Argument |
Thrown if the amount of elements is less than 0 or more than MaxAttachments |
FixedAttachmentArray(NativeArray<DataType>)
Intialize the FixedAttachmentArray by copying data from the passed in native array.
Declaration
public FixedAttachmentArray(NativeArray<DataType> attachments)
Parameters
Type | Name | Description |
---|---|---|
Native |
attachments | The native array from which to copy the elements. |
FixedAttachmentArray(DataType[])
Intialize the FixedAttachmentArray by copying data from the passed in c# array.
Declaration
public FixedAttachmentArray(DataType[] attachments)
Parameters
Type | Name | Description |
---|---|---|
DataType[] | attachments | The C# array from which to copy the elements. |
Fields
Empty
Returns an empty array.
Declaration
public static FixedAttachmentArray<DataType> Empty
Field Value
Type | Description |
---|---|
Fixed |
MaxAttachments
The maximum number of elements that can be stored in the array.
Declaration
public const int MaxAttachments = 8
Field Value
Type | Description |
---|---|
int |
Properties
this[int]
Get the element at the specified index in the array.
Declaration
public ref DataType this[int index] { get; }
Parameters
Type | Name | Description |
---|---|---|
int | index | Index of the element. |
Property Value
Type | Description |
---|---|
Data |
The value of the element. |
Exceptions
Type | Condition |
---|---|
Index |
If the index is outside the valid range. |
size
Number of attachments in the array alway less or equal than MaxAttachments
Declaration
public int size { get; }
Property Value
Type | Description |
---|---|
int |
Methods
Add(in DataType)
Add an element tot the array.
Declaration
public int Add(in DataType data)
Parameters
Type | Name | Description |
---|---|---|
Data |
data | Element to add |
Returns
Type | Description |
---|---|
int | Returns the index where the item was added. |
Exceptions
Type | Condition |
---|---|
Index |
If the maximum amount of elements (MaxAttachments) is reached. |
Clear()
Clear the array.
Declaration
public void Clear()