Commit graph

514 commits

Author SHA1 Message Date
Jakob Bornecrantz 1109bc7cfb st/oxr: Better logging when creating transforms 2020-08-18 19:43:27 +01:00
Jakob Bornecrantz 25c78287a2 st/oxr: Slightly better logging when we fail to transform 2020-08-18 17:06:07 +01:00
Jakob Bornecrantz a3c4cba7f5 st/oxr: Reject bindings that we can't transform 2020-08-18 17:06:07 +01:00
Ryan Pavlik 00abdb358a st/oxr: Proper gles support for Android 2020-08-17 17:30:33 -05:00
Christoph Haag 0a667281f9 st/oxr: Print invalid quaternion values in xrLocateView
Gives a hint whether it was zeroed, almost normalized, or not normalized at all.
2020-08-17 12:39:08 +02:00
Ryan Pavlik 54dbb4d128 st/oxr: Use the XR_ERROR_GRAPHICS_REQUIREMENTS_CALL_MISSING code added in OpenXR 1.0.11. 2020-08-14 17:42:19 -05:00
Ryan Pavlik 2c126e08ff st/oxr: Handle XRT_ERROR_IMAGE_CREATE_FLAG_UNSUPPORTED from compositor. 2020-08-14 19:58:01 +00:00
Jakob Bornecrantz 8846c88eb1 st/oxr: Implement cylinder layer 2020-08-14 19:15:02 +00:00
Jakob Bornecrantz 7eeab2aca6 st/oxr: Implement the layer verification functions 2020-08-14 19:15:02 +00: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 38703fc1d2 st/oxr: Add plumbing for layers 2020-08-11 01:51:24 +01:00
Jakob Bornecrantz 1e3508d2ce st/oxr: Fix crash in oxr_session_poll in headless mode
Spotted and reported by svillar (IRC).
2020-08-10 16:49:20 +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 b7977424fc st/oxr: Get viewport information from the native compositor 2020-08-06 15:14:49 +00:00
Jakob Bornecrantz adc6ca8e8a c/main: Fill out all of the compositor info struct 2020-08-06 15:14:49 +00:00
Jakob Bornecrantz d1d841e7c3 xrt: Use new info struct for compositor formats 2020-08-06 15:14:49 +00:00
Jakob Bornecrantz e8ca242967 xrt: Remove flip_y argument to native compositor creation 2020-08-06 15:14:49 +00:00
Jakob Bornecrantz fb9ebe8b88 st/oxr: Add support for MND_swapchain_usage_input_attachment_bit 2020-08-06 14:28:23 +00:00
Ryan Pavlik 574631166f st/p: Downgrade an "error" message to a "debug" message.
This message is always triggered on my machine by v4l2loopback.
2020-08-05 11:12:16 -05:00
Christoph Haag c019fce797 st/oxr: Don't crash when native compositor creation fails
fixes crash and exits gracefully after

compositor_init_swapchain - Window init_swapchain failed!
XR_ERROR_INITIALIZATION_FAILED in xrCreateSession: Failed to create a native compositor '-1'
2020-08-04 22:32:58 +02:00
Christoph Haag 5d4a49a1c7 st/oxr: Actually return invalid path error in sync actions 2020-08-03 19:00:17 +02:00
Christoph Haag d06f1c9ef9 st/oxr: error when sync with subactionpath that no action has 2020-08-03 19:00:17 +02:00
Christoph Haag 983665d95c st/oxr: Respect action set priority for exact matching inputs
* Only suppress action when synced actionset has relevant subpath
2020-08-03 19:00:02 +02:00
Christoph Haag 4c8e3eb95f st/oxr: Don't return early when not using 'any' subpath
'any' is only set when xrSyncActions was called with XR_NULL_PATH.
When only left or right is set, the already existing following code does the job.
2020-08-03 18:59:56 +02:00
Jakob Bornecrantz 9ae720b9d4 xrt: Add all remaining swapchain creation flags 2020-07-29 14:46:17 +01:00
Ryan Pavlik b70d14f6b0 st/oxr: Convert some more missed subaction path iterations to x-macro usage.
Also make Doxygen expand macros so that these usages still result
in reasonable developer docs.
2020-07-23 15:40:18 -05:00
Ryan Pavlik a9a502952a st/oxr: Fix multiplicity of bound_path per action.
Thanks to @haagch for the start of this patch.
2020-07-23 14:34:38 -05:00
Ryan Pavlik ae59a3ce15 st/oxr: Add design documentation for OpenXR input subsystem. 2020-07-23 14:29:12 -05:00
Ryan Pavlik 5ba5e6b03b st/oxr: Fix typo 2020-07-23 12:50:17 +01:00
Ryan Pavlik a04c162ab3 st/oxr: Centralize the lists of subaction paths using x-macros. 2020-07-22 16:00:23 -05:00
Christoph Haag 138fcc49d8 st/oxr: Fix haptic actions being disabled
fixes d226a60a
2020-07-22 00:45:44 +02:00
Jakob Bornecrantz 7818a5b9cf st/oxr: Implement xrEnumerateBoundSourcesForAction 2020-07-21 22:41:13 +00:00
Jakob Bornecrantz 9f684dbc21 st/oxr: Add a very ugly stub implementation of xrGetInputSourceLocalizedName 2020-07-21 22:41:13 +00:00
Jakob Bornecrantz 53a0646e24 st/oxr: Add better verification in xrGetInputSourceLocalizedName 2020-07-21 22:41:13 +00:00
Jakob Bornecrantz 5e629b3437 st/oxr: Tidy header 2020-07-21 22:41:13 +00:00
Christoph Haag d226a60aac st/oxr: Combine input values
This enables binding two different inputs to the same action, for example
/user/hand/left/input/select/click and /user/hand/left/trigger/click to
the same grab action.

