The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

c/main: Prefer only two swapchain images

+16 -1
+16 -1
src/xrt/compositor/main/comp_target_swapchain.c
··· 719 719 extent.height = w2; 720 720 } 721 721 722 + /* 723 + * For all direct mode outputs 2 is what we want since we want to run 724 + * lockstep with the display. Most direct mode swapchains only supports 725 + * FIFO mode, and since there is no commonly available Vulkan API to 726 + * wait for a specific VBLANK event, even just the latest, we can set 727 + * the number of images to two and then acquire immediately after 728 + * present. Since the old images are being displayed and the new can't 729 + * be flipped this will block until the flip has gone through. Crude but 730 + * works well enough on both AMD(Mesa) and Nvidia(Blob). 731 + * 732 + * When not in direct mode and display to a composited window we 733 + * probably want 3, but most compositors on Linux sets the minImageCount 734 + * to 3 anyways so we get what we want. 735 + */ 736 + const uint32_t preferred_at_least_image_count = 2; 737 + 722 738 // Get the image count. 723 - const uint32_t preferred_at_least_image_count = 3; 724 739 uint32_t image_count = select_image_count(cts, surface_caps, preferred_at_least_image_count); 725 740 726 741