Commit graph

1505 commits

Author SHA1 Message Date
Lubosz Sarnecki 260cfd8d26 d/vive/controller: Use u_json and move config to vive_config.
To be consistent with the headset implementation, move all config
related code to vive_config and use u_json consistently with static
string sizes.
2020-07-02 18:42:42 +02:00
Lubosz Sarnecki 53619fa64e d/vive/controller: Move prober interface to vive_prober.
Create propper initializer for the controller and move the proper
interface to vive_prober to be more consistent with the device. This
will also allow to share more code like the config parsing in a later
patch.
2020-07-02 18:42:42 +02:00
Lubosz Sarnecki f33c6356d7 d/vive: Rename vive_controller files.
To be more consistent with the rest of the driver, rename the controller
files to match the others style.
2020-07-02 18:42:42 +02:00
Lubosz Sarnecki eb51b89e9c d/vive_config: Move config and json related code to vive_config.
Isolate JSON config related code in vive_config.
2020-07-02 18:42:42 +02:00
Lubosz Sarnecki 2580958e2c d/vive: Use functions from u_json.
Uses the old and newly moved u_json functions.
Creates defines to keep short syntax.
Strings are now stored with static sizes in favor of being allocated
dynamically and not freed.
2020-07-02 18:42:42 +02:00
Lubosz Sarnecki bb52a673eb d/vive/controller: Parse vec3 correctly as arrays.
The u_json_get_vec3 function only works for json vec3 objects with x, y,
z members. The function unnoticedly returned false before.
2020-07-02 18:42:42 +02:00
Lubosz Sarnecki 166346ad6e u/json: Add u_json_get_matrix_3x3.
As seen in Vive driver.
2020-07-02 18:42:37 +02:00
Lubosz Sarnecki a9db6fbd40 u/json: Add fprintf error messages. 2020-07-02 18:42:37 +02:00
Lubosz Sarnecki 0bdd1133e4 u/json: Add u_json_get_vec3_array.
As seen in Vive driver.
2020-07-02 18:42:30 +02:00
Lubosz Sarnecki efd351f5c1 d/vive/controller: Initialize debug and spew before it's used. 2020-07-02 18:36:21 +02:00
Lubosz Sarnecki f9d92890ce d/vive: Fix crash on Vive Pro as it's missing a json key.
The key "lens_separation" is not available in my Vive Pro config.
2020-07-02 18:35:18 +02:00
Christoph Haag 08c6fe9744 d/vive_controller: Fix imu timestamp calculation
Philipp Zabel looked into it and it turns out the timestamp from the
imu sample should be the third byte, not the fourth.
2020-07-02 11:33:58 +02:00
Christoph Haag acdda780b6 d/vive_controller: implement remaining "gen2" input events
v2: document and clarify imu sample timestamp
2020-07-01 18:36:41 +02:00
Christoph Haag d8de19d4ae d/vive_controller: Add and set Index "Gen2" input names 2020-07-01 18:36:41 +02:00
Christoph Haag 184dd277bf bindings: Fix Index squeeze/force binding declaration 2020-07-01 18:36:41 +02:00
Jakob Bornecrantz 5bad87690f ipc: Avoid deadlocks due to render timing helper not getting data in time 2020-07-01 13:22:03 +01:00
Jakob Bornecrantz addeea2acf d/psmv: When in 3dof mode return angular and linear velocities 2020-06-26 10:41:13 +01:00
Christoph Haag c6d25a9773 st/oxr: Convert action timestamp with time_state_monotonic_to_ts_ns
Action timestamps were missing this conversion to XrTime with time_state_monotonic_to_ts_ns()
which caused them to be out of sync with the predicted frame times and device "pose at" timestamps.
2020-06-26 01:41:08 +02:00
Christoph Haag 2a9a14c605 d/survive: Report linear and angular velocities from survive 2020-06-26 01:41:08 +02:00
Christoph Haag b7ea0ce2b3 st/oxr: Support next-chained XrSpaceVelocity in XrSpaceLocation 2020-06-26 01:41:08 +02:00
Jakob Bornecrantz bf086f8be2 c/client: Add two new linear formats to OpenGL 2020-06-25 19:55:08 +00:00
Jakob Bornecrantz 0be1456b32 c/main: Add support for more linear formats and prioritize them better 2020-06-25 19:55:08 +00:00
Jakob Bornecrantz 70a6240d48 comp: Use a sRGB window swapchain 2020-06-25 19:55:08 +00:00
Jakob Bornecrantz f13f911e8a c/main: Implement prepare_session and poll_events 2020-06-25 15:48:34 +01:00
Pete Black bd5aa24463 xrt: Add multi client and overlay client support 2020-06-25 15:48:34 +01:00
Jakob Bornecrantz a26fa7bbdc c/client: Tidy whitespace 2020-06-25 12:58:22 +01:00
Jakob Bornecrantz 513ebd9957 ipc: Remove no longer used semaphore code (NFC) 2020-06-24 22:57:00 +01:00
Jakob Bornecrantz e59b4a1cb1 ipc: Use new frame timing code 2020-06-24 11:42:46 +01:00
Jakob Bornecrantz 83081f9cc1 u/render_timing: Add helper code for frame timing 2020-06-24 00:56:45 +01:00
Jakob Bornecrantz 3275f00464 st/oxr: Use a semaphore to ensure wait frame is released after begin frame has been called 2020-06-23 21:31:03 +01:00
Jakob Bornecrantz f5359b655e os/threading: Add semaphore 2020-06-23 21:31:03 +01:00
Jakob Bornecrantz ef282c7df2 os/time: Add function to convert to a timespec struct 2020-06-23 21:31:03 +01:00
Jakob Bornecrantz b75f4f844b xrt: Add frame_id to compositor frame calls 2020-06-23 21:31:00 +01:00
Jakob Bornecrantz 5ac0c7a139 xrt: Make prepare_session and poll_events return xrt_result_t 2020-06-23 12:39:57 +01:00
Jakob Bornecrantz 017e6738e0 d/psmv: Slightly improved locking and printing 2020-06-23 12:39:57 +01:00
Christoph Haag f31f1edde2 ipc: Set destroyed swapchains to not active
Fixes the service failing to create swapchains with "ERROR: Too many swapchains!"
after one or several sequentially started and quit clients created 32 swapchains.
2020-06-19 14:41:34 +02:00
Lubosz Sarnecki 0dbbe423d9 c/layer_renderer: Implement eye visibility. 2020-06-18 16:03:49 +01:00
Jakob Bornecrantz e76f698463 c/main: Respect alpha blending layer flag 2020-06-18 16:03:49 +01:00
Jakob Bornecrantz e8d62d948f aux/vk: Add helper to create image view with component swizzles 2020-06-18 13:48:10 +01:00
Jakob Bornecrantz 3055102217 tests: Use project code formatting on tests
v2: Increase line length, and add to formatting script (rpavlik)
2020-06-17 17:32:23 -05:00
Ryan Pavlik 726e446421 st/oxr: Make sure to clear action state metadata in case input is not active.
Also addresses some review comments on earlier changes.
2020-06-17 17:27:59 -05:00
Jakob Bornecrantz 5443e3a069 st/oxr: Work around stict-aliasing warning (NFC) 2020-06-17 12:20:30 +01:00
Christoph Haag 7a1dbbe8a1 st/oxr: Ensure quaternion is normalized in xrLocateViews()
In rare cases the state tracker's pose transformations resulted in a quaternion
that accumulated float precision errors such that the norm of the quaternion was
not within float precision of 1.0 anymore.

Introduce a function math_quat_ensure_normalized() that can be used after multiple
operations have been performed on a quaternion.
2020-06-17 13:03:34 +02:00
Ryan Pavlik 876c8bc5d7 inc/xrt: Remove now-unneeded enum. 2020-06-17 11:48:43 +01:00
Jakob Bornecrantz 17f40ecc26 st/oxr: Use the transformed boolean value 2020-06-17 11:48:43 +01:00
Ryan Pavlik 1a5d31b82b st/oxr: New input transform implementation, fixes conformance failures.
Includes unit tests for oxr_input_transform, add to CI

This is a revised implementation using "variants" instead of
"inheritance" in a linked-list.
2020-06-17 10:03:32 +00:00
Ryan Pavlik e011e86fb9 external: Add Catch2 header. 2020-06-17 10:03:32 +00:00
Christoph Haag fb103659ef build: Support building with v4l2 installed but driver disabled 2020-06-17 11:33:13 +02:00
Ryan Pavlik adbafad079 st/oxr: Rename the remaining oxr_source things to oxr_action 2020-06-16 16:42:38 -05:00
Jakob Bornecrantz d778c236fe c/client: A working but non-spec conforming way to get Vulkan clients working 2020-06-16 16:33:04 +01:00