Commit graph

828 commits

Author SHA1 Message Date
Antonio Ospite d20f8f4363 st/oxr: fix building on linux with OPENGL_GLX OFF
When building on linux and OPENGL_GLX OFF compilation fails with the
following error:

-----------------------------------------------------------------------
../../state_trackers/oxr/libst_oxr.a(oxr_session_gfx_gl.c.o): In function `oxr_session_populate_gl_xlib':
oxr_session_gfx_gl.c:(.text+0x5c): undefined reference to `xrt_gfx_provider_create_gl_xlib'
collect2: error: ld returned 1 exit status
src/xrt/targets/openxr/CMakeFiles/openxr_monado.dir/build.make:126: recipe for target 'src/xrt/targets/openxr/libopenxr_monado.so' failed
make[2]: *** [src/xrt/targets/openxr/libopenxr_monado.so] Error 1
CMakeFiles/Makefile2:2490: recipe for target 'src/xrt/targets/openxr/CMakeFiles/openxr_monado.dir/all' failed
make[1]: *** [src/xrt/targets/openxr/CMakeFiles/openxr_monado.dir/all] Error 2
Makefile:145: recipe for target 'all' failed
make: *** [all] Error 2
-----------------------------------------------------------------------

Apparently the gl_xlib backend really depends on GLX specifically, so
fix the issue by reflecting that in the conditionally compiled blocks.
2021-11-13 12:16:29 +00:00
Ryan Pavlik 4957f6577f st/p: Migrate num_ to _count 2021-11-13 12:04:38 +00:00
Ryan Pavlik 469b9d907d st/oxr: Rename all num_ in the state tracker, too. 2021-11-13 12:04:38 +00:00
Ryan Pavlik 33c0287f8b xrt: Rename all "num" parameters and fields to "count" (or "capacity" as appropriate)
This matches the OpenXR usage: the array is the plural of the element type,
and the count is the singular element type plus "count" (usually CountOutput
because of the two-call idiom)

