Vulkan: "Acquire" the image from the swapchain as late as possible in the frame #16035
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is good for CPU/GPU parallelism, although does open for even slightly more latency (though probably hardly noticeable). That point I plan to address with some automatic regulation of the queue length between the CPU and GPU later.
To do this, we've now split frame submission into three command buffers, from previous two:
init, main, present.
So we can now submit both init and main to the GPU before acquiring the image (which might take a short while on Android). In the meantime the GPU can do work. Also we now submit init before starting to encode the main command buffer.
Will test a bit on mobile before merge.Seems to work perfectly.