What would be the fastest way to copy elements from the source buffer, to a destination buffer, with an offset in the destination buffer?
I’d like to start a job, which would copy the contents of several, equally sized buffers, to a destination buffer in parallel. Each source buffer would be mapped to a different starting index in the destination buffer, based on their jobIndex:
Maybe that’s word soup. Here’s a visual example:
Source Buffers:
SourceBufferA: [A0, A1, A2]
SourceBufferB: [B0, B1, B2]
SourceBufferC: [C0, C1, C2]
Destination Buffer (after copy job):
DestBuffer: [A0, A1, A2, B0, B1, B2, C0, C1, C2]
The destination buffer can be assumed to already be the correct size.
This seems like something basic I should be able to figure out. But since UsafeUtility.MemCpy takes a void* for the destination buffer, I’m not sure how to do the destination offset.
Thank you for any advice. I have my face-palming hand ready!