Includes fixes to other code to match API changes.
2021-11-13 12:04:38 +00:00
Mateo de Mayo 87a1198b0a misc: Address compilation warnings and fix u_json_get_bool 2021-11-12 15:33:06 -03:00
Ryan Pavlik cc4007a69e cmake: Substantial cleanups and simplifications
We now have a cmake-format config file.
We no longer use list variables for sources, instead using
target_sources when we need to add, in accordance with current
best practice. (This makes it a lot easier to edit too.) There's no more
include_directories(), add_definitions(), or other gently-deprecated
directory-scoped commands, nor any CMake scripts that include
a parent directory reference (named targets instead)
2021-11-12 09:48:37 -06:00
Ryan Pavlik 19947a2d27 cmake: Refactor how we build imgui 2021-11-12 09:38:50 -06:00
Ryan Pavlik b180b244e3 st/oxr: Populate oxr_system's blend modes list from the system compositor, not the device. 2021-11-12 03:05:10 +00:00
Jakob Bornecrantz 5554b0fa00 st/prober: Fix warning and tidy code 2021-11-10 11:32:54 +00:00
Nima01 2a1e6debfb st/prober: Support for querying of 'Product name' from Bluetooth devices. 2021-11-09 01:10:20 +00:00
Jakob Bornecrantz 551c1f19a9 st/prober: Depend on VF driver since we refer to it directly 2021-11-08 13:07:22 +00:00
Mateo de Mayo f407536279 st/prober: Hook the realsense SLAM source into the prober 2021-10-28 11:40:49 +00:00
Mateo de Mayo 0202cb9223 st/prober: Improve usage of SLAM tracking frameservers
Use a similar "hardcoded" idea as in p_factory_ensure_frameserver.
This fix usage of SLAM sources in other contexts like calibration, at the
cost of requiring a device to call create_tracked_slam at least once.
(again, similar to how psmv/psvr/hand tracking work already)
2021-10-28 11:40:49 +00:00
Christoph Haag cbc018239b st/gui: Fix editing tracking override when tracker is not connected
Fixes an assertion.
2021-10-28 11:21:58 +00:00
Christoph Haag 8da1b10010 st/gui: More consistent variable names in tracking overrides 2021-10-28 11:21:58 +00:00
Christoph Haag 9f7ef73429 st/gui: better wording for tracking override delete button 2021-10-28 11:21:58 +00:00
Ryan Pavlik 409541427d st/oxr: MSVC-specialized version of macro in oxr_xrResultToString 2021-10-19 16:49:23 -05:00
Moses Turner d440a23888 d/dai: rename things to either 'monocular' or 'grayscale' 2021-10-13 16:26:26 -05:00
Jakob Bornecrantz 0d07971ebb st/gui: Make it possible to use depthAI as a stereo and single source 2021-10-13 15:47:48 -05:00
Jakob Bornecrantz 21f6842e49 st/gui: Add some debugging to the paranoia 2021-10-12 20:44:32 +01:00
Moses Turner 8fdeaccbc7 st/oxr: Switch to new get_hand_tracking signature 2021-10-02 23:06:43 +01:00
Moses Turner e134b24f8f u/var: Add u_var_draggable_f32 2021-10-02 23:05:35 +01:00
Jakob Bornecrantz 9a4cc80e87 st/prober: Tidy and re-order functions 2021-09-29 21:38:33 +00:00
Jakob Bornecrantz 874d48a810 st/prober: Add some tracing functions 2021-09-29 21:38:33 +00:00
Mateo de Mayo e561d312f6 st/prober: Handle SLAM tracker creation failure for the Euroc player
This also adds a do-nothing section to `p_factory_create_tracked_slam`
that could be replicated by new SLAM frame servers.
2021-09-28 16:06:58 -03:00
Jakob Bornecrantz de283a8b0c t/calibration: Add support for findChessboardCornersSB 2021-09-20 15:54:00 +00:00
Christoph Haag d54c489738 st/oxr: Enumerate outputs too in xrEnumerateBoundSourcesForAction
Fixes #118
2021-09-20 00:28:46 +02:00
Jakob Bornecrantz 7e8428a4d2 st/gui: Remove U_VAR_SINK support 2021-09-17 15:27:23 +01:00
Jakob Bornecrantz b0b4034a93 st/gui: Add support for u_sink_debug 2021-09-17 15:27:23 +01:00
Jakob Bornecrantz bef417b5a8 st/gui: Handle setting recording info from the first frame 2021-09-17 15:27:23 +01:00
Jakob Bornecrantz 2b72672cc2 st/gui: Expose bitrate as a combobox in recording window 2021-09-17 15:27:15 +01:00
Jakob Bornecrantz 7a6412672d st/gui: Refactor out recording code into own window 2021-09-17 13:39:50 +01:00
Mateo de Mayo 78e8d3177c st/prober: Use euroc stream for SLAM tracking 2021-09-15 19:03:55 +00:00
Mateo de Mayo 549c59a493 t/slam: Add SLAM tracking module 2021-09-15 19:03:55 +00:00
Christoph Haag fb6cf9b4cc st/oxr: Only advertise hand tracking funcs if compiled with ext 2021-09-13 21:28:01 +01:00
Christoph Haag 2b7e8d8dce st/oxr: Add ifdef for XR_EXT_hand_tracking 2021-09-13 21:27:58 +01:00
Christoph Haag d114b8bb34 st/oxr: Move XR_EXT_thermal_query #endif to the correct place 2021-09-13 21:27:54 +01:00
Mateo de Mayo d9482d0b76 u/var: Add f64 kind 2021-09-13 18:59:03 +01:00
Mateo de Mayo 91db53572b st/prober: Make euroc start by hooking it into the prober 2021-08-27 18:39:37 +01:00
Mateo de Mayo de3bfc193d u/var: Add button and u64 var kinds
Also: fix on_ff_vec3_var
2021-08-27 13:02:18 +00:00
Mateo de Mayo 167fe78af0 st/gui: Handle NULL pdev in video listing scene. 2021-08-27 13:02:18 +00:00
Christoph Haag 7c285be9e8 st/oxr: Support XR_SWAPCHAIN_USAGE_INPUT_ATTACHMENT_BIT_KHR
Trivial, because XR_SWAPCHAIN_USAGE_INPUT_ATTACHMENT_BIT_MND and
XR_SWAPCHAIN_USAGE_INPUT_ATTACHMENT_BIT_KHR enum values are aliased.
2021-08-27 02:38:05 +02:00
Christoph Haag 5e0891404e scripts: Add XR_KHR_swapchain_usage_input_attachment_bit extension 2021-08-27 02:21:58 +02:00
Jakob Bornecrantz 8225539178 st/gui: Make sure to unreference any frames pending for upload 2021-08-20 17:35:32 +01:00
Jakob Bornecrantz 36a8f949d5 st/gui: Make sure to add ogl texture sink to context 2021-08-20 17:18:42 +01:00
Jakob Bornecrantz ea2aa56af8 st/oxr: Add debug variable for adding extra sleep in wait frame 2021-08-17 12:04:49 +01:00
Christoph Haag 162915f022 p/prober: disable all drivers when qwerty is enabled
qwerty is auto probed, making HMDs that are not auto probed always take precedence.
When setting QWERTY_ENABLE=1 the intent is usually to exclusively use qwerty.
Therefore we default to disabling all other drivers when this variable is set.

