vulkano-rs / vulkano

Safe and rich Rust wrapper around the Vulkan API
Apache License 2.0
4.45k stars 435 forks source link

How to submit a RawCommandBuffer? #2528

Closed bits0rcerer closed 2 months ago

bits0rcerer commented 3 months ago

I would like to synchronize between compute dispatch calls but since I dont use descriptors (https://docs.vulkan.org/samples/latest/samples/extensions/buffer_device_address/README.html) vulkano cannot do the sync for me (I assume). I found the RawRecordingCommandBuffer where I can do my own sync. But now I dont know how to submit that RawCommandBuffer to a queue.

Is there a way to submit the RawCommandBuffer?

Other workarounds I can think of are:

I would like to keep using vulkano and dodge ash but both workarounds feel suboptimal. Any advice?

marc0246 commented 3 months ago

You're right that it's not possible. Reason being that there are still pre-historic parts of the codebase that are in the way. I'm currently working on rewriting all synchronization to a task graph instead, which would include making the command buffer submission use the raw command buffer only. However, with the task graph, you wouldn't need to do that. You could just specify the range of buffer that is written by a task and not touch anything of this sort. If you must submit a RawCommandBuffer you still can, by using device.fns().v1_0.queue_submit together with the VulkanObject::handle method of vulkano's Queue, RawCommandBuffer, Semaphore and Fence. It's not that much different than if this was supported natively.