gfx-rs / gfx

[maintenance mode] A low-overhead Vulkan-like GPU API for Rust.
http://gfx-rs.github.io/
Apache License 2.0
5.35k stars 551 forks source link

Draft support for buffer sizes #3751

Closed lachlansneff closed 3 years ago

lachlansneff commented 3 years ago

In progress.

I'm not sure my approach is the best.

kvark commented 3 years ago

Copying from Matrix discussion for posterity:

We shouldn't be asking Metal about anything, since we should have the data (stuff passed into write_descriptor_sets). Also, this data may be more restrictive than what Metal tells us (e.g. the descriptor not covering the whole buffer, or Metal buffer being internally shared between gfx buffers, etc). So basically, each descriptor set should carry a Vec - the sizes of the storage buffer bindings. The command buffer also would have Vec, composed of the join of the descriptor set's vectors. when a descriptor set is bound, the command buffer would overwrite some of these sizes in its list. (the range corresponding to this set)

Also, it appears that wgpu update is basically blocked on this being solved now - https://github.com/gfx-rs/wgpu/pull/1381