To make the old behavior of adding qwerty devices with lower priority than actual
devices, the variable QWERTY_COMBINE=1 is introduced.
2021-07-16 15:15:28 +00:00
Christoph Haag bc8ac9ca3c st/oxr: Use OXR_MAX_BINDINGS_PER_ACTION instead of hardcoded 32
The hardcoded value 32 was actually wrong and caused a warning

../src/xrt/state_trackers/oxr/oxr_input.c:668:9: warning: 'oxr_binding_find_bindings_from_key' accessing 256 bytes in a region of size 128 [-Wstringop-overflow=]
  668 |         oxr_binding_find_bindings_from_key(log, profile, act->act_key, binding_points, &num);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2021-07-15 01:08:20 +02:00
Christoph Haag e2e13b7ac3 st/gui: Don't access first vec3 member as float array
It produces a warning

../src/xrt/state_trackers/gui/gui_scene_debug.c:141:9: warning: ‘igInputFloat3’ accessing 12 bytes in a region of size 4 [-Wstringop-overflow=]
  141 |         igInputFloat3(name, (float *) &value.x, "%+f", ImGuiInputTextFlags_ReadOnly);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2021-07-15 00:59:09 +02:00
Jakob Bornecrantz f725924723 st/gui: Make it possible to select the DepthAI camera in Video select UI 2021-07-13 15:01:00 +00:00
Jakob Bornecrantz 6beb57bf98 st/gui: Add support to record from ELP 3D camera 2021-07-13 15:01:00 +00:00
Jakob Bornecrantz 33563ccb7e st/gui: Correct order of arguments to xrt_fs_stream_start 2021-07-13 15:01:00 +00:00
Jakob Bornecrantz ae3a2179b9 st/gui: Check that we actually opened the video device 2021-07-13 15:01:00 +00:00
Jakob Bornecrantz 9e5df0f504 st/oxr: Calculate normalized sub-image offsets and sizes 2021-07-10 17:59:17 +01:00
Jakob Bornecrantz 390b06b22a st/oxr: Put all sub-image handling in one place (NFC) 2021-07-10 17:59:17 +01:00
Jakob Bornecrantz 570e7a5702 st/oxr: Tidy oxr_session_frame_end.c (NFC) 2021-07-10 17:59:17 +01:00
Jakob Bornecrantz 189aea97aa st/oxr: Refactor out end frame function into own file 2021-07-10 17:59:17 +01:00
Jakob Bornecrantz b8d88113c2 st/oxr: Add gfx to session gfx files 2021-07-10 17:59:17 +01:00
Christoph Haag 250ef94d71 st/oxr: Don't go to READY after EXITING
The STOPPING state has two possible follow up paths:

STOPPING -> IDLE -> READY
STOPPING -> IDLE -> EXITING

After EXITING, the application must call xrDestroySession; there is no meaningful
session state after EXITING.

To go to the READY state again, the application should first create a new session.

