The open source OpenXR runtime
0
fork

Configure Feed

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

c/main: Read preferred_at_least_image_count from an enviroment variable

Part-of: <https://gitlab.freedesktop.org/monado/monado/-/merge_requests/2452>

authored by

uvos and committed by
Marge Bot
4d89f991 d681358b

+18 -15
+18 -15
src/xrt/compositor/main/comp_target_swapchain.c
··· 13 13 14 14 #include "util/u_misc.h" 15 15 #include "util/u_pacing.h" 16 + #include "util/u_debug.h" 16 17 #include "util/u_pretty_print.h" 17 18 18 19 #include "vk/vk_surface_info.h" ··· 29 30 * Vulkan functions. 30 31 * 31 32 */ 33 + 34 + /* 35 + * For all direct mode outputs 2 is what we want since we want to run 36 + * lockstep with the display. Most direct mode swapchains only supports 37 + * FIFO mode, and since there is no commonly available Vulkan API to 38 + * wait for a specific VBLANK event, even just the latest, we can set 39 + * the number of images to two and then acquire immediately after 40 + * present. Since the old images are being displayed and the new can't 41 + * be flipped this will block until the flip has gone through. Crude but 42 + * works well enough on both AMD(Mesa) and Nvidia(Blob). 43 + * 44 + * When not in direct mode and display to a composited window we 45 + * probably want 3, but most compositors on Linux sets the minImageCount 46 + * to 3 anyways so we get what we want. 47 + */ 48 + DEBUG_GET_ONCE_NUM_OPTION(preferred_at_least_image_count, "XRT_COMPOSITOR_PREFERRED_IMAGE_COUNT", 2) 32 49 33 50 static inline struct vk_bundle * 34 51 get_vk(struct comp_target_swapchain *cts) ··· 715 732 extent.height = w2; 716 733 } 717 734 718 - /* 719 - * For all direct mode outputs 2 is what we want since we want to run 720 - * lockstep with the display. Most direct mode swapchains only supports 721 - * FIFO mode, and since there is no commonly available Vulkan API to 722 - * wait for a specific VBLANK event, even just the latest, we can set 723 - * the number of images to two and then acquire immediately after 724 - * present. Since the old images are being displayed and the new can't 725 - * be flipped this will block until the flip has gone through. Crude but 726 - * works well enough on both AMD(Mesa) and Nvidia(Blob). 727 - * 728 - * When not in direct mode and display to a composited window we 729 - * probably want 3, but most compositors on Linux sets the minImageCount 730 - * to 3 anyways so we get what we want. 731 - */ 732 - const uint32_t preferred_at_least_image_count = 2; 735 + const uint32_t preferred_at_least_image_count = debug_get_num_option_preferred_at_least_image_count(); 733 736 734 737 // Get the image count. 735 738 uint32_t image_count = select_image_count(cts, surface_caps, preferred_at_least_image_count);