The open source OpenXR runtime
0
fork

Configure Feed

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

c/main: Handle signal semaphore being null

This is needed for targets that doesn't have semaphores,
like the debug image target introduced in the next commit.

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

+15 -4
+15 -4
src/xrt/compositor/main/comp_renderer.c
··· 1 1 // Copyright 2019-2024, Collabora, Ltd. 2 + // Copyright 2024-2025, NVIDIA CORPORATION. 2 3 // SPDX-License-Identifier: BSL-1.0 3 4 /*! 4 5 * @file ··· 680 681 wait_sem_count = WAIT_SEMAPHORE_COUNT; 681 682 } 682 683 684 + #define SIGNAL_SEMAPHRE_COUNT 1 685 + VkSemaphore signal_sems[SIGNAL_SEMAPHRE_COUNT] = {ct->semaphores.render_complete}; 686 + 687 + uint32_t signal_sem_count = 0; 688 + VkSemaphore *signal_sems_ptr = NULL; 689 + if (signal_sems[0] != VK_NULL_HANDLE) { 690 + signal_sems_ptr = signal_sems; 691 + signal_sem_count = SIGNAL_SEMAPHRE_COUNT; 692 + } 693 + 683 694 // Next pointer for VkSubmitInfo 684 695 const void *next = NULL; 685 696 686 697 #ifdef VK_KHR_timeline_semaphore 687 698 assert(!comp_frame_is_invalid_locked(&r->c->frame.rendering)); 688 - uint64_t render_complete_signal_values[WAIT_SEMAPHORE_COUNT] = {(uint64_t)frame_id}; 699 + uint64_t render_complete_signal_values[SIGNAL_SEMAPHRE_COUNT] = {(uint64_t)frame_id}; 689 700 690 701 VkTimelineSemaphoreSubmitInfoKHR timeline_info = { 691 702 .sType = VK_STRUCTURE_TYPE_TIMELINE_SEMAPHORE_SUBMIT_INFO_KHR, ··· 694 705 if (ct->semaphores.render_complete_is_timeline) { 695 706 timeline_info = (VkTimelineSemaphoreSubmitInfoKHR){ 696 707 .sType = VK_STRUCTURE_TYPE_TIMELINE_SEMAPHORE_SUBMIT_INFO_KHR, 697 - .signalSemaphoreValueCount = WAIT_SEMAPHORE_COUNT, 708 + .signalSemaphoreValueCount = signal_sem_count, 698 709 .pSignalSemaphoreValues = render_complete_signal_values, 699 710 }; 700 711 ··· 711 722 .waitSemaphoreCount = wait_sem_count, 712 723 .commandBufferCount = 1, 713 724 .pCommandBuffers = &cmd, 714 - .signalSemaphoreCount = 1, 715 - .pSignalSemaphores = &ct->semaphores.render_complete, 725 + .signalSemaphoreCount = signal_sem_count, 726 + .pSignalSemaphores = signal_sems_ptr, 716 727 }; 717 728 718 729 // Everything prepared, now we are submitting.