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 549 forks source link

Support VK_KHR_synchronization2 in the API #3670

Open kvark opened 3 years ago

kvark commented 3 years ago

See https://gpuopen.com/vulkan-sync2-support/ and https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VK_KHR_synchronization2.html

One of the important bits of difference is that both sides of an event/barrier now know about the barrier contents. This matches DX12 split barriers, so there is an obvious benefit here.

I think what we should do is having this extra information optional in set_event. If the user provides it, then the backend can take advantage of a split barrier. Otherwise, it's the same as today. Vulkan Portability would be using the old version for a while.

kvark commented 3 years ago

This appears to be more problematic than I thought. The wait_events are supposed to receive a list of the sets of barriers now, as opposed to the just a set of barriers for all the events at once. Moreover, each individual barrier now carries its own stage mask. This probably needs a bit more thought, doesn't need to block hal-0.8.