Commit f648c27
committed
disp/vulkan: Fix suboptimal swapchain handling
When vkAcquireNextImage() returns VK_SUBOPTIMAL_KHR it means that a valid
usable image was still acquired and that means that the
acquire_samaphore is pending and signalled as normal.
This means we cannot just recreate the swapchain and reuse it to acquire
an image from the new swapchain as VulkanDisplay::display_queued_image()
was doing, because the spec states that the semaphore must be unsignaled
and not pending.
The fix here is to render and display the suboptimal image as normal and
set a flag to immediately return swapchain_image_out_of_date to trigger
a swapchain recreation on the next frame.1 parent c8ee20a commit f648c27
File tree
2 files changed
+11
-3
lines changed- src/video_display/vulkan
2 files changed
+11
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
544 | 544 | | |
545 | 545 | | |
546 | 546 | | |
| 547 | + | |
547 | 548 | | |
548 | 549 | | |
549 | | - | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
550 | 555 | | |
551 | 556 | | |
552 | 557 | | |
553 | 558 | | |
554 | 559 | | |
555 | 560 | | |
556 | | - | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
557 | 564 | | |
558 | 565 | | |
559 | 566 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
| 161 | + | |
161 | 162 | | |
162 | 163 | | |
163 | 164 | | |
| |||
199 | 200 | | |
200 | 201 | | |
201 | 202 | | |
202 | | - | |
| 203 | + | |
203 | 204 | | |
204 | 205 | | |
205 | 206 | | |
| |||
0 commit comments