Applications that are lazy and drain the entire event queue and only handle
the last encountered state would be affected by "skipping" the EXITING state.
2021-07-02 15:19:00 +00:00
Christoph Haag bcc50dbd4f st/oxr: Add checks for Vulkan graphics bindings 2021-06-25 01:10:25 +02:00
Moses Turner d555b255fe st/gui: Add support for depthAI camera in record scene
Co-authored-by: Jakob Bornecrantz <jakob@collabora.com>
2021-06-10 14:32:07 -05:00
quic_zhibinw 76cf6aeae4 st/oxr: Transform projection layer pose to global space. 2021-06-10 17:08:04 +08:00
Ryan Pavlik 2c87f57ad1 cmake: Make sure st_oxr exposes its optional vulkan/gl dependencies
Fixes builds of tests on Windows
2021-06-08 12:05:23 -05:00
Christoph Haag f6e831d8fb steamvr: Don't crash if we don't have bindings for device 2021-05-13 14:08:24 +02:00
Christoph Haag 28a29f8152 st/oxr: Fix xrGetSystemProperties crash in headless mode
fixes #125

v2: Handle sys->xsysc being NULL
2021-05-11 02:10:58 +02:00
Christoph Haag d384c90104 st/oxr: Check that VkPhysicalDevice in graphics binding matches suggested device
XR_KHR_vulkan_enable2:
physicalDevice VkPhysicalDevice must match the device specified by xrGetVulkanGraphicsDevice2KHR

XR_KHR_vulkan_enable:
physicalDevice VkPhysicalDevice must match the device specified by xrGetVulkanGraphicsDeviceKHR

