Skip to content

Vulkan: "Acquire" the image from the swapchain as late as possible in the frame - #16035

Merged
hrydgard merged 6 commits into
masterfrom
vk-acquire-late
Sep 17, 2022
Merged

hrydgard merged 6 commits into
masterfrom
vk-acquire-late

Conversation

@hrydgard

@hrydgard hrydgard commented Sep 17, 2022 •

Copy link
Copy Markdown
Owner

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.

@hrydgard hrydgard added this to the v1.14.0 milestone Sep 17, 2022
@hrydgard hrydgard added GE emulation Backend-independent GPU issues Code Cleanup Cleanup to make future work easier. Needs to be done sometimes. Vulkan and removed GE emulation Backend-independent GPU issues labels Sep 17, 2022
@hrydgard
hrydgard marked this pull request as ready for review September 17, 2022 07:41
@hrydgard
hrydgard merged commit bf59640 into master Sep 17, 2022
@hrydgard
hrydgard deleted the vk-acquire-late branch September 17, 2022 07:58
case VKRStepType::RENDER:
PerformRenderPass(step, cmd);
if (!step.render.framebuffer) {
_dbg_assert_(!frameData.hasPresentCommands);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, what about non-buffered? Is that always only a single render pass?

-[Unknown]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Code Cleanup Cleanup to make future work easier. Needs to be done sometimes. Vulkan

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants