Commit graph

784 commits

Author SHA1 Message Date
Christoph Haag 2959747221 u_config_json: clarify json not parsed error message 2021-03-24 18:45:00 +00:00
Christoph Haag f0132eb997 u_config_json: change no config file warning->info
Running without a config file is fully supported, no reason to warn users.
2021-03-24 18:45:00 +00:00
Christoph Haag dad5c6d5d8 u_config_json: Fix saving when no config file exists
If json->root was null, it would write a config file containing only (null).
2021-03-24 17:33:46 +01:00
Christoph Haag 2ac4ff84ec aux/util: Fix comment for u_device_setup_tracking_origins 2021-03-23 19:05:35 +00:00
Jakob Bornecrantz a71b3d35d1 m/3dof: Add assert for timestamp paranoia 2021-03-17 01:10:02 +00:00
Jakob Bornecrantz dac5bc0ea5 u/timing: Deal slightly better when timing info appears to time travel 2021-03-10 17:53:36 +00:00
Jakob Bornecrantz d71ccc39ce u/timing: Add when_predict_ns on first frame 2021-03-10 17:53:36 +00:00
Christoph Haag 0adcc179c0 xrt: Fix typo in u_file 2021-03-10 01:56:07 +01:00
Jakob Bornecrantz a40c2e7d50 aux/vk: Load VK_GOOGLE_display_timing functions 2021-03-08 11:20:52 +00:00
Jakob Bornecrantz 049f6be351 u/timing: Add frame timing code 2021-03-08 11:20:52 +00:00
Jakob Bornecrantz 3077660f1d u/tracing: Add trace marker code 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 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
Jakob Bornecrantz 77baa0c6ca u/ht: Sort build files 2021-02-24 14:33:34 +00:00
Jakob Bornecrantz 7460ae54f4 u/timing: Rename files 2021-02-24 14:33:34 +00:00
Jakob Bornecrantz b810c2df0a u/timing: Improve render code, predict when frame should be delivered 2021-02-24 14:33:30 +00:00
Jakob Bornecrantz 55c7690185 u/time: Make defines more readable and add more defines 2021-02-24 13:55:07 +00:00
Jakob Bornecrantz 69eebb49e2 u/time: Use double for time conversion 2021-02-24 04:14:51 +00:00
Ryan Pavlik b7cc966cb0 aux/vk: Add docs to helpers 2021-02-22 16:50:00 -06: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
Christoph Haag 42996d6b1c os/hid: Add get_physical_address() 2021-02-12 02:44:00 +01:00
Christoph Haag 2d814dab57 aux/vive: Parse hmd variant and add various model strings
Model strings collected from libsurvive, survive_default_devices.c
2021-02-11 20:54:31 +01:00
Christoph Haag cc81174b70 comp: Fix VkDisplayKHR direct mode build without libx11-xcb 2021-02-10 22:02:30 +01:00
Ryan Pavlik 51704bc2e5 math: Fix doc warnings 2021-02-10 16:09:12 +00:00
Christoph Haag cfab11355d u/hand_tracking: Hand Joint flags can only be as valid as hand flags 2021-02-10 02:58:00 +01:00
zhibinw a5913c7b4f aux/android:add blank line between functions 2021-02-09 22:44:07 +00:00
zhibinw 14532aceae aux/android: Make MonadoView focusable optional 2021-02-09 22:44:07 +00:00
zhibinw 6e6a729123 aux/android: Make MonadoView not focusable/touchable 2021-02-09 22:44:07 +00:00
Christoph Haag 00ef724392 aux/vk: Add trace info when memory type is unsupported 2021-02-03 01:44:46 +01:00
Jakob Bornecrantz 5853103820 d/vive: Refactor out vive config code into auxiliary library
fix vive_config.h include for survive
2021-02-01 19:56:52 +01:00
Jakob Bornecrantz eec3446e5b u/sink: Add Bayer format converter 2021-01-27 16:09:07 +00:00
Jakob Bornecrantz 5b6e6bf6a6 xrt: Add XRT_FORMAT_BAYER_GR8 format 2021-01-27 16:09:07 +00:00
Jakob Bornecrantz 666caaa7ae u/timing: Fix typo 2021-01-27 14:04:29 +00:00
Jakob Bornecrantz b1e18af21e u/distortion: Tidy Vive & Index distortion code 2021-01-25 00:12:03 +00:00
Dan Weatherford 5948e439e9 u/distortion: Fix DPOLY3_SCALED 4th coefficient application 2021-01-25 00:12:03 +00:00
Jakob Bornecrantz 17beaf8aa9 u/distortion: A stab in the dark to try and improve Index chromatic aberration 2021-01-25 00:12:03 +00:00
Jakob Bornecrantz 7d755427e3 u/distortion: Filp order of array access in distortion for Vive & Index 2021-01-25 00:12:03 +00:00
Jakob Bornecrantz 0c2d07808c u/distortion: Make Vive & Index distortion center per channel 2021-01-25 00:12:03 +00:00
Dan Weatherford b2569907b5 u/distortion: Fix math error in u_compute_distortion_vive 2021-01-23 14:02:31 -06:00
Jakob Bornecrantz 026fa2cebb math: Add quat valdiate that only checks within 1% of unit length 2021-01-21 00:33:32 +00:00
Jakob Bornecrantz 797fa5459c u/rt: Tidy and documment render timing code 2021-01-21 00:32:36 +00:00
Jakob Bornecrantz 3856ae4540 bindings: Fix double slash error 2021-01-21 00:13:42 +00:00
Jakob Bornecrantz 00b71aabd4 bindings: Update copyrights 2021-01-21 00:13:40 +00:00
Christoph Haag f9c37d51bc aux/bindings: Add "features" to inputs in bindings.json
In our model we have a "subpath" for each hardware input like "/input/trackpad".
Each of these hardware inputs has "features" like "click", "touch", "position", "force".