XR_KHR_vulkan_enable:
Add a trivial check that xrGetVulkanGraphicsDeviceKHR is called before xrCreateSession.
(our cached suggested device will be XR_NULL_HANDLE if it has not been called).
The XR_KHR_vulkan_enable2 code path already contains this check.
2021-05-07 13:42:49 +02:00
Jakob Bornecrantz e0bf0a423f st/oxr: Make Vulkan optional 2021-04-30 21:53:21 +00:00
Jakob Bornecrantz 4e572af96a st/oxr: Rename oxr_session_views to oxr_session_locate_views (NFC) 2021-04-27 01:44:16 +01:00
Jakob Bornecrantz 4da87635d1 st/oxr: Tidy xrLocateViews function 2021-04-27 01:44:16 +01:00
Ryan Pavlik 3cfaa2ea9f st/oxr: Port to using new zero/identity defines 2021-04-26 22:38:42 +00:00
Ryan Pavlik 3df2708a5d st/gui: Add missing copyright header to file 2021-04-26 14:08:57 +00:00
Christoph Haag 08c91d4136 st/oxr: Fix printing of the format in error message 2021-04-26 14:54:30 +02:00
Christoph Haag 686d12d66f p/prober: Print info for applied tracking override 2021-04-19 12:53:47 +02:00
Christoph Haag cffd009fe9 st/gui: Add tracker pose input name selection 2021-04-19 12:53:46 +02:00
Jakob Bornecrantz cabaece344 st/oxr: Print value on bad layer type 2021-04-15 21:27:13 +00:00
Jakob Bornecrantz 74c9531d4f st/oxr: Use right enum for ret check 2021-04-15 17:38:06 +01:00
Jakob Bornecrantz f434de27bd st/gui: Fix warning (false positive) 2021-04-15 17:38:05 +01:00
Jakob Bornecrantz 7c77625da9 st/oxr: Set visibility and z_order if multi compositor controls are available 2021-04-13 16:56:17 +00:00
Ryan Pavlik 43e0206abc st/oxr: Implement loader init extension. 2021-04-13 11:33:50 -05:00
Ryan Pavlik 142a9b4cb5 st/oxr: Add XR_KHR_loader_init and ..._android extension 2021-04-13 11:33:50 -05:00
Moses Turner 1062ef35fc st/oxr: switch blend mode to array 2021-04-11 04:08:49 -05:00
Ryan Pavlik 0450e317e1 cmake: prober requires drv_multi now. 2021-04-09 18:16:39 -05:00
Ryan Pavlik b56441702c st/oxr: Clean up Android message. 2021-04-09 18:11:52 +01:00
Christoph Haag e7f82c297a st/oxr: Fix running when only one hand suports hand tracking 2021-04-08 20:32:55 +02:00
Jakob Bornecrantz efdba1602f xrt: Pass along display_time_ns to layer begin 2021-04-07 00:50:10 +01:00
Jakob Bornecrantz 5c15b60cf2 st/oxr: Add more trace markers 2021-04-07 00:50:10 +01:00
Jakob Bornecrantz 1b0d67a895 st/gui: Add recording interface 2021-04-03 03:07:21 +01:00
Jakob Bornecrantz fac93948b3 st/gui: Add STB image writing support 2021-04-03 03:07:21 +01:00
Christoph Haag 91a3d8b9cb st/steamvr: Add rift controllers 2021-04-02 15:48:10 +00:00
Christoph Haag 7ce07aeedf st/oxr: Support all known interaction profiles in selection
Remove the default case to generate a compiler warning when new profiles
are missing.
2021-04-02 15:48:10 +00:00
Christoph Haag 85ff0dc73c xrt: Add msft_hand_interaction path to cache and check func 2021-04-02 15:48:10 +00:00
Jakob Bornecrantz cebc8ebed5 st/oxr: No longer need to work around depth Swapchain on Unreal 2021-04-02 16:00:42 +01:00
Moses Turner 6a833b1131 st/oxr+xrt: add is_active to struct xrt_hand_joint_set to give drivers an easy way to deactivate hands 2021-04-01 02:02:26 +02:00
Christoph Haag 4061bf7707 d/multi: Add "attached" tracking override type
Example usage: Leap Motion attached to a Northstar headset.
2021-04-01 02:02:26 +02:00
Jakob Bornecrantz 967c27060e st/prober: Change log env variable and set default level to info 2021-03-30 21:27:29 +01:00
Mateo de Mayo 12d52193da d/qwerty: Connect the debug UI to the Qwerty driver
It was necessary to add a list of xdevs to oxr_sdl2_hack_start and to
populate such list from its callees.
That includes sdl2_program.gui_program->xdevs which was not being filled
for the monado-service target.
2021-03-29 15:41:25 -03:00
Ryan Pavlik 08b0fd257f st/oxr: Fix doxygen warning 2021-03-26 17:10:53 -05:00
Ryan Pavlik 6fc4cc0cc9 st/prober: Fix doxygen warnings 2021-03-26 17:10:53 -05:00
Ryan Pavlik a830f46db0 st/prober: Fix warnings 2021-03-26 17:06:17 -05:00
Ryan Pavlik 8ebd97330d st/steamvr: Fix warnings 2021-03-26 17:06:17 -05:00
Christoph Haag e8999b06c8 st/p: Change tracking override target/tracker not found error->warning 2021-03-24 18:45:00 +00:00
Christoph Haag 030230eba9 st/p: change PSVR/PSMV not set up error->info 2021-03-24 18:45:00 +00:00
Jakob Bornecrantz 63f5c86257 xrt: Make xrt_swapchain be reference counted 2021-03-24 17:50:08 +00:00
Jakob Bornecrantz e066f6a828 st/gui: Fix warning 2021-03-24 14:09:13 +00:00
Jakob Bornecrantz 6c3ab4151a st/oxr: Handle XRT_ERROR_EGL_CONFIG_MISSING 2021-03-12 00:06:36 +00:00
Jakob Bornecrantz 8be59f73ec xrt: Return xrt_result_t from xrt_gfx_provider_create_gl_egl 2021-03-12 00:06:36 +00:00
Christoph Haag 1e24602ca0 st/prober: fix off by one in reallocating list of disabled drivers 2021-03-09 13:22:41 +01:00
Jakob Bornecrantz f754fb583f st/oxr: Trace markers 2021-03-08 11:20:52 +00:00
Mateo de Mayo 75e908552f doc: Fix missing entities from modules documentation 2021-03-06 20:34:35 -03:00
Christoph Haag 44e375dd8a aux/util: Save tracking override config 2021-03-02 19:43:19 +01:00
Christoph Haag c077788436 aux/util: Store calibration config non-destructively
On save
* delete only nodes pertaining to calibration
* add new calibration nodes
* write config file
2021-03-02 19:43:19 +01:00
Christoph Haag de169bf575 gui: Add gui for tracking overrides 2021-03-02 19:43:19 +01:00
Christoph Haag 5e4c62c8aa aux/util: Move json config parsing to aux/util 2021-03-02 19:43:19 +01:00
Christoph Haag aa9298f70d aux/util: Move read_content to u_file 2021-03-02 19:43:19 +01:00
Christoph Haag ff16eab9df xrt: implement multi device wrappers for tracking overrides
Example config ~/.config/monado/config_v0.json

