The open source OpenXR runtime
0
fork

Configure Feed

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

c/main: Allow providing comp_target_factory in constructor

authored by

Patrick Nicolas and committed by
Jakob Bornecrantz
7a0d87db 76dff0b4

+16 -7
+5 -5
src/xrt/compositor/main/comp_compositor.c
··· 858 858 } 859 859 860 860 static bool 861 - compositor_init_window_pre_vulkan(struct comp_compositor *c) 861 + compositor_init_window_pre_vulkan(struct comp_compositor *c, struct comp_target_factory *selected_ctf) 862 862 { 863 863 COMP_TRACE_MARKER(); 864 - 865 - struct comp_target_factory *selected_ctf = NULL; 866 864 867 865 if (selected_ctf == NULL && !select_target_factory_from_settings(c, &selected_ctf)) { 868 866 return false; // Error! ··· 985 983 } 986 984 987 985 xrt_result_t 988 - comp_main_create_system_compositor(struct xrt_device *xdev, struct xrt_system_compositor **out_xsysc) 986 + comp_main_create_system_compositor(struct xrt_device *xdev, 987 + struct comp_target_factory *ctf, 988 + struct xrt_system_compositor **out_xsysc) 989 989 { 990 990 COMP_TRACE_MARKER(); 991 991 ··· 1041 1041 1042 1042 // clang-format off 1043 1043 if (!compositor_check_and_prepare_xdev(c, xdev) || 1044 - !compositor_init_window_pre_vulkan(c) || 1044 + !compositor_init_window_pre_vulkan(c, ctf) || 1045 1045 !compositor_init_vulkan(c) || 1046 1046 !compositor_init_render_resources(c)) { 1047 1047 COMP_ERROR(c, "Failed to init compositor %p", (void *)c);
+10 -1
src/xrt/compositor/main/comp_main_interface.h
··· 14 14 #include "xrt/xrt_device.h" 15 15 #include "xrt/xrt_compositor.h" 16 16 17 + struct comp_target_factory; 18 + 17 19 #ifdef __cplusplus 18 20 extern "C" { 19 21 #endif ··· 25 27 * 26 28 * @ingroup comp_main 27 29 * @relates xrt_system_compositor 30 + * 31 + * @param xdev The head device 32 + * @param ctf A compositor target factory to force the output device, must remain valid for the lifetime of the 33 + * compositor. If NULL, factory is automatically selected 34 + * @param out_xsysc The output compositor 28 35 */ 29 36 xrt_result_t 30 - comp_main_create_system_compositor(struct xrt_device *xdev, struct xrt_system_compositor **out_xsysc); 37 + comp_main_create_system_compositor(struct xrt_device *xdev, 38 + struct comp_target_factory *ctf, 39 + struct xrt_system_compositor **out_xsysc); 31 40 32 41 33 42 #ifdef __cplusplus
+1 -1
src/xrt/targets/common/target_instance.c
··· 86 86 87 87 #ifdef XRT_FEATURE_COMPOSITOR_MAIN 88 88 if (xret == XRT_SUCCESS && xsysc == NULL) { 89 - xret = comp_main_create_system_compositor(head, &xsysc); 89 + xret = comp_main_create_system_compositor(head, NULL, &xsysc); 90 90 } 91 91 #else 92 92 if (!use_null) {