The open source OpenXR runtime
0
fork

Configure Feed

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

a/vk: Annotate some must-check-return functions

+41 -40
+3 -3
src/xrt/auxiliary/vk/vk_bundle_init.c
··· 826 826 * 827 827 */ 828 828 829 - VkResult 829 + XRT_CHECK_RESULT VkResult 830 830 vk_create_device(struct vk_bundle *vk, 831 831 int forced_index, 832 832 bool only_compute, ··· 992 992 return VK_SUCCESS; 993 993 } 994 994 995 - VkResult 995 + XRT_CHECK_RESULT VkResult 996 996 vk_init_cmd_pool(struct vk_bundle *vk) 997 997 { 998 998 VkCommandPoolCreateInfo cmd_pool_info = { ··· 1017 1017 * 1018 1018 */ 1019 1019 1020 - VkResult 1020 + XRT_CHECK_RESULT VkResult 1021 1021 vk_init_from_given(struct vk_bundle *vk, 1022 1022 PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr, 1023 1023 VkInstance instance,
+13 -13
src/xrt/auxiliary/vk/vk_helpers.c
··· 38 38 #define ENUM_TO_STR(r) \ 39 39 case r: return #r 40 40 41 - const char * 41 + XRT_CHECK_RESULT const char * 42 42 vk_result_string(VkResult code) 43 43 { 44 44 switch (code) { ··· 72 72 } 73 73 } 74 74 75 - const char * 75 + XRT_CHECK_RESULT const char * 76 76 vk_format_string(VkFormat code) 77 77 { 78 78 switch (code) { ··· 331 331 } 332 332 } 333 333 334 - const char * 334 + XRT_CHECK_RESULT const char * 335 335 vk_format_feature_string(VkFormatFeatureFlagBits code) 336 336 { 337 337 switch (code) { ··· 345 345 } 346 346 } 347 347 348 - const char * 348 + XRT_CHECK_RESULT const char * 349 349 xrt_swapchain_usage_string(enum xrt_swapchain_usage_bits code) 350 350 { 351 351 switch (code) { ··· 361 361 } 362 362 } 363 363 364 - const char * 364 + XRT_CHECK_RESULT const char * 365 365 vk_present_mode_string(VkPresentModeKHR code) 366 366 { 367 367 switch (code) { ··· 375 375 } 376 376 } 377 377 378 - const char * 378 + XRT_CHECK_RESULT const char * 379 379 vk_power_state_string(VkDisplayPowerStateEXT code) 380 380 { 381 381 switch (code) { ··· 386 386 } 387 387 } 388 388 389 - const char * 389 + XRT_CHECK_RESULT const char * 390 390 vk_color_space_string(VkColorSpaceKHR code) 391 391 { 392 392 switch (code) { ··· 395 395 } 396 396 } 397 397 398 - bool 398 + XRT_CHECK_RESULT bool 399 399 vk_has_error(VkResult res, const char *fun, const char *file, int line) 400 400 { 401 401 if (res != VK_SUCCESS) { ··· 446 446 return false; 447 447 } 448 448 449 - VkResult 449 + XRT_CHECK_RESULT VkResult 450 450 vk_alloc_and_bind_image_memory(struct vk_bundle *vk, 451 451 VkImage image, 452 452 size_t max_size, ··· 657 657 return ret; 658 658 } 659 659 660 - VkResult 660 + XRT_CHECK_RESULT VkResult 661 661 vk_create_image_from_native(struct vk_bundle *vk, 662 662 const struct xrt_swapchain_create_info *info, 663 663 struct xrt_image_native *image_native, ··· 896 896 #error "Needs port" 897 897 #endif 898 898 899 - VkResult 899 + XRT_CHECK_RESULT VkResult 900 900 vk_get_native_handle_from_device_memory(struct vk_bundle *vk, 901 901 VkDeviceMemory device_memory, 902 902 xrt_graphics_buffer_handle_t *out_handle) ··· 1175 1175 return ret; 1176 1176 } 1177 1177 1178 - VkResult 1178 + XRT_CHECK_RESULT VkResult 1179 1179 vk_submit_cmd_buffer(struct vk_bundle *vk, VkCommandBuffer cmd_buffer) 1180 1180 { 1181 1181 VkResult ret = VK_SUCCESS; ··· 1231 1231 return ret; 1232 1232 } 1233 1233 1234 - VkResult 1234 + XRT_CHECK_RESULT VkResult 1235 1235 vk_locked_submit(struct vk_bundle *vk, VkQueue queue, uint32_t count, const VkSubmitInfo *infos, VkFence fence) 1236 1236 { 1237 1237 VkResult ret;
+17 -16
src/xrt/auxiliary/vk/vk_helpers.h
··· 19 19 20 20 #pragma once 21 21 22 + #include "xrt/xrt_compiler.h" 22 23 #include "xrt/xrt_compositor.h" 23 24 #include "xrt/xrt_vulkan_includes.h" 24 25 #include "xrt/xrt_handles.h" ··· 384 385 * 385 386 */ 386 387 387 - const char * 388 + XRT_CHECK_RESULT const char * 388 389 vk_result_string(VkResult code); 389 390 390 - const char * 391 + XRT_CHECK_RESULT const char * 391 392 vk_format_string(VkFormat code); 392 393 393 - const char * 394 + XRT_CHECK_RESULT const char * 394 395 vk_present_mode_string(VkPresentModeKHR code); 395 396 396 - const char * 397 + XRT_CHECK_RESULT const char * 397 398 vk_power_state_string(VkDisplayPowerStateEXT code); 398 399 399 - const char * 400 + XRT_CHECK_RESULT const char * 400 401 vk_color_space_string(VkColorSpaceKHR code); 401 402 402 - const char * 403 + XRT_CHECK_RESULT const char * 403 404 vk_format_feature_string(VkFormatFeatureFlagBits code); 404 405 405 - const char * 406 + XRT_CHECK_RESULT const char * 406 407 xrt_swapchain_usage_string(enum xrt_swapchain_usage_bits code); 407 408 408 409 ··· 430 431 * 431 432 * @ingroup aux_vk 432 433 */ 433 - bool 434 + XRT_CHECK_RESULT bool 434 435 vk_has_error(VkResult res, const char *fun, const char *file, int line); 435 436 436 437 /*! ··· 587 588 * 588 589 * @ingroup aux_vk 589 590 */ 590 - VkResult 591 + XRT_CHECK_RESULT VkResult 591 592 vk_create_device(struct vk_bundle *vk, 592 593 int forced_index, 593 594 bool only_compute, ··· 619 620 * 620 621 * @ingroup aux_vk 621 622 */ 622 - VkResult 623 + XRT_CHECK_RESULT VkResult 623 624 vk_init_cmd_pool(struct vk_bundle *vk); 624 625 625 626 /*! ··· 628 629 * 629 630 * @ingroup aux_vk 630 631 */ 631 - VkResult 632 + XRT_CHECK_RESULT VkResult 632 633 vk_init_from_given(struct vk_bundle *vk, 633 634 PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr, 634 635 VkInstance instance, ··· 690 691 * 691 692 * @ingroup aux_vk 692 693 */ 693 - VkResult 694 + XRT_CHECK_RESULT VkResult 694 695 vk_alloc_and_bind_image_memory(struct vk_bundle *vk, 695 696 VkImage image, 696 697 size_t max_size, ··· 720 721 * 721 722 * @ingroup aux_vk 722 723 */ 723 - VkResult 724 + XRT_CHECK_RESULT VkResult 724 725 vk_create_image_from_native(struct vk_bundle *vk, 725 726 const struct xrt_swapchain_create_info *info, 726 727 struct xrt_image_native *image_native, ··· 740 741 * 741 742 * @ingroup aux_vk 742 743 */ 743 - VkResult 744 + XRT_CHECK_RESULT VkResult 744 745 vk_get_native_handle_from_device_memory(struct vk_bundle *vk, 745 746 VkDeviceMemory device_memory, 746 747 xrt_graphics_buffer_handle_t *out_handle); ··· 863 864 * 864 865 * @ingroup aux_vk 865 866 */ 866 - VkResult 867 + XRT_CHECK_RESULT VkResult 867 868 vk_submit_cmd_buffer(struct vk_bundle *vk, VkCommandBuffer cmd_buffer); 868 869 869 870 /*! ··· 873 874 * 874 875 * @ingroup aux_vk 875 876 */ 876 - VkResult 877 + XRT_CHECK_RESULT VkResult 877 878 vk_locked_submit(struct vk_bundle *vk, VkQueue queue, uint32_t count, const VkSubmitInfo *infos, VkFence fence); 878 879 879 880 /*!
+7 -7
src/xrt/auxiliary/vk/vk_sync_objects.c
··· 73 73 * 74 74 */ 75 75 76 - bool 76 + XRT_CHECK_RESULT bool 77 77 vk_can_import_and_export_timeline_semaphore(struct vk_bundle *vk) 78 78 { 79 79 #ifdef VK_KHR_timeline_semaphore ··· 101 101 * 102 102 */ 103 103 104 - VkResult 104 + XRT_CHECK_RESULT VkResult 105 105 vk_create_and_submit_fence_native(struct vk_bundle *vk, xrt_graphics_sync_handle_t *out_native) 106 106 { 107 107 xrt_graphics_sync_handle_t native = XRT_GRAPHICS_SYNC_HANDLE_INVALID; ··· 276 276 return VK_SUCCESS; 277 277 } 278 278 279 - VkResult 279 + XRT_CHECK_RESULT VkResult 280 280 vk_create_semaphore_and_native(struct vk_bundle *vk, VkSemaphore *out_sem, xrt_graphics_sync_handle_t *out_native) 281 281 { 282 282 VkExternalSemaphoreHandleTypeFlagBits handle_type = 0; ··· 296 296 } 297 297 298 298 #ifdef VK_KHR_timeline_semaphore 299 - VkResult 299 + XRT_CHECK_RESULT VkResult 300 300 vk_create_timeline_semaphore_and_native(struct vk_bundle *vk, 301 301 VkSemaphore *out_sem, 302 302 xrt_graphics_sync_handle_t *out_native) ··· 332 332 * 333 333 */ 334 334 335 - VkResult 335 + XRT_CHECK_RESULT VkResult 336 336 vk_create_fence_sync_from_native(struct vk_bundle *vk, xrt_graphics_sync_handle_t native, VkFence *out_fence) 337 337 { 338 338 VkFence fence = VK_NULL_HANDLE; ··· 450 450 return VK_SUCCESS; 451 451 } 452 452 453 - VkResult 453 + XRT_CHECK_RESULT VkResult 454 454 vk_create_semaphore_from_native(struct vk_bundle *vk, xrt_graphics_sync_handle_t native, VkSemaphore *out_sem) 455 455 { 456 456 VkExternalSemaphoreHandleTypeFlagBits handle_type = 0; ··· 472 472 } 473 473 474 474 #ifdef VK_KHR_timeline_semaphore 475 - VkResult 475 + XRT_CHECK_RESULT VkResult 476 476 vk_create_timeline_semaphore_from_native(struct vk_bundle *vk, xrt_graphics_sync_handle_t native, VkSemaphore *out_sem) 477 477 { 478 478 VkExternalSemaphoreHandleTypeFlagBits handle_type = 0;
+1 -1
src/xrt/auxiliary/vk/vk_time.c
··· 54 54 * 55 55 */ 56 56 57 - VkResult 57 + XRT_CHECK_RESULT VkResult 58 58 vk_convert_timestamps_to_host_ns(struct vk_bundle *vk, uint32_t count, uint64_t *in_out_timestamps) 59 59 { 60 60 VkResult ret;