vulkano-rs/vulkano

[Question] How do I send dynamically sized array?

tmvkrpxl0 opened this issue · 2 comments

  • Version of vulkano: I think 0.34.0? Probably latest since I'm pulling it from github instead of crate.io
  • OS: KDE Neon 5.27
  • GPU (the selected PhysicalDevice): GTX 1050 TI
  • GPU Driver: nvidia-driver-545
  • Upload of a reasonably minimal complete main.rs file that demonstrates the issue: TODO

Issue

Noob question, I have Subbuffer<[T]> that I created with Buffer::new_unsized. This is for sharing dynamically sized array. How do I send it to GPU? Both BufferWriteGuard and RecordingCommandBuffer::update_buffer takes in owned data. and I don't think it's possible to turn Vec<T> to [T]

oh SafeDeref can also be reference as well, my bad

We have examples that show reading/writing of subbuffers containing unsized data. It's no different from reading/writing sized data. Not sure what you mean by BufferWriteGuard taking in owned data. update_buffer needs to be passed in an owned smart pointer because of temporary limitations.