Also takes care of using the correct timestamp of the input that is
responsible for the last overall value change.
2020-07-21 20:59:07 +02:00
Jakob Bornecrantz b87fd91bc8 st/oxr: Send XrEventDataInteractionProfileChanged events on interaction profile changes 2020-07-20 19:52:31 +01:00
Jakob Bornecrantz 56386aa1d7 st/oxr: Implement needed checks for xrGetCurrentInteractionProfile 2020-07-20 19:34:41 +01:00
Jakob Bornecrantz b0593d7012 st/oxr: Better error message for unhandled case in xrGetCurrentInteractionProfile 2020-07-20 19:34:41 +01:00
Jakob Bornecrantz 18957e0636 st/oxr: Fix the any handiness controllers not getting assigned to right 2020-07-20 19:34:41 +01:00
Jakob Bornecrantz 9f11287fa3 st/oxr: A slightly better stub implementation of xrEnumerateBoundSourcesForAction 2020-07-20 19:34:41 +01:00
Jakob Bornecrantz b93017911e xrt: Make xrt_compositor::create_swapchain return xrt_result_t 2020-07-20 13:50:01 +00:00
Christoph Haag f18c190eaa st/oxr: Check if relating space to itself first 2020-07-20 15:41:17 +02:00
Christoph Haag ddb528f002 st/oxr: Support locating stage space in local space
And the other way around.

Fixes hello_xr -s Local, which renders cubes at offset stage space locations,
relative to local space.
2020-07-20 14:05:31 +02:00
Christoph Haag 164eda38d4 st/oxr: use initial head pose as local space origin
Implements local space in xrLocateViews, xrLocateSpace, and Quad layers in xrEndFrame.
2020-07-19 23:55:20 +02:00
Ryan Pavlik 6f56d91c05 xrt: Add separate build config for OpenGL ES 2020-07-17 15:17:42 -05:00
Ryan Pavlik 4c5b38c836 st/oxr: Clean up GL/GLES image enumeration a bit for easier maintenance 2020-07-17 13:53:39 -05:00
Ryan Pavlik 852c9b589d st/oxr: Handle Android better. 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
Christoph Haag eb355f3643 st/oxr: Handle quad layer with reference space as base space again
fixes d64ef3df
2020-07-17 13:10:20 +02:00
Christoph Haag d64ef3df74 st/oxr: Basic support for ActionSpace as base space in QuadLayer 2020-07-16 20:02:05 +00: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
Jakob Bornecrantz c37dd46b0c st/prober: Rework HMD logic a bit and put HMD always in first position 2020-07-14 12:55:18 +01:00
Christoph Haag b073e3dfb9 xrt: Add support for assigned device roles
Abandons the assumption that in oxr_system.xdevs[], index 0 is HMD,
1 is left controller, 2 is right controller.

Now to represent the dynamically assigned roles, oxr_system.role contains
the index for a device in oxr_system.xdevs[] for head, left and right.

This role assignment happens on the client side and currently can not be updated
from the server side.

Also adds an enum that device drivers set indicating allowed assignments
(many controllers are physically designed to be held in a specific hand).

This also adds support for configurations with only a HMD and a right controller.
2020-07-13 18:03:01 +02:00
Christoph Haag 5788fb90a2 drivers: Add rotation/position tracking bool to xdev
xrGetSystemProperties() will return these values to application in XrSystemTrackingProperties
using the xdev assigned to head.
2020-07-13 18:03:01 +02:00
Jakob Bornecrantz deedd10a50 xrt: Tidy xrt_instance_create argument order and add doc-comment 2020-07-08 14:41:12 +00:00
Jakob Bornecrantz c5b930903e st/oxr: Fix conformance failure and tidy up action set attached logic
This caused a action set to act as if it has been attached, one might say that
this commit fixes a overly attached action set.

