Implement Display Settings + Attach Texture to FenceCycle

This commit is contained in:
PixelyIon
2021-06-20 03:44:43 +05:30
committed by ◱ Mark
parent b2bb855a02
commit e511e158e3
10 changed files with 178 additions and 157 deletions

View File

@ -69,7 +69,7 @@ namespace skyline::gpu {
}
void PresentationEngine::UpdateSwapchain(texture::Format format, texture::Dimensions extent) {
auto minImageCount{std::max(vkSurfaceCapabilities.minImageCount, state.settings->forceTripleBuffering ? 3U : 0U)};
auto minImageCount{std::max(vkSurfaceCapabilities.minImageCount, state.settings->forceTripleBuffering ? 3U : 2U)};
if (minImageCount > MaxSwapchainImageCount)
throw exception("Requesting swapchain with higher image count ({}) than maximum slot count ({})", minImageCount, MaxSwapchainImageCount);
@ -99,13 +99,14 @@ namespace skyline::gpu {
.imageUsage = presentUsage,
.imageSharingMode = vk::SharingMode::eExclusive,
.compositeAlpha = vk::CompositeAlphaFlagBitsKHR::eInherit,
.presentMode = vk::PresentModeKHR::eMailbox,
.presentMode = state.settings->disableFrameThrottling ? vk::PresentModeKHR::eMailbox : vk::PresentModeKHR::eFifo,
.clipped = true,
});
auto vkImages{vkSwapchain->getImages()};
if (vkImages.size() > MaxSwapchainImageCount)
throw exception("Swapchain has higher image count ({}) than maximum slot count ({})", minImageCount, MaxSwapchainImageCount);
state.logger->Error("Buffer Count: {}", vkImages.size());
for (size_t index{}; index < vkImages.size(); index++) {
auto &slot{images[index]};