amethyst/rendy

No way to specify size in `upload_from_staging_buffer`

Benjamin-L opened this issue · 2 comments

I have to do repeated copies from the cpu to gpu buffers, with a known max size bound. I'm trying to keep a persistent staging buffer that's allocated to this max size, and then only use a section of it for each upload. Currently, Factory::upload_from_staging_buffer doesn't have any way to specify the size and instead just uses the size of the entire staging buffer.

I think this function should be modified to accept the size of the copied region, although this would be a breaking change.

If you copy repeatedly from staging buffer to device buffer then you probably should record copy commands directly.
upload_from_staging_buffer is designed mostly for staging buffer you aren't going to reuse.

That's fair. I don't think there's a way to register custom command buffers with the flush_uploads mechanism, although maybe it's better to roll my own abstraction for that too, since I need to wait on the previous copy command to complete before overwriting the staging buffer.

I'm good with closing this issue if you don't think it's a problem.