Hey all!
I’m messing around with getting indirect instancing working, and I want to write my instance data into some compute buffers with a job (As implied in the Nordeus talk here)
But given that the ComputerBuffer is a reference type, how can you pass it into a job?
My test code:
struct FillInstanceComputeBuffersJob : IJobParallelForBatch
{
[ReadOnly] public NativeArray<InstanceData> InstanceData;
public ComputeBuffer TargetComputeBuffer;
public void Execute(int startIndex, int count)
{
TargetComputeBuffer.SetData(InstanceData, startIndex, startIndex, count);
}
}