···679679 }
680680681681 // Always print the first one.
682682- {
683683- static bool first = true;
684684- if (first) {
685685- vk_print_surface_info(vk, &info, U_LOGGING_INFO);
686686- first = false;
687687- } else {
688688- vk_print_surface_info(vk, &info, U_LOGGING_DEBUG);
689689- }
682682+ enum u_logging_level print_log_level = U_LOGGING_DEBUG;
683683+ if (!cts->has_logged_info) {
684684+ print_log_level = U_LOGGING_INFO;
685685+ cts->has_logged_info = true;
690686 }
687687+688688+ // Print info about the surface.
689689+ vk_print_surface_info(vk, &info, print_log_level);
691690692691 if (!check_surface_present_mode(cts, &info, cts->present_mode)) {
693692 // Free old.
···746745 * Do the creation.
747746 */
748747749749- COMP_DEBUG(ct->c, "Creating compositor swapchain with %d images", image_count);
750750-751748 // Create the swapchain now.
752749 VkSwapchainCreateInfoKHR swapchain_info = {
753750 .sType = VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR,
···771768 .oldSwapchain = old_swapchain_handle,
772769 };
773770771771+ // Print what we are creating.
772772+ vk_print_swapchain_create_info(vk, &swapchain_info, print_log_level);
773773+774774+ // Everything decided and logged, do the creation.
774775 ret = vk->vkCreateSwapchainKHR(vk->device, &swapchain_info, NULL, &cts->swapchain.handle);
775776776777 // Always destroy the old.
+6
src/xrt/compositor/main/comp_target_swapchain.h
···8787 //! Thread waiting on vblank_event_fence (first pixel out).
8888 struct os_thread_helper event_thread;
8989 } vblank;
9090+9191+ /*!
9292+ * We print swapchain info as INFO the first time we create a
9393+ * VkSWapchain, this keeps track if we have done it.
9494+ */
9595+ bool has_logged_info;
9096};
91979298
+4-4
src/xrt/compositor/main/comp_window_direct.c
···211211 },
212212 };
213213214214- VkResult result = vk->vkCreateDisplayPlaneSurfaceKHR(vk->instance, &surface_info, NULL, &cts->surface.handle);
215215-216216- free(plane_properties);
214214+ // This function is called seldom so ok to always print.
215215+ vk_print_display_surface_create_info(vk, &surface_info, U_LOGGING_INFO);
217216218218- return result;
217217+ // Everything decided and logged, do the creation.
218218+ return vk->vkCreateDisplayPlaneSurfaceKHR(vk->instance, &surface_info, NULL, &cts->surface.handle);
219219}
220220221221#ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT