vkd3d: Add barriers between render passes to the same image

If you have multiple render passes that write to the same render target, they need barriers to prevent them from writing in the wrong order.

Note that this implementation isn't 100% correct, it'll only insert barriers if the renders are back to back, but if you e.g. did a render to target A, then B, then A again, no barriers would be inserted. At the very least, Apple GPUs only seem to be able to overlap two adjacent render passes, so this should cover things for them, but if we wanted to handle all cases on all GPUs, we might need more complicated handling. Updated to track all resources in a command list.

vkd3d-proton handles this by blindly inserting barriers after every render pass regardless of whether they're needed... and then adds a speed hack that disables all of them on non-tile-based GPUs claiming that they slow things down too much.

Edited by Evan Tang

Merge request reports

Loading