Class BarracudaArray
A BarracudaArray exposes a buffer of native memory to managed code.
Inheritance
BarracudaArray
Assembly: solution.dll
Syntax
public class BarracudaArray : IDisposable
Constructors
BarracudaArray(int, DataType, Allocator)
Declaration
public BarracudaArray(int length, DataType dataType = DataType.Float, Allocator allocator = Allocator.Persistent)
Parameters
BarracudaArray(SafeHandle, DataType, int)
Declaration
protected BarracudaArray(SafeHandle safeHandle, DataType dataType, int dataLength)
Parameters
Fields
m_SafeHandle
Declaration
protected readonly SafeHandle m_SafeHandle
Field Value
Properties
Disposed
Declaration
public bool Disposed { get; }
Property Value
this[int]
Declaration
public float this[int index] { get; set; }
Parameters
Type |
Name |
Description |
int |
index |
|
Property Value
this[long]
Declaration
public float this[long index] { get; set; }
Parameters
Type |
Name |
Description |
long |
index |
|
Property Value
Length
Declaration
public int Length { get; }
Property Value
LongLength
Declaration
public long LongLength { get; }
Property Value
RawPtr
Declaration
public virtual void* RawPtr { get; }
Property Value
SizeOfType
Declaration
public int SizeOfType { get; }
Property Value
Type
Declaration
public DataType Type { get; }
Property Value
Methods
AddressAt(long)
Declaration
public float* AddressAt(long index)
Parameters
Type |
Name |
Description |
long |
index |
|
Returns
BlockCopy(byte[], int, BarracudaArray, int, int)
Declaration
public static void BlockCopy(byte[] sourceArray, int sourceByteOffset, BarracudaArray destinationArray, int destinationByteOffset, int lengthInBytes)
Parameters
Type |
Name |
Description |
byte[] |
sourceArray |
|
int |
sourceByteOffset |
|
BarracudaArray |
destinationArray |
|
int |
destinationByteOffset |
|
int |
lengthInBytes |
|
BlockCopy(BarracudaArray, int, byte[], int, int)
Declaration
public static void BlockCopy(BarracudaArray sourceArray, int sourceByteOffset, byte[] destinationArray, int destinationByteOffset, int lengthInBytes)
Parameters
Type |
Name |
Description |
BarracudaArray |
sourceArray |
|
int |
sourceByteOffset |
|
byte[] |
destinationArray |
|
int |
destinationByteOffset |
|
int |
lengthInBytes |
|
Copy(float[], int, BarracudaArray, int, int)
Declaration
public static void Copy(float[] sourceArray, int sourceIndex, BarracudaArray destinationArray, int destinationIndex, int length)
Parameters
Copy(float[], int, BarracudaArray, long, int)
Declaration
public static void Copy(float[] sourceArray, int sourceIndex, BarracudaArray destinationArray, long destinationIndex, int length)
Parameters
Copy(float[], BarracudaArray, int)
Declaration
public static void Copy(float[] sourceArray, BarracudaArray destinationArray, int length = -1)
Parameters
Copy(BarracudaArray, int, float[], int, int)
Declaration
public static void Copy(BarracudaArray sourceArray, int sourceIndex, float[] destinationArray, int destinationIndex, int length)
Parameters
Copy(BarracudaArray, int, BarracudaArray, int, int)
Declaration
public static void Copy(BarracudaArray sourceArray, int sourceIndex, BarracudaArray destinationArray, int destinationIndex, int length)
Parameters
Copy(BarracudaArray, BarracudaArray, int)
Declaration
public static void Copy(BarracudaArray sourceArray, BarracudaArray destinationArray, int length = -1)
Parameters
CopyTo(BarracudaArray, int)
Declaration
public void CopyTo(BarracudaArray dst, int dstOffset)
Parameters
CopyTo(BarracudaArray, long)
Declaration
public void CopyTo(BarracudaArray dst, long dstOffset)
Parameters
DataAlignmentSize(DataType)
Declaration
public static int DataAlignmentSize(DataType dataType)
Parameters
Returns
DataItemSize(DataType)
Declaration
public static int DataItemSize(DataType dataType)
Parameters
Returns
Dispose()
Declaration
public virtual void Dispose()
GetFloat(int)
Declaration
public float GetFloat(int index)
Parameters
Type |
Name |
Description |
int |
index |
|
Returns
GetHalf(int)
Declaration
public half GetHalf(int index)
Parameters
Type |
Name |
Description |
int |
index |
|
Returns
HalfAddressAt(long)
Declaration
public half* HalfAddressAt(long index)
Parameters
Type |
Name |
Description |
long |
index |
|
Returns
LengthWithPaddingForGPUCopy(DataType, int)
Declaration
public static int LengthWithPaddingForGPUCopy(DataType dataType, int length)
Parameters
Returns
RawAddressAt(long)
Declaration
public void* RawAddressAt(long index)
Parameters
Type |
Name |
Description |
long |
index |
|
Returns
SetFloat(int, float)
Declaration
public void SetFloat(int index, float value)
Parameters
Type |
Name |
Description |
int |
index |
|
float |
value |
|
SetHalf(int, half)
Declaration
public void SetHalf(int index, half value)
Parameters
Type |
Name |
Description |
int |
index |
|
half |
value |
|
UploadToComputeBuffer(ComputeBuffer)
Declaration
public void UploadToComputeBuffer(ComputeBuffer buffer)
Parameters
UploadToComputeBuffer(ComputeBuffer, int, int, int)
Declaration
public void UploadToComputeBuffer(ComputeBuffer buffer, int elementStartIndex, int computeBufferStartIndex, int numElementToCopy)
Parameters
Type |
Name |
Description |
ComputeBuffer |
buffer |
|
int |
elementStartIndex |
|
int |
computeBufferStartIndex |
|
int |
numElementToCopy |
|
ZeroMemory()
Declaration
Operators
implicit operator float[](BarracudaArray)
Warning, this return a copy! Do not use to modify a BarracudaArray
Declaration
public static implicit operator float[](BarracudaArray barracudaArray)
Parameters
Returns
Implements
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.