···13131414#include "util/u_misc.h"
1515#include "util/u_pacing.h"
1616+#include "util/u_debug.h"
1617#include "util/u_pretty_print.h"
17181819#include "vk/vk_surface_info.h"
···2930 * Vulkan functions.
3031 *
3132 */
3333+3434+/*
3535+ * For all direct mode outputs 2 is what we want since we want to run
3636+ * lockstep with the display. Most direct mode swapchains only supports
3737+ * FIFO mode, and since there is no commonly available Vulkan API to
3838+ * wait for a specific VBLANK event, even just the latest, we can set
3939+ * the number of images to two and then acquire immediately after
4040+ * present. Since the old images are being displayed and the new can't
4141+ * be flipped this will block until the flip has gone through. Crude but
4242+ * works well enough on both AMD(Mesa) and Nvidia(Blob).
4343+ *
4444+ * When not in direct mode and display to a composited window we
4545+ * probably want 3, but most compositors on Linux sets the minImageCount
4646+ * to 3 anyways so we get what we want.
4747+ */
4848+DEBUG_GET_ONCE_NUM_OPTION(preferred_at_least_image_count, "XRT_COMPOSITOR_PREFERRED_IMAGE_COUNT", 2)
32493350static inline struct vk_bundle *
3451get_vk(struct comp_target_swapchain *cts)
···715732 extent.height = w2;
716733 }
717734718718- /*
719719- * For all direct mode outputs 2 is what we want since we want to run
720720- * lockstep with the display. Most direct mode swapchains only supports
721721- * FIFO mode, and since there is no commonly available Vulkan API to
722722- * wait for a specific VBLANK event, even just the latest, we can set
723723- * the number of images to two and then acquire immediately after
724724- * present. Since the old images are being displayed and the new can't
725725- * be flipped this will block until the flip has gone through. Crude but
726726- * works well enough on both AMD(Mesa) and Nvidia(Blob).
727727- *
728728- * When not in direct mode and display to a composited window we
729729- * probably want 3, but most compositors on Linux sets the minImageCount
730730- * to 3 anyways so we get what we want.
731731- */
732732- const uint32_t preferred_at_least_image_count = 2;
735735+ const uint32_t preferred_at_least_image_count = debug_get_num_option_preferred_at_least_image_count();
733736734737 // Get the image count.
735738 uint32_t image_count = select_image_count(cts, surface_caps, preferred_at_least_image_count);