E.g. Adapter::open accepts a slice, however we
1) first need to collect elements to
2) then create a slice from the Vec in order to
3) let the backend iterate over it and collect filtered and mapped versions of that iterator
Instead, maybe those methods should accept clone-able iterators?
I think we briefly touched in with @msiglreith earlier and agreed to move to iterators. Slices served well for simplicity earlier in development, but these days we can't afford the user to collect data into vectors.
I believe this is most important for command buffer API, which can be used many times a frame and generally expected to be fast. There is just a few places where we accept slices there, so doing this part should be trivial. Device API, on the other hand, is supposed to be heavy, so heap allocation is not as much critical there.
As a workaround I collect iterator into SmallVec (big enough) to pass values into current API as a slice.
Done, see referenced commits
Most helpful comment
I think we briefly touched in with @msiglreith earlier and agreed to move to iterators. Slices served well for simplicity earlier in development, but these days we can't afford the user to collect data into vectors.