Ideally each of these "features" is bound to some monado input in the "monado_bindings" dict
but this is not required. bindings.json will know about hardware features even if we don't bind them (yet).

For each of these features bindings.py generates a group of related paths for a single monado binding:
For a monado input XRT_INPUT_???_TRACKPAD these paths would be generated:
/user/hand/left/input/trackpad/x
/user/hand/left/input/trackpad/y
/user/hand/left/input/trackpad
2021-01-20 18:23:09 +01: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 85d3e8bdc3 build/cmake: generate steamvr input profiles 2021-01-20 18:23:09 +01:00
Christoph Haag 334864de7f build/meson: Generate SteamVR input profiles 2021-01-20 18:23:09 +01:00
Christoph Haag 672c81e809 aux/bindings: Add script to generate steamvr input profiles 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
Jakob Bornecrantz ae6ac5fc0e math: Work-around clang-format stuff 2021-01-15 16:38:52 +00:00
Jakob Bornecrantz 2b996f30c4 xrt: Reflow after column change 2021-01-15 13:50:32 +00:00
Lubosz Sarnecki 621a4bbe59 aux/vk: Add formats used in CTS to format string function. 2021-01-14 13:54:19 +01:00
Lubosz Sarnecki a786401bec aux/vk: Lock vkCmdPipelineBarrier with pool mutex. 2021-01-14 13:54:19 +01:00
Lubosz Sarnecki b005f4e2fa comp/vk: Guard VkCommandBuffer usage with command pool mutex.
Lock all queue submits with 2 mutexes using a new vk_locked_submit
function.
2021-01-13 12:42:26 +01:00
Lubosz Sarnecki fc3b7fef25 comp/vk: Lock command pool calls with a mutex.
This patch resolves multithreading issues as detected by the Vulkan
validation when running the OpenXR CTS using OpenGL.
2021-01-13 12:33:15 +01:00
Lubosz Sarnecki 9a9d46b85a comp/vk: Lock our only VkQueue with a mutex.
This resolved mutlithreading issues as seen in the `multithreading` test
of the OpenXR CTS.

This patch fixes the test on Vulkan Android and resolves Vulkan
validation errors when running on Linux with OpenGL.
2021-01-13 12:33:15 +01:00
Christoph Haag e785053c0a aux/math: special case delta_s == 0 in m_predic
Rather than asserting in the underlying math functions we return the
trivial values for prediction with 0s.
2021-01-11 23:50:01 +00:00
Jakob Bornecrantz 1e4a540bb9 aux/math: Add prediction module
For the time being all angular velocities are relative to the space a xrt_space_relation is in.
2021-01-11 23:50:01 +00:00
Christoph Haag 8f3816a5fc u_time: Make time_s_to_ns take double, not floa 2021-01-11 23:50:01 +00:00
Christoph Haag 726c752db2 comp: Add support for list of optional device extensions
If one of the supplied optional extensions is VK_GOOGLE_display_timing and it is
supported by the driver, vk_bundle::has_GOOGLE_display_timing will be set to true.
2021-01-07 19:12:41 +01:00
Christoph Haag 3085e29c97 u/hand_tracking: Curl fingers based on joint, increase total curl angle
When making a fist, different joints curl at different angles, reflect
this more directly in the code.

Also increase total curl to make it easier to hold ingame objects.
2021-01-06 13:34:31 +00:00
Christoph Haag e2c1bc1d16 xrt: Rename hand_origin to hand_pose
hand_origin is confusing because it implies it is the origin of the coordinate system the hand is in.
It actually is the hand pose in the "global" coordinate system.
2021-01-06 13:29:36 +00:00
Christoph Haag c84dbad03e u/device: Add U_DEVICE_ALLOC_NO_FLAGS
Allows using U_DEVICE_ALLOCATE without flags without a cast.
2021-01-06 13:29:36 +00:00
Christoph Haag 7831e38c02 u/device: Assign left/right hand trackers if no controllers are available
Previously the left/right role assignment considered only device types
* XRT_DEVICE_TYPE_LEFT_HAND_CONTROLLER
* XRT_DEVICE_TYPE_RIGHT_HAND_CONTROLLER
* XRT_DEVICE_TYPE_ANY_HAND_CONTROLLER

