Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


WriteBuffer

Write data into the memory buffer allocated by the context.
Read time 2 minutesLast updated 6 days ago

Definition

WriteBuffer<T>(BufferSlice<T>, NativeArray<T>)

Write data into the memory buffer allocated by the context.
public void WriteBuffer<T>(BufferSlice<T> dst, NativeArray<T> src) where T : struct

Parameters

The BufferSlice to write to.

The array in the CPU memory that should be written to the buffer. The array must remain valid until the write operation is complete.

Remarks

The ReferenceContext implementation of the ReferenceContext.WriteBuffer method is blocking and returns immediately after writing data into the underlying NativeArray.
Note: EventID is single-use. Once an EventID has been passed to this function, it may not be passed to subsequent IDeviceContext.WriteBuffer or IDeviceContext.ReadBuffer calls. Doing so will result in undefined behavior.

WriteBuffer<T>(BufferSlice<T>, NativeArray<T>, EventID)

Write data into the memory buffer allocated by the context.
public void WriteBuffer<T>(BufferSlice<T> dst, NativeArray<T> src, EventID id) where T : struct

Parameters

The BufferSlice to write to.

The array in the CPU memory that should be written to the buffer. The array must remain valid until the write operation is complete.

The ID of the event to use to track completion of the write.

Remarks

The ReferenceContext implementation of the ReferenceContext.WriteBuffer method is blocking and returns immediately after writing data into the underlying NativeArray.
Note: EventID is single-use. Once an EventID has been passed to this function, it may not be passed to subsequent IDeviceContext.WriteBuffer or IDeviceContext.ReadBuffer calls. Doing so will result in undefined behavior.