Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 6 commits into from
Sep 17, 2022

Conversation

hrydgard
Copy link
Owner

@hrydgard hrydgard commented Sep 17, 2022

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
}

switch (step.stepType) {
case VKRStepType::RENDER:
PerformRenderPass(step, cmd);
if (!step.render.framebuffer) {
_dbg_assert_(!frameData.hasPresentCommands);
Copy link
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.

None yet

2 participants