This adds XRT_DEVICE_TYPE_HAND_TRACKER for consideration, but only if none
of the above are present.
2021-01-06 13:29:36 +00:00
Christoph Haag 3848d2be3f st/oxr: Add env vars for global tracking origin offset
This commit is a band aid until a more proper room setup is implemented.
It allows moving the tracking offset for the device roles head, left and right by a fixed value.

A y tracking offset OXR_TRACKING_ORIGIN_OFFSET_Y=1.0 would tell monado that the current tracking
origin is 1 meter above the desired tracking origin, e.g. when the headset was calibrated to a
(0,0,0) position while sitting on table 1 meter above the floor.

This environment variable affects STAGE space, but not LOCAL space.
2021-01-06 13:03:47 +00:00
Lubosz Sarnecki 55d6d57392 aux/math: Port to u_logging. 2020-12-28 13:04:11 +00:00
Lubosz Sarnecki ba1d966f9f aux/vk: Port to u_logging.
Fix log calls where no valid state struct was provided.
2020-12-28 13:04:11 +00:00
Lubosz Sarnecki 58ecf67515 aux/tracking: Port to u_logging. 2020-12-28 13:04:11 +00:00
Lubosz Sarnecki e350e42ca9 aux/os/ble_dbus: Use printf padding. 2020-12-28 13:04:11 +00:00
Lubosz Sarnecki 79dde59f7e aux/os/ble_dbus: Port to u_logging. 2020-12-28 13:04:11 +00:00
Lubosz Sarnecki 853458ed37 xrt: Port commented printfs to u_logging. 2020-12-28 13:04:11 +00:00
Lubosz Sarnecki adcd0aff1a u/logging: Implement global log level.
Adds a `XRT_LOG` environemnt option.

Example:
```
XRT_LOG=debug
```
2020-12-28 13:04:11 +00:00
Lubosz Sarnecki 8bdff9a61a u/logging: Implement optional color logging.
Check if stderr is a tty.
2020-12-28 13:04:11 +00:00
Lubosz Sarnecki 9ce9fa9238 u/logging: Align log level prefixes. 2020-12-28 13:04:11 +00:00
Jakob Bornecrantz a5bf14502c t/hand: Remove per frame printing 2020-12-09 21:03:50 +00:00
Christoph Haag 7b4ac89a8f t/hand: warn when rectification matrix doesn't match image matrix 2020-12-07 12:30:26 +00:00
Christoph Haag 693cd77ca3 t/hand: Add comment that rectification is expensive 2020-12-07 12:30:26 +00:00
Christoph Haag e480352cee t/hand: Add hand tracking module 2020-12-07 12:30:26 +00:00
Ryan Pavlik 90e307bf8a util: Port logging to OutputDebugString on Windows 2020-12-06 23:07:05 +00:00
Lubosz Sarnecki 37e87d1942 android/MonadoView: Make native pointer optional. 2020-12-01 18:05:32 +01:00
Lubosz Sarnecki 0a6bfe6d96 aux/android_globals: Provide API to store a native window globally. 2020-12-01 18:05:32 +01:00
Lubosz Sarnecki 020df327fa MonadoView: Don't be a Hilt view. Resolve exception.
Resolves:

java.lang.IllegalStateException: class org.freedesktop.monado.auxiliary.MonadoView, Hilt view must be attached to an @AndroidEntryPoint Fragment or Activity.
2020-12-01 18:05:32 +01:00
Ryan Pavlik 94d747cac9 aux/android: Create an interface for handling foreground service notification 2020-12-01 18:05:32 +01:00
Ryan Pavlik 2fe699d7c1 xrt/android: Actually start using dependency injection in Java/Kotlin code. 2020-12-01 18:05:32 +01:00
Ryan Pavlik 885dd1d4d5 gradle: Handle kotlin in multiple parts of the build 2020-12-01 18:05:32 +01:00
Ryan Pavlik b2f751ae99 aux/android: More null checks 2020-12-01 18:05:31 +01:00
Ryan Pavlik 635542f905 gradle: Break release build on a // STOPSHIP comment 2020-12-01 18:05:31 +01:00
Ryan Pavlik 23e01fc656 gradle: Factor out the dependency versions to a build-wide variable 2020-12-01 18:05:31 +01:00
Lubosz Sarnecki 4d45bfeb1b cmake: Fix Android linking error 2020-12-01 18:05:31 +01:00
Lubosz Sarnecki c0ab34a355 aux/android: Implement display metrics acquisition. 2020-12-01 17:36:15 +01:00
Jakob Bornecrantz 6fc0e1cda5 u/sink_converter: Silence warning 2020-11-30 17:52:58 +00:00
Jakob Bornecrantz 242faf9b60 u/sink_converter: Refactor allocation function a bit more 2020-11-30 17:52:58 +00:00
Christoph Haag 3b992a4508 u/sink_converter: Remove u_sink_converter::frame 2020-11-30 15:38:21 +00:00
Christoph Haag 5a4df61885 u/sink_converter: Clarify dst frame of format conversions 2020-11-30 15:38:19 +00:00
Christoph Haag 49587412bd u/sink_converter: clarify ensure_data() 2020-11-30 15:38:15 +00:00
Christoph Haag 3d3361706c os/threading: Fix typo in comment 2020-11-30 15:38:07 +00:00
Lubosz Sarnecki bd68c0e5f5 aux/math: Implement math_matrix_2x2_multiply. 2020-11-27 16:50:55 +01:00
Christoph Haag f7cbe37c2d u/hand_tracking: Tweak hand model parameters
* shortened way too long bones
* tweaked offset positions
2020-11-23 20:42:54 +00:00
Christoph Haag 006971ae7a u/hand_tracking: Calculate joint velocities
And return them in the state tracker
2020-11-23 20:42:54 +00:00
Christoph Haag aa6e5f7fdf u_hand_tracking: Fix typo in u_hand_tracking_model 2020-11-23 20:42:54 +00:00
Christoph Haag f5ef3985ba xrt: Add support for locating hand joints in action spaces 2020-11-23 20:42:54 +00:00
Christoph Haag 95af586654 aux: Add m_space_graph_add_inverted_relation 2020-11-23 20:42:54 +00:00
Christoph Haag d6b072805a aux: Add m_space_relation_invert 2020-11-23 20:42:54 +00:00
Ryan Pavlik 66811b436a xrt: Have the vk_helper vk_create_device take in a list of device extensions, and fix usages. 2020-11-23 14:27:21 -06:00
Jakob Bornecrantz ef6c8430d2 m/space: Make sure to not drop positions 2020-11-18 18:05:07 +00:00
Christoph Haag 9e788df463 xrt: Remove lens center from xrt_view
It's only used internally in drivers now.
2020-11-12 16:04:00 +01:00
Ryan Pavlik 86a19e6697 gradle: Remove unused dependencies. 2020-11-10 18:44:03 +00:00
Ryan Pavlik 5115124bb3 aux/android: Factor out a "native counterpart" class. 2020-11-10 18:44:03 +00:00
Ryan Pavlik a792b08ed7 aux/vk: Minimal, untested implementations of these for Windows - fixes build 2020-11-10 03:09:07 +00:00
Ryan Pavlik cc15bfa7ed a/util: FIx ambiguity of directories for docs. 2020-11-10 03:09:07 +00:00
Ryan Pavlik 8f10d9c2b8 u_hand_tracking: Fix usage of M_PI 2020-11-10 03:09:07 +00:00
Ryan Pavlik d2955a3967 aux/util: Adjust conditional log macros to handle msvc correctly 2020-11-10 03:09:07 +00:00
Jakob Bornecrantz aa7f922e35 os/time: Add a Linux specific way to get the realtime clock (for RealSense) 2020-11-09 23:42:13 +00:00
Jakob Bornecrantz 4bbe25148b os/time: Make timespec argument const 2020-11-09 23:42:11 +00:00
Ryan Pavlik 7cebdb4763 aux/os: More defines to calm clang-tidy. 2020-11-09 16:18:00 -06:00
Ryan Pavlik b855fd1ae2 a/util: Appease clang-tidy with a define for ns per second 2020-11-09 16:18:00 -06:00
Ryan Pavlik ab82c5b8e2 u_debug: Remove duplicate declaration 2020-11-09 16:18:00 -06:00
Christoph Haag 9d894ab5ff xrt: Move tracking origin setup code to u_device 2020-11-09 00:32:33 +01:00
Christoph Haag c60b7412e5 xrt: Move device assignment code to u_device 2020-11-09 00:32:33 +01:00
Christoph Haag 803e9531ec aux: Use time since time_state creation for time_state timestamps
Easy to read timestamps and somewhat meaningful.
2020-11-05 23:11:03 +00:00
Ryan Pavlik ce3750bfe1 a/android: Store a native pointer in the MonadoView. 2020-10-30 18:20:35 -05:00
Ryan Pavlik 3bc84cca9e a/android: Migrate to using the MonadoView generated wrapper. 2020-10-30 18:20:35 -05:00
Ryan Pavlik b6a12f8522 a/android: Add some partially-generated wrappers for our own Java code. 2020-10-30 18:20:35 -05:00
Ryan Pavlik fc78b5de86 a/android: Use android_custom_surface constructor/destructor 2020-10-30 18:20:34 -05:00
Ryan Pavlik 66d6281a7f a/android: Monitor whether MonadoView is still being used by native code. 2020-10-30 18:20:34 -05:00
Ryan Pavlik 26cd22b232 a/android: Move class name to a constant. 2020-10-28 12:12:31 -05:00
Ryan Pavlik da3959e642 a/android: C++ headers use .hpp as the extension 2020-10-28 12:12:31 -05:00
Ryan Pavlik 8301c9d1b4 a/android: Fix some file comments. 2020-10-28 12:12:31 -05:00
Ryan Pavlik 1acadb8a18 a/android: Make MonadoView fullscreen. 2020-10-28 12:12:31 -05:00
Lubosz Sarnecki d61faff421 aux/android/ahardwarebuffer_allocator: Use Vulkan enums in format switch. 2020-10-28 12:12:31 -05:00
Lubosz Sarnecki 633b7839c2 aux/vk+comp/sc: Initialize extra structs for hardware buffer extension.
Fix sRGB format for Android hardware buffers.
2020-10-28 12:12:31 -05:00
Lubosz Sarnecki 3cc8793d7d aux+comp: Add Android hardware buffer device extension. 2020-10-28 12:12:31 -05:00
Lubosz Sarnecki 2cc8252c05 aux/vk: Add vkGetAndroidHardwareBufferPropertiesANDROID. 2020-10-28 12:12:31 -05:00
Lubosz Sarnecki 2df2daa00c aux/android/ahardwarebuffer_allocator: Add function to allocate a single buffer. 2020-10-28 12:12:31 -05:00
Ryan Pavlik 436886852d a/android: Improve monadoview, including fixing deleted ref problem. 2020-10-28 12:12:31 -05:00
Ryan Pavlik dfd771f768 aux/android: Enhance custom surface
Includes fixes to my mistakes by Lubosz.