{
	"active": "tracking",
	"tracking":	{
		"version":	0,
		"tracking_overrides": [
			{
				"target_device_serial": "LHR-E8CC625B",
				"tracker_device_serial": "LHR-1D80A098",
				"offset": {
					"orientation": {
						"x": 0,
						"y": 0,
						"z": 0,
						"w": 1
					},
					"position": {
						"x": 0,
						"y": 0,
						"z": 0
					}
				}
			}
		]
	}
}

v2: Add multi device wrapper
2021-03-02 19:43:19 +01:00
Christoph Haag 13db11901c d/rs: Add prober and create xrt_device for rs 2021-03-02 19:43:19 +01:00
Christoph Haag 9332bb04c8 st/prober: Disable vive driver when we have survive
Unless survive is disabled via config, then don't disable vive.
2021-03-02 17:50:19 +00:00
Christoph Haag ebd4b8eae4 st/prober: Add ability to skip drivers
Only for drivers loaded with probers and autoprobers for now.

Example config:

{
	"disabled": [
		"survive"
	]
}
2021-03-02 17:50:19 +00:00
Christoph Haag 58e68e0a4a st/prober: Allow querying entries and autoprobers 2021-03-02 17:50:19 +00:00
Christoph Haag ea404a265b st/prober: Print name of misbehaving autoprober 2021-03-02 17:50:19 +00:00
Mateo de Mayo 116d77f52e st/prober: Allow autoprobe function to create more than one device. 2021-02-28 15:27:52 +00:00
Jakob Bornecrantz 4cf20b0dd3 imgui: Add implot demo 2021-02-22 23:20:05 +00:00
Jakob Bornecrantz 5b61a9b905 st/oxr: Fix crash 2021-02-16 22:53:49 +00:00
Jakob Bornecrantz 2849c7c5ae st/oxr: Quirk UnrealEngine 2021-02-16 17:55:23 +00:00
Jakob Bornecrantz 4ef6211286 st/oxr: Detect UnrealEngine 2021-02-16 17:55:23 +00:00
Jakob Bornecrantz 0ee32dfa21 st/oxr: Log application info 2021-02-16 17:55:23 +00:00
Jakob Bornecrantz cfed1c3607 st/oxr: It's not a error to pass in XrSystemHandTrackingPropertiesEXT
...when the hand tracking extension is not enabled.
2021-02-16 07:04:40 +00:00
Christoph Haag def0bef533 build/meson: Explicitly depend on generated binding header
fixes header not being generated on alpine
2021-02-15 22:04:38 +01:00
Jakob Bornecrantz a6fe8e8b1e st/prober: Clarify xrt_prober_get_string_descriptor 2021-02-15 16:13:06 +00:00
Jakob Bornecrantz 165df31d77 st/prober: Use U_LOG_RAW for dump function 2021-02-15 15:13:51 +00:00
Christoph Haag c6695b7a27 prober: return XRT_PROBER_STRING_SERIAL_NUMBER for bluetooth devices
Using the bluetooth id gotten from uevent.
2021-02-15 14:54:54 +01:00
Christoph Haag a4bde60e08 st/steamvr: Use serial number for controller id 2021-02-12 00:38:52 +01:00
Jakob Bornecrantz 35da4a51ea d/vf: Refactor code to add videotestsrc capability and break out gstreamer detection 2021-02-02 13:53:48 +00:00
Jakob Bornecrantz 8c6075e3b6 monado: Update version 2021-01-28 16:02:50 +00:00
Jakob Bornecrantz bd257500b8 d/v4l2: Expose more information 2021-01-27 16:09:07 +00:00
Christoph Haag b3592f112c st/oxr: Check swapchain format support in st 2021-01-27 01:19:31 +01:00
Christoph Haag b64b6f75fe comp: Return proper errors for OpenGL xrCreateSwapchain 2021-01-26 15:26:47 +00:00
Christoph Haag cb352839e3 st/oxr: cache VkInstance in xrGetVulkanGraphicsDeviceKHR
The problem:
* xrCreateVulkanDeviceKHR is passed a VkPhysicalDevice, but not a VkInstance.
* xrGetVulkanGraphicsDevice2KHR is passed a VkInstance and returns a VkPhysicalDevice
  that is a child of that instance.
