Closed thedodd closed 2 years ago
vek types are linear algebra types, they are stored on the stack so can be passed by value just fine and they hold no references to cpu data. Vec
on the other hand stores its data on the heap, and that data is not readable by the GPU, you need to alloc a separate unified/device buffer and copy the data over. It would not be sound to pass a Vec to the gpu, you would get a segfault
Thank you for the quick response and great explanation.
I see that there is no impl DeviceCopy for core/alloc Vec, but I do see the impls for the vek::* types. Is there any particular concern with slapping on an
unsafe impl DeviceCopy for
the core/alloc Vec type?I have some data structures which are pure data, no references, nothing like that, but there are vector fields. Would it be sounds to impl DeviceCopy for such a type? I’m wondering what the actual requirements are. Just no references and no_std?