Extreme programmed with Ryan Pavlik, which I also ~~stole~~ borrowed the header
comments from verbatim.
2020-07-06 20:11:35 +01:00
Jakob Bornecrantz 59b7bdeee0 st/oxr: Properly name MNDX_ball_on_a_stick_controller 2020-07-06 11:58:42 +01:00
Jakob Bornecrantz fd8e19718c st/oxr: Reorder extension in prefix order 2020-07-06 11:42:16 +01:00
Jakob Bornecrantz 8a1c74338c st/oxr: Make script be up to date to what's generated 2020-07-06 11:42:16 +01:00
Jakob Bornecrantz 8ee7086ea6 xrt: Introduce xrt_swapchain_create_info 2020-07-04 11:04:07 +00:00
Jakob Bornecrantz ad266672f4 st/gui: Add a special UI for setting log level vars 2020-07-03 19:26:45 +01:00
Jakob Bornecrantz 9848f8b4b8 u/var: Add log level tracker 2020-07-03 19:01:55 +01:00
Christoph Haag 184dd277bf bindings: Fix Index squeeze/force binding declaration 2020-07-01 18:36:41 +02: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 b7ea0ce2b3 st/oxr: Support next-chained XrSpaceVelocity in XrSpaceLocation 2020-06-26 01:41:08 +02:00
Pete Black bd5aa24463 xrt: Add multi client and overlay client support 2020-06-25 15:48:34 +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 b75f4f844b xrt: Add frame_id to compositor frame calls 2020-06-23 21:31:00 +01: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
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 adbafad079 st/oxr: Rename the remaining oxr_source things to oxr_action 2020-06-16 16:42:38 -05:00
Jakob Bornecrantz abf8d5b8bd st/oxr: More correctly handle spaces for layers 2020-06-15 23:59:04 +00:00
Ryan Pavlik 1738329138 st/oxr: Give oxr_action and oxr_action_set ref-counted backing data 2020-06-15 18:11:33 -05:00
Ryan Pavlik 640fa1bbe5 st/oxr: Rename the action set and action keys to distinct names. 2020-06-15 17:09:20 -05:00
Ryan Pavlik 2f8d1a54a5 st/oxr: Reparent action set/action attachment.
They are no longer a linked list and a handle, but simple dynamic arrays.
2020-06-15 17:09:15 -05:00
Ryan Pavlik 894aa8d61f st/oxr: Rename some types, functions, and variables for clarity 2020-06-15 17:08:05 -05:00
Ryan Pavlik 6fe801e766 st/oxr: Re-use a structure 2020-06-15 17:04:00 -05:00
Ryan Pavlik 6be05e2107 st/oxr: Factor out source cache teardown function 2020-06-15 17:04:00 -05:00
Ryan Pavlik 4a4bed8df4 st/oxr: Handle treadmill user path 2020-06-15 17:04:00 -05:00
Ryan Pavlik 2a2157af66 st/oxr: Clean up comments 2020-06-15 10:46:29 -05:00
Jakob Bornecrantz cbb91904e9 st/oxr: Remove old validation that's now done in api function 2020-06-14 23:01:13 +01:00
Jakob Bornecrantz 2dcf4a819b st/oxr: Improve xrSuggestInteractionProfileBindings validation of input 2020-06-14 23:01:13 +01:00
Jakob Bornecrantz e4a4a5e7b2 st/oxr: Use correct enum type when converting from eye visibility NFC 2020-06-13 13:58:14 +01:00
Jakob Bornecrantz 45c977d199 xrt: Introduce xrt_sub_image and xrt_layer_projection_view_data 2020-06-09 20:32:53 +01:00
Jakob Bornecrantz 259bd52dbd st/oxr: Convert layer bits from OpenXR to XRT 2020-06-09 19:04:48 +00:00
Jakob Bornecrantz 55e026245a xrt: Use new xrt_layer_data in layer functions 2020-06-09 19:04:48 +00:00
Ryan Pavlik 435f6c5c89 build: Allow enabling inter-procedural optimization in CMake builds, if supported. 2020-06-09 12:03:08 -05:00
Christoph Haag bc995e3aab ipc: Return XR_ERROR_INSTANCE_LOST instead of SIGABRT on the client side 2020-06-05 16:06:32 +02:00
Christoph Haag cc9b415a8f xrt: Add xrt_result_t return type to many functions
Many functions returned void and were assumed to always succeed, and some functions
returned only a bool to indicate vague success/failure.

Now that these functions get piped over IPC all of them have to be able to indicate
an IPC failure like for example an unreachable service.

With the xrt_result_t return type they now have the opportunity to report various
types of failures.
2020-06-05 16:06:32 +02:00
Jakob Bornecrantz dab96ef356 st/oxr: Validate view configuration type 2020-06-04 21:56:08 +00:00
Ryan Pavlik c39df58763 st/oxr: Additional doxygen improvements. 2020-06-03 17:26:35 -05:00
Ryan Pavlik bc6cc85e7d xrt: Improve doxygen documentation. 2020-06-03 16:28:18 -05:00
Jakob Bornecrantz 9f8761bd50 st/oxr: Tiny improvement to validation message 2020-06-03 09:30:18 +01:00
Jakob Bornecrantz 3fde4a0651 st/oxr: Update copyright in files touched by this MR 2020-06-03 09:30:18 +01:00
Jakob Bornecrantz a5d64e6565 st/oxr: Some minor spelling changes 2020-06-03 09:30:18 +01:00