* xrCreateVulkanDeviceKHR must verify that the xrGetVulkanGraphicsDevice2KHR
  has been called and that the passed VkPhysicalDevice matches the one returned
  by xrGetVulkanGraphicsDevice2KHR.

We have to consider:
* xrCreateVulkanDeviceKHR has to work on the "correct" VkInstance, which the passed
  VkPhysicalDevice is a child of.

The reqirement

> If the vulkanPhysicalDevice parameter does not match the output of
> xrGetVulkanGraphicsDeviceKHR, then the runtime must return XR_ERROR_HANDLE_INVALID.

is not 100% clear whether calling xrCreateVulkanInstance multiple times is allowed
and how a second call to xrGetVulkanGraphicsDevice2KHR with a dfferent VkInstance
should be handled.

For this implementation xrCreateVulkanDeviceKHR will only consider the most recent call
to xrGetVulkanGraphicsDevice2KHR and the VkInstance that was used for this call.
This enforces at least that VkPhysicalDevice is a child of the cached VkInstance when
xrCreateVulkanDeviceKHR is called, because using a different VkPhysicalDevice would be
an error.
2021-01-26 03:45:43 +01:00
Jakob Bornecrantz cb51b32ff1 st/oxr: Tidy code
The CHECK_LAYER_TYPE tests would falsely pass on the
IPC layer as it always implements all of the functions.
2021-01-22 14:16:12 +00:00
Christoph Haag f326ec8fc3 st/oxr: Check XrHandJointLocationsEXT::jointLocations for NULL 2021-01-22 03:34:40 +01:00
Jakob Bornecrantz 3e028a7952 st/oxr: Correctly validate quats to be within 1% of unit length 2021-01-21 00:33:32 +00:00
Christoph Haag 46ec938f8a build: Move bindings build to bindings/subdir
The generated files should be in auxiliary/bindings/*.{c,h}. For this to work
meson.build has to be in the bindings/ subdir:
https://github.com/mesonbuild/meson/issues/2320

Move CMakeLists.txt there too for some consistency.
Also fixes the previous include hack.
2021-01-20 18:23:09 +01:00
Christoph Haag 07218c9878 aux: generate b_generated_bindings.{c,h} instead of xrt_generated_bindings.{c,h}
Follow up to 543804e53cafa83c52b61f70894696bc4d95fa7c
2021-01-20 18:23:09 +01:00
Christoph Haag 06e7e7e832 steamvr: Implement support for and default to generated input profile 2021-01-20 18:23:09 +01:00
Christoph Haag edd6a4cf70 xrt: Move oxr_binding_data.h to json profile generator
Move json profile generator to auxiliary/bindings and make generated_bindings static library.

aux/bindings: Add hardware type

aux/bindings: Add various steamvr specific things to bindings
Paths like "/input/menu/click" are used in SteamVR input profiles.
2021-01-20 18:23:09 +01:00
Christoph Haag 1b597bdd65 st/oxr: Rename sub_path variables to subaction_path
Subaction paths are the /user/X/Y part of the full path describing the input source/device.
"Subaction paths are a mechanism that enables applications to use the same action name and handle on multiple devices. Applications can query action state using subaction paths that differentiate data coming from each device."

Subpaths, are the input or output specific part of the full path, e.g.
"Each input source path must match the following pattern: …/input/<identifier>[_<location>][/<component>]"
2021-01-20 18:23:09 +01:00
Christoph Haag 5764365427 steamvr: Use simple vibration as fallback 2021-01-20 18:23:09 +01:00
Christoph Haag 609b834670 steamvr: Add comment about pose time offset 2021-01-20 18:23:09 +01:00
Jakob Bornecrantz afea93f297 xrt: Remove prepare function from xrt_compositor 2021-01-20 15:04:09 +00:00
Jakob Bornecrantz 2b8c835b68 xrt: Introduce xrt_system_compositor 2021-01-20 15:04:09 +00:00