Co-authored-by: Lubosz Sarnecki <lubosz.sarnecki@collabora.com>
2020-10-28 09:41:03 -05:00
Lubosz Sarnecki e78ad12634 aux/android/custom_surface: Make JNI happy.
Keep android_load_class methods in C++, since
casting the class handle to void results in:

```
JNI DETECTED ERROR IN APPLICATION: use of deleted global reference.
```

Co-authored-by: Ryan Pavlik <ryan.pavlik@collabora.com>
2020-10-28 09:33:47 -05:00
Lubosz Sarnecki 2a8db3d780 aux/android/load_class: Use pkgClassLoader.loadClass to load MonadoView class. 2020-10-28 09:33:46 -05:00
Lubosz Sarnecki dbe0338956 android/MonadoView: Register surface callback and fix imports.
Run UI things on UI thread.
2020-10-28 09:33:46 -05:00
Ryan Pavlik 43d724b6bf aux/vk: Fix a place where we were missing an android ifdef 2020-10-28 09:33:46 -05:00
Ryan Pavlik d4b19f3d47 aux/android: Add custom surface code. 2020-10-28 09:33:46 -05:00
Ryan Pavlik 9b67c0a09f aux/android: Add code to load Java from a package 2020-10-28 09:33:46 -05:00
Ryan Pavlik d0187cee9a aux/android: Add Java code 2020-10-28 09:33:26 -05:00
Ryan Pavlik 06f75e03b4 a/android: Fix typo in comment 2020-10-28 09:32:49 -05:00
Ryan Pavlik 59d2285c8e aux/util: Port logging for Android.
Now if u_logging is used, it goes to logcat.
2020-10-28 09:32:49 -05:00
Jakob Bornecrantz 463330d5d5 u/distortion: Set blend mode incase it is zero 2020-10-27 21:34:29 +00:00
Jakob Bornecrantz ecbde55752 m/space: Normalize orientation when returning result 2020-10-27 16:20:12 +00:00
Jakob Bornecrantz bd6ea43de5 m/headers: Fix doxygen warnings 2020-10-26 22:55:22 +00:00
Jakob Bornecrantz 8730ff479a u/hand_tracking: Tidy header 2020-10-26 22:50:54 +00:00
Jakob Bornecrantz 75153a7066 u/distortion: Add simple cardboard distortion code 2020-10-26 21:53:55 +00:00
Jakob Bornecrantz ed2040a571 u/mesh: Tidy header 2020-10-26 20:36:30 +00:00
Lubosz Sarnecki 7035490ed7 aux/math: Implement math_matrix_4x4_inverse_view_projection. 2020-10-26 01:34:10 +00:00
Jakob Bornecrantz 2528583c55 xrt: Add git tag/description 2020-10-20 17:43:11 +01:00
Jakob Bornecrantz 438a8e71f9 aux/vk: Add vkFreeDescriptorSets 2020-10-13 18:59:28 +01:00
Christoph Haag ca5cbaaa6f aux: Add hand_tracking util 2020-10-12 22:55:33 +02:00
Christoph Haag 256e2c68d8 xrt: Implement & hook up hand joint tracking infrastructure
Include <inttypes.h> to satisfy older compilers
2020-10-12 22:13:47 +02:00
Ryan Pavlik 835beedcca u_handles: Add Win32 handle utilities 2020-10-08 17:26:22 -05:00
Ryan Pavlik 39ede92287 build: Link aux_util against threads explicitly 2020-10-08 17:26:22 -05:00
Ryan Pavlik 3f83b1da92 u_json: Properly silence secure CRT warnings. 2020-10-08 17:26:22 -05:00
Ryan Pavlik 48eb00f1c8 u_bitwise: Switch from static const int to defines.
Sadly MSVC didn't believe those were constant,
and this is a C file so no constexpr.
2020-10-08 17:26:22 -05:00
Jakob Bornecrantz 51c8575323 u/mesh: Add back none distortion generation 2020-10-07 23:45:39 +01:00
Christoph Haag 5bea856f20 build/meson: Add XRT_HAVE_DBUS when dbus is found 2020-10-05 16:05:02 +00:00
Jakob Bornecrantz 0804dc20d1 os/ble: Use logging 2020-10-05 16:22:02 +01:00
Jakob Bornecrantz 40c764a290 os/ble: Large refactor of code 2020-10-05 14:19:52 +01:00
Jakob Bornecrantz 5af976a510 os/ble: Add os_ble_broadcast_write_value function 2020-10-05 14:19:52 +01:00
Jakob Bornecrantz 5b4d45ffcc os/ble: Correct documentation on os_ble_notify_open function 2020-10-05 14:19:52 +01:00
Jakob Bornecrantz 9a675cc7f3 xrt: Rename xrt_uv_triplet 2020-09-30 15:35:57 +01:00
Christoph Haag f6c3998d29 xrt: Use struct vive_values for u_compute_distortion_vive 2020-09-30 02:05:05 +02:00
Christoph Haag 29188d681c xrt: Remove all but mesh distortion values from xrt_hmd_parts::distortion
Move vive values to struct u_vive_values in u_distortion_mesh.
Move openhmd values to private struct inside ohmd driver.
2020-09-30 02:05:05 +02:00
Christoph Haag c5209c5ed4 comp: Move mesh generation to comp_renderer init
Use none shader when XRT_DISTORTION_MODEL_NONE is set.
Fall back to none distortion if mesh generation fails or unsupported
distortion model is set.

