@@ -612,7 +612,7 @@ namespace ApiWithoutSecrets {
612
612
// Set of images defined in a swap chain may not always be available for application to render to:
613
613
// One may be displayed and one may wait in a queue to be presented
614
614
// If application wants to use more images at the same time it must ask for more images
615
- uint32_t image_count = surface_capabilities.minImageCount + 1 ;
615
+ uint32_t image_count = surface_capabilities.minImageCount + 2 ;
616
616
if ( (surface_capabilities.maxImageCount > 0 ) &&
617
617
(image_count > surface_capabilities.maxImageCount ) ) {
618
618
image_count = surface_capabilities.maxImageCount ;
@@ -699,13 +699,20 @@ namespace ApiWithoutSecrets {
699
699
}
700
700
701
701
VkPresentModeKHR VulkanCommon::GetSwapChainPresentMode ( std::vector<VkPresentModeKHR> &present_modes ) {
702
- // FIFO present mode is always available
703
702
// MAILBOX is the lowest latency V-Sync enabled mode (something like triple-buffering) so use it if available
704
703
for ( VkPresentModeKHR &present_mode : present_modes ) {
705
704
if ( present_mode == VK_PRESENT_MODE_MAILBOX_KHR ) {
706
705
return present_mode;
707
706
}
708
707
}
708
+ // IMMEDIATE mode allows us to display frames in a V-Sync independent manner so it can introduce screen tearing
709
+ // But this mode is the best for benchmarking purposes if we want to check the real number of FPS
710
+ for ( VkPresentModeKHR &present_mode : present_modes ) {
711
+ if ( present_mode == VK_PRESENT_MODE_IMMEDIATE_KHR ) {
712
+ return present_mode;
713
+ }
714
+ }
715
+ // FIFO present mode is always available
709
716
for ( VkPresentModeKHR &present_mode : present_modes ) {
710
717
if ( present_mode == VK_PRESENT_MODE_FIFO_KHR ) {
711
718
return present_mode;
0 commit comments