mirror of
https://github.com/Takiiiiiiii/strato.git
synced 2025-07-17 08:46:39 +00:00
Only allow submitting swapchainImageCount
images for host present at a time
Prevents situations where nothing would otherwise be waiting on the GPU and since presentation no longer blocks too many images would be submitted for presentation.
This commit is contained in:
@ -121,8 +121,12 @@ namespace skyline::gpu {
|
||||
throw exception("Setting the buffer transform to '{}' failed with {}", ToString(frame.transform), result);
|
||||
windowTransform = frame.transform;
|
||||
|
||||
auto &acquireSemaphore{acquireSemaphores[acquireSemaphoreIndex]};
|
||||
acquireSemaphoreIndex = (acquireSemaphoreIndex + 1) % swapchainImageCount;
|
||||
auto &acquireSemaphore{acquireSemaphores[frameIndex]};
|
||||
auto &frameFence{frameFences[frameIndex]};
|
||||
if (frameFence)
|
||||
frameFence->Wait();
|
||||
|
||||
frameIndex = (frameIndex + 1) % swapchainImageCount;
|
||||
|
||||
std::pair<vk::Result, u32> nextImage;
|
||||
while (nextImage = vkSwapchain->acquireNextImage(std::numeric_limits<u64>::max(), *acquireSemaphore, {}), nextImage.first != vk::Result::eSuccess) [[unlikely]] {
|
||||
@ -142,6 +146,8 @@ namespace skyline::gpu {
|
||||
.layerCount = 1,
|
||||
});
|
||||
|
||||
frameFence = nextImageTexture->cycle;
|
||||
|
||||
auto getMonotonicNsNow{[]() -> i64 {
|
||||
timespec time;
|
||||
if (clock_gettime(CLOCK_MONOTONIC, &time))
|
||||
|
Reference in New Issue
Block a user