comp_render init updates comp_settings::distortion_model.

u_compute_distortion_mesh: Don't touch xdev::distortion::preferred,
just add XRT_DISTORTION_MODEL_MESHUV mesh to xdev::distortion::models.
2020-09-30 02:05:05 +02:00
Christoph Haag fb71c71a8c xrt: Replace mesh generator with xdev->compute_distortion()
Each HMD driver now has to implement compute_distortion() which will be called
by the compositor implementation to generate a mesh (usually).

u_distortion_mesh contains implementations for the defaults (panotools, OpenHMD, vive).

Also adds compute_distortion function for Vive distortion

There are differences between OpenHMD and Panotools values, main differences for now:
* psvr has 5 pano coefficients, ohmd has 3
* psvr uses viewport size and lens center in pixels for distortion calculation, ohmd in meter
* psvr uses different distortion scaling than ohmd
2020-09-28 17:04:15 +01:00
Ryan Pavlik 6af00ed8db u/file: Stub out Linux path manip code. 2020-09-18 18:27:46 +01:00
Ryan Pavlik 6ad46cb1b2 build: Be able to build against pthreads4w 2020-09-18 18:25:27 +01:00
Milan Jaros 3f4bcb412e u/threading: Cast result of realloc. 2020-09-18 17:15:33 +01:00
Ryan Pavlik 695a2c1151 u/debug: Silence warnings on MSVC 2020-09-18 17:15:33 +01:00
Ryan Pavlik f7a132e635 u/time: Fix overflow. 2020-09-18 17:15:33 +01:00
Ryan Pavlik 1dffe58952 u/json: Silence warnings on MSVC 2020-09-18 17:15:33 +01:00
Milan Jaros 7685f49adb os/threading: Fix includes on Windows 2020-09-18 17:15:33 +01:00
Milan Jaros 367c01f354 os/time: Provide time functions for Windows 2020-09-18 17:15:33 +01:00
Ryan Pavlik 7c47293c52 os/time: Implement os_nanosleep for Windows 2020-09-18 13:56:34 +01:00
Jakob Bornecrantz 6a94b1cf80 m/ff: Improve interface 2020-09-16 17:27:16 +01:00
Jakob Bornecrantz b624d290d0 m/3dof: Add filter fifos to variable tracking code 2020-09-15 16:41:07 +00:00
Jakob Bornecrantz 3ffa40c628 u/var: Refactor how variables info is passed 2020-09-15 16:41:07 +00:00
Jakob Bornecrantz d5c62f8ccb u/var: Add tracking for filter fifos 2020-09-15 16:41:07 +00:00
Christoph Haag a884e24b9a aux: Support waiting more than 0.999... seconds in os_nanosleep 2020-09-11 18:52:01 +02:00
Christoph Haag 1429d678a0 aux/space: Propagate orientation valid bit through space graph resolve
Invalid poses may be handled more gracefully in the future. For now poses
are not transformed if orientation is not valid, because transforming with
an invalid quaternion will have bad results in any way.

