Struct LayoutUtility
Low-level utility functions for AOS->SOA (scatter) and SOA->AOS (gather) conversions.
Namespace: Unity.Entities
Syntax
public struct LayoutUtility
Methods
GatherChunkedSOA8(NativeArray<SOAFieldInfo>, Int32, Byte*, Void*, Int32)
Declaration
public static void GatherChunkedSOA8(NativeArray<SOAFieldInfo> fields, int fieldSizeSum, byte *sourceBaseAddress, void *target, int sourceIndex)
Parameters
Type | Name | Description |
---|---|---|
NativeArray<SOAFieldInfo> | fields | |
System.Int32 | fieldSizeSum | |
System.Byte* | sourceBaseAddress | |
System.Void* | target | |
System.Int32 | sourceIndex |
GatherFullSOA(NativeArray<SOAFieldInfo>, Byte*, Void*, Int32, Int32)
Gather AOS data from fully parallel arrays of fields.
Declaration
public static void GatherFullSOA(NativeArray<SOAFieldInfo> fields, byte *sourceBaseAddress, void *target, int sourceIndex, int sourceArraySize)
Parameters
Type | Name | Description |
---|---|---|
NativeArray<SOAFieldInfo> | fields | Struct type descriptor |
System.Byte* | sourceBaseAddress | Pointer to first byte of source SOA array |
System.Void* | target | Pointer to target AOS struct instance to be gathered into |
System.Int32 | sourceIndex | The index of the SOA element to be gathered |
System.Int32 | sourceArraySize | The number of elements in the SOA data |
ScatterChunkedSOA8(NativeArray<SOAFieldInfo>, Int32, Byte*, Void*, Int32)
Declaration
public static void ScatterChunkedSOA8(NativeArray<SOAFieldInfo> fields, int fieldSizeSum, byte *targetBaseAddress, void *source, int targetIndex)
Parameters
Type | Name | Description |
---|---|---|
NativeArray<SOAFieldInfo> | fields | |
System.Int32 | fieldSizeSum | |
System.Byte* | targetBaseAddress | |
System.Void* | source | |
System.Int32 | targetIndex |
ScatterFullSOA(NativeArray<SOAFieldInfo>, Byte*, Void*, Int32, Int32)
Declaration
public static void ScatterFullSOA(NativeArray<SOAFieldInfo> fields, byte *targetBaseAddress, void *source, int targetIndex, int targetArraySize)
Parameters
Type | Name | Description |
---|---|---|
NativeArray<SOAFieldInfo> | fields | |
System.Byte* | targetBaseAddress | |
System.Void* | source | |
System.Int32 | targetIndex | |
System.Int32 | targetArraySize |