Loading vulkan/libvulkan/swapchain.cpp +27 −9 Original line number Original line Diff line number Diff line Loading @@ -944,16 +944,34 @@ VkResult GetPhysicalDeviceSurfaceCapabilities2KHR( return VK_ERROR_SURFACE_LOST_KHR; return VK_ERROR_SURFACE_LOST_KHR; } } if (pPresentMode && IsSharedPresentMode(pPresentMode->presentMode)) { if(pPresentMode != nullptr) { capabilities->minImageCount = 1; switch (pPresentMode->presentMode) { capabilities->maxImageCount = 1; case VK_PRESENT_MODE_IMMEDIATE_KHR: } else if (pPresentMode && pPresentMode->presentMode == VK_PRESENT_MODE_MAILBOX_KHR) { ALOGE("Swapchain present mode VK_PRESENT_MODE_IMMEDIATE_KHR is not supported"); break; case VK_PRESENT_MODE_MAILBOX_KHR: case VK_PRESENT_MODE_FIFO_KHR: capabilities->minImageCount = capabilities->minImageCount = std::min(max_buffer_count, min_undequeued_buffers + 2); std::min(max_buffer_count, min_undequeued_buffers + 2); capabilities->maxImageCount = static_cast<uint32_t>(max_buffer_count); capabilities->maxImageCount = static_cast<uint32_t>(max_buffer_count); break; case VK_PRESENT_MODE_FIFO_RELAXED_KHR: ALOGE("Swapchain present mode VK_PRESENT_MODE_FIFO_RELEAXED_KHR " "is not supported"); break; case VK_PRESENT_MODE_SHARED_DEMAND_REFRESH_KHR: case VK_PRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR: capabilities->minImageCount = 1; capabilities->maxImageCount = 1; break; default: ALOGE("Unrecognized swapchain present mode %u is not supported", pPresentMode->presentMode); break; } } else { } else { capabilities->minImageCount = capabilities->minImageCount = std::min(max_buffer_count, min_undequeued_buffers + 2); std::min(max_buffer_count, min_undequeued_buffers + 1); capabilities->maxImageCount = static_cast<uint32_t>(max_buffer_count); capabilities->maxImageCount = static_cast<uint32_t>(max_buffer_count); } } } } Loading Loading
vulkan/libvulkan/swapchain.cpp +27 −9 Original line number Original line Diff line number Diff line Loading @@ -944,16 +944,34 @@ VkResult GetPhysicalDeviceSurfaceCapabilities2KHR( return VK_ERROR_SURFACE_LOST_KHR; return VK_ERROR_SURFACE_LOST_KHR; } } if (pPresentMode && IsSharedPresentMode(pPresentMode->presentMode)) { if(pPresentMode != nullptr) { capabilities->minImageCount = 1; switch (pPresentMode->presentMode) { capabilities->maxImageCount = 1; case VK_PRESENT_MODE_IMMEDIATE_KHR: } else if (pPresentMode && pPresentMode->presentMode == VK_PRESENT_MODE_MAILBOX_KHR) { ALOGE("Swapchain present mode VK_PRESENT_MODE_IMMEDIATE_KHR is not supported"); break; case VK_PRESENT_MODE_MAILBOX_KHR: case VK_PRESENT_MODE_FIFO_KHR: capabilities->minImageCount = capabilities->minImageCount = std::min(max_buffer_count, min_undequeued_buffers + 2); std::min(max_buffer_count, min_undequeued_buffers + 2); capabilities->maxImageCount = static_cast<uint32_t>(max_buffer_count); capabilities->maxImageCount = static_cast<uint32_t>(max_buffer_count); break; case VK_PRESENT_MODE_FIFO_RELAXED_KHR: ALOGE("Swapchain present mode VK_PRESENT_MODE_FIFO_RELEAXED_KHR " "is not supported"); break; case VK_PRESENT_MODE_SHARED_DEMAND_REFRESH_KHR: case VK_PRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR: capabilities->minImageCount = 1; capabilities->maxImageCount = 1; break; default: ALOGE("Unrecognized swapchain present mode %u is not supported", pPresentMode->presentMode); break; } } else { } else { capabilities->minImageCount = capabilities->minImageCount = std::min(max_buffer_count, min_undequeued_buffers + 2); std::min(max_buffer_count, min_undequeued_buffers + 1); capabilities->maxImageCount = static_cast<uint32_t>(max_buffer_count); capabilities->maxImageCount = static_cast<uint32_t>(max_buffer_count); } } } } Loading