v2: Upgrade poses with valid position but invalid orientation to valid poses
2020-09-11 18:51:58 +02:00
Christoph Haag 6cce04f8d3 aux/space: fix typo: propagate tracked orientation bit properly 2020-09-09 14:51:06 +02:00
Jakob Bornecrantz eaffa05a37 xrt: Remove acceleration components from xrt_space_relation 2020-09-07 23:36:34 +01:00
Jakob Bornecrantz 5a4d45bbaa m/base: Remove old space relation functions 2020-09-07 23:33:28 +01:00
Jakob Bornecrantz fe94dec5ea m/space: Space graph functions 2020-09-07 23:33:25 +01:00
Jakob Bornecrantz ca91695722 m/quat: Add math_quat_rotate_derivative 2020-09-07 16:14:46 +01:00
Jakob Bornecrantz 4f94ee0c91 u/render_timing: Improve debug printing 2020-09-04 13:48:40 +01:00
Jakob Bornecrantz 328f5d5315 m/base: Add math_quat_invert 2020-09-02 22:07:35 +01:00
Jakob Bornecrantz 511a51b283 m/3dof: Rename to timestamp 2020-09-02 22:07:35 +01:00
Jakob Bornecrantz 8cdfe0e694 m/fifo: Add f64 filter fifo 2020-09-02 22:07:35 +01:00
Jakob Bornecrantz 991c9029c7 m/3dof: Tweak values 2020-09-02 22:07:35 +01:00
Jakob Bornecrantz 736fa81349 m/3dof: Add vars tracking helper function 2020-09-02 22:07:35 +01:00
Jakob Bornecrantz 33f05c7bea m/vec3: Add C++ operators 2020-09-02 22:07:35 +01:00
Jakob Bornecrantz d396117a39 m/vec2: Add C++ operators 2020-09-02 22:07:35 +01:00
Pete Black 3f197eeffd t/psmv: Use the same filtering as in PSVR tracker 2020-08-28 11:38:03 +00:00
Pete Black 76a439bd59 t/psvr: Add a functional PSVR tracker 2020-08-28 11:38:03 +00:00
Jakob Bornecrantz b3c5bf1517 math: Add a permutation library 2020-08-28 11:38:03 +00:00
Jakob Bornecrantz d3b224275c u/logging: Fix return of debug_get_log_option_SUFFIX 2020-08-28 11:38:03 +00:00
Pete Black 751fdb2884 u/render_timing: Paranoia 2020-08-28 11:38:03 +00:00
Ryan Pavlik 9d19ab2755 u/misc: Improve docs of calloc macros. 2020-08-26 11:26:46 -05:00
Ryan Pavlik 581f59a2eb vk: Add an Android function to the vk_bundle 2020-08-26 16:31:38 +01:00
Jakob Bornecrantz 62fd80ff8d aux/vk: Print a little bit more when failing on usage 2020-08-26 14:28:10 +00:00
Christoph Haag 6dc4a1f237 aux/vk: Report appropriate errors on unsupported image usage flags 2020-08-24 10:18:12 +02:00
Christoph Haag 370f6820aa m: Generalize math_matrix_4x4_quad_model, making scaling a vec3 2020-08-21 02:11:03 +02:00
Christoph Haag fbe390813c vk: Add update_buffer helper function 2020-08-21 02:11:03 +02:00
Christoph Haag cf5596adba comp: Use CLAMP_TO_EDGE for swapchains
Avoids sampling black at the edges of layers.
2020-08-21 02:09:20 +02:00
Ryan Pavlik 3b8c8ddc1a xrt: Move the android globals functionality to the new android aux lib. 2020-08-19 16:07:00 -05:00
Ryan Pavlik a57507518d aux/android: New aux library, add image allocator for Android 2020-08-19 16:06:30 -05:00
Ryan Pavlik fa34c65ed3 xrt: Make xrt_image_native::size optional.
Not all allocators can supply it.
2020-08-19 16:06:30 -05:00
Ryan Pavlik e48f68deb6 aux/ogl: Add helper header for OpenGL. 2020-08-19 16:06:30 -05:00
Ryan Pavlik 430f79a7ca aux/util: Add u_android for global state. 2020-08-19 11:01:10 -05:00
Ryan Pavlik e092345292 aux/vk: Port to using u_handles 2020-08-13 17:34:05 -05:00
Ryan Pavlik 129c1a9ac4 a/util: Add u_handles module. 2020-08-13 17:34:05 -05:00
Ryan Pavlik e52539d1a3 aux/vk: Fix compile time conditionals 2020-08-13 17:34:05 -05:00
Ryan Pavlik 9087d1c7a9 xrt: Use our generic graphics buffer typedefs all over.
This adds some Android support in composition clients,
and fixes the breakage from 2 commits ago.

