Vulkan: Fix flicker on resize #522

Merged
goeiecool9999 merged 1 commit from fixflicker into main 2022-11-21 15:06:35 -03:00
goeiecool9999 commented 2022-11-21 14:18:30 -03:00 (Migrated from github.com)

When a swapchain becomes suboptimal after an acquire for rendering, SwapBuffer would recreate the swapchain and acquire a new image from it which would get filled in with black because the content is undefined, resulting in black flickering when resizing.
By changing the order in AcquireNextSwapchainImage it'll always try to present the suboptimal image it already acquired and drew content to and drop the image if it is out of date and cannot be used. Then when no image is reserved anymore the next acquire will recreate the swapchain.

When a swapchain becomes suboptimal after an acquire for rendering, SwapBuffer would recreate the swapchain and acquire a new image from it which would get filled in with black because the content is undefined, resulting in black flickering when resizing. By changing the order in AcquireNextSwapchainImage it'll always try to present the suboptimal image it already acquired and drew content to and drop the image if it is out of date and cannot be used. Then when no image is reserved anymore the next acquire will recreate the swapchain.
Exzap commented 2022-11-21 15:05:59 -03:00 (Migrated from github.com)

FYI on Windows there is a white flicker when resizing. It's been there pre-2.0 too. Interestingly, this PR doesn't affect it.

FYI on Windows there is a white flicker when resizing. It's been there pre-2.0 too. Interestingly, this PR doesn't affect it.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: cemu-project_Mirror/Cemu-2024-03-05#522
No description provided.