Thanks to Jakob for finding my error in an earlier version.
2020-08-13 17:34:05 -05:00
Ryan Pavlik 475192ec73 xrt: Rename "fd" references to "handle"
This breaks some Android pieces, which will be fixed shortly.
2020-08-12 17:11:42 -05:00
Ryan Pavlik 146218b346 xrt: Some clang tidy fixes.
A few suppressions as well where clang-tidy did the wrong thing.
2020-08-12 17:11:42 -05:00
Jakob Bornecrantz cd9da1c1e1 aux/vk: Make xrt_swapchain_create_info const 2020-08-07 17:00:10 +01:00
Christoph Haag e48c748a57 xrt: suggest correct GPU in xrGetVulkanGraphicsDevice()
As before, on the service side the GPU index the compositor runs on can be selected with
* XRT_COMPOSITOR_FORCE_GPU_INDEX=INDEX1

By default xrGetVulkanGraphicsDevice() will suggest the same GPU the compositor runs on.

It is also possible to override the GPU index suggested to applications with
* XRT_COMPOSITOR_FORCE_CLIENT_GPU_INDEX=INDEX2

The reason this is both done on the service side is that if compositor and client run
on different GPUs, the swapchains use linear tiling instead of optimal tiling.

To make chosen GPUs comparable across the compositor's and the client's vulkan instance,
VkPhysicalDeviceIDProperties.deviceUUID is used.
2020-08-07 17:01:13 +02:00
Jakob Bornecrantz 3a7a86aafc vk: Refactor VkImageUsageFlags code into helper function 2020-08-06 14:28:23 +00:00
Jakob Bornecrantz ce7da3941c vk: Add support for XRT_SWAPCHAIN_USAGE_INPUT_ATTACHMENT 2020-08-06 14:28:23 +00:00
Ryan Pavlik 07f2e62e76 aux/vk: vk_create_semaphore_from_fd -> vk_create_semaphore_from_native 2020-08-05 20:50:00 +00:00
Ryan Pavlik d8ad620bd2 xrt: Update GLAD again, to a "merged" distribution.
This merges the OpenGL and OpenGL-ES code.
2020-08-05 20:50:00 +00:00
Lubosz Sarnecki 87a5c425cf a/math: Add math_vec3_normalize. 2020-07-31 12:45:47 +02:00
Lubosz Sarnecki 7c8febd03d u/logging: Add U_LOG_IFL. 2020-07-31 12:45:47 +02:00
Jakob Bornecrantz 727e3bc2a6 vk: Add image allocator helper 2020-07-20 13:50:01 +00:00
Jakob Bornecrantz a8a4e80746 vk: Use xrt_swapchain_create_info in vk_create_image_from_native 2020-07-20 13:50:01 +00:00
Jakob Bornecrantz 5a9fa0a7e6 vk: Remove unused vk_image 2020-07-20 13:50:01 +00:00
Ryan Pavlik 47a66e1bdf build: Use OpenGLES CMake module to gate OpenGL|ES support 2020-07-17 15:17:42 -05:00
Ryan Pavlik 6f56d91c05 xrt: Add separate build config for OpenGL ES 2020-07-17 15:17:42 -05:00
Ryan Pavlik 910a3aae75 external: Update GLAD and add missing header 2020-07-17 13:53:39 -05:00
Ryan Pavlik 4220638afd xrt: use _USE_MATH_DEFINES to make sure M_PI gets defined. 2020-07-17 13:53:39 -05:00
Ryan Pavlik 8b954e12c1 build: Add missing jpeg include dir 2020-07-17 13:53:39 -05:00
Ryan Pavlik cb69223532 aux: Move responsibility for clearing image FD to the helper. 2020-07-17 11:46:22 -05:00
Ryan Pavlik 1aa2cdb89a build: Move determination of Vulkan usage to build system.
Vulkan is still required for most actual uses of Monado, but this
makes the coupling weaker.
2020-07-16 10:17:30 +00:00
Ryan Pavlik 54f56716fd xrt: Rename references to compositor/swapchain/image_fd to ..._native.
Reflecting that the native buffer isn't an FD on all platforms.
2020-07-15 09:11:58 -05:00
Lubosz Sarnecki 261facd9f1 u/json: Fix a -Wmaybe-uninitialized on GCC 10.1.0. 2020-07-10 17:18:41 +02:00
Lubosz Sarnecki 8e682fdd1b u_logging: Format logging output.
To be in line with other log prints, put the log level first.
For better readability, put the function in [braces].
Remove ":" as separator between level and function.
2020-07-09 13:38:07 +02:00
Ryan Pavlik b2b2b0f4af u_logging: Fix comments/doxygen 2020-07-08 09:15:51 -05:00
Jakob Bornecrantz 9848f8b4b8 u/var: Add log level tracker 2020-07-03 19:01:55 +01:00
Jakob Bornecrantz be0430a38c u/debug: Add function to get logging level 2020-07-03 18:58:34 +01:00