Commit graph

689 commits

Author SHA1 Message Date
Christoph Haag 2e2a62ce1a st/oxr: submit layers with os monotonic timestamp, not XrTime
The compositor does not know about XrTime, only os monotonic timestamps.
2020-11-05 23:11:03 +00:00
Jakob Bornecrantz 1c98297aa0 st/oxr: Use new xdev providing binding 2020-11-05 14:44:04 +00:00
Christoph Haag d0b126c1ee oxr: Add one missing mutex to active_wait_frames 2020-11-04 13:33:27 +00:00
Christoph Haag 7eaa7abb89 oxr: Implement additional xrWaitFrame/xrBeginFrame call order checks
Relevant CTS tests: https://github.com/KhronosGroup/OpenXR-CTS/pull/7
2020-11-04 00:37:21 +01:00
Christoph Haag 965fa60bff xrt: Move synchronized state test into oxr session
The compositor now moves immediately to visible/focused when polling.
The state tracker will generate relevant openxr state changes once the session is synchronized.

Properly working alternative to e03ee48dce (reverted in e7643de8db)
2020-11-04 00:37:10 +01:00
Jakob Bornecrantz e7643de8db c/main: Revert "Transition to visible/focused after xrEndFrame, not xrWaitFrame"
This reverts commit e03ee48dce.
2020-11-03 21:04:05 +00:00
Ryan Pavlik 5f70826ba5 xrt: Add misc missing copyright/license notices 2020-11-02 17:04:51 +00:00
Christoph Haag e03ee48dce comp: Transition to visible/focused after xrEndFrame, not xrWaitFrame
The application synchronizes its frame loop by "by calling xrWaitFrame,
xrBeginFrame and xrEndFrame in a loop."

Applications can discard frames by not calling xrEndFrame. If initial
frames are discarded, we should not consider the frame loop synchronized.

Previously a sequence like
  xrBeginFrame, xrWaitFrame, xrBeginFrame, xrWaitFrame, xrPollEvent, xrBeginFrame
failed because xrPollEvent the compositor emitted transitions to visible
and focused but they were not emitted in the state tracker, because the
oxr session had not internally tranisitioned to the synchronized state.
2020-10-31 20:14:49 +01:00
Lubosz Sarnecki e3df2f9940 st/oxr: Add GLES Android session boilerplate. 2020-10-28 12:12:31 -05:00
Jakob Bornecrantz 7bcdf0de40 st/prober: Depend on remote driver as we reference it directly 2020-10-26 20:35:18 +00:00
Jakob Bornecrantz f868f61a17 st/oxr: Improve verification of XrGraphicsBindingEGLMNDX 2020-10-26 14:05:27 +00:00
Jakob Bornecrantz 7ba4bee439 st/oxr: Minor fixes for oxr_session_egl 2020-10-26 14:03:30 +00:00
Jakob Bornecrantz ebfd984c12 st/oxr: Fix missing semicolons 2020-10-26 14:03:30 +00:00
Jakob Bornecrantz f9443cf362 st/oxr: Timeout minimum duration pulses after 0.1 seconds 2020-10-26 14:03:30 +00:00
Lubosz Sarnecki 1227c77556 st/oxr: Add equirect2 verify and submit functions. 2020-10-26 01:34:10 +00:00
Jakob Bornecrantz fd5cfbe9a7 st/oxr: Fix state changes errors 2020-10-20 19:28:57 +01:00
Jakob Bornecrantz 2528583c55 xrt: Add git tag/description 2020-10-20 17:43:11 +01:00
Jakob Bornecrantz 9440a9dd93 st/prober: Add remote loading 2020-10-15 21:07:40 +00:00
Jakob Bornecrantz 27abc58d51 st/prober: Add the concept of active config to config file 2020-10-15 21:07:40 +00:00
Jakob Bornecrantz a122b4b0b2 st/prober: Refactor out adding functions. 2020-10-15 21:07:40 +00:00
Jakob Bornecrantz 541bdd2fce st/gui: Add remote device control ui 2020-10-15 21:07:40 +00:00
Jakob Bornecrantz 0cf3c704b6 st/oxr: Add simple controller bindings 2020-10-15 21:07:40 +00:00
Jakob Bornecrantz a200bd5fec st/oxr: Add option to disable printing to stderr 2020-10-15 01:45:51 +00:00
Jakob Bornecrantz 71e05fc21d st/oxr: Improve pose sub-path handling
If the client only supplies the 'any' path no sub-path would be
selected in the 'any' cause.
2020-10-15 01:45:51 +00: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 5522c7317a st/oxr: Replace __typeof__ usage with portable syntax.
Needed for building on MSVC
2020-10-08 17:26:22 -05:00
Jakob Bornecrantz 942ba178a0 st/oxr: Add extension support for XR_KHR_composition_layer_equirect2 2020-10-05 16:45:48 +01:00
Jakob Bornecrantz 02b33c668b st/oxr: Destroy client compositor when session is destroyed
Fixes #99
2020-10-04 13:04:57 +01:00
Jakob Bornecrantz 9dd8bfef28 st/oxr: Use xrt_comp_native_destroy helper 2020-10-04 13:04:55 +01:00
Jakob Bornecrantz 2aaa3acfdf st/oxr: Do not destroy native compositor in sub-classed session creation functions
So it's owned by the instance.
2020-09-24 19:07:01 +01:00
Jakob Bornecrantz 6961bf885f st/oxr: Don't create a new native compositor in android session
Spotted by Jarvis.
2020-09-24 19:06:51 +01:00
Christoph Haag 3d0235a450 st/prober: Fix build with v4l2 disabled 2020-09-21 20:21:56 +02:00
Jakob Bornecrantz 9ebf1c4d4d st/oxr: Fix warning 2020-09-18 20:51:31 +01:00
Ryan Pavlik 6af00ed8db u/file: Stub out Linux path manip code. 2020-09-18 18:27:46 +01:00
Ryan Pavlik 7e600dd244 build: Adjust/fix missing dependencies 2020-09-18 18:25:27 +01:00
Ryan Pavlik 6779b1c0f8 st/p: Fix include of libusb 2020-09-18 18:25:27 +01:00
Ryan Pavlik b71f13c582 st/p: Tighten preprocessor conditionals for non-Linux 2020-09-18 18:25:15 +01:00
Ryan Pavlik dae3ab3a4f xrt: Be sure to include config headers 2020-09-18 13:56:24 +01:00
Ryan Pavlik a0c8839a71 xrt: Remove un-needed includes of unistd 2020-09-18 13:56:16 +01:00
Jakob Bornecrantz c411caf0cd st/oxr: Fix return length from oxr_action_get_input_source_localized_name 2020-09-17 23:04:37 +01:00
Jakob Bornecrantz 4a62e88f09 st/oxr: Return identifier name for bindings 2020-09-17 23:04:37 +01:00
Jakob Bornecrantz b6786f5bfc st/oxr: Return controller name for bindings 2020-09-17 15:28:59 +01:00
Jakob Bornecrantz 33713c790c st/oxr: Correctly return sub path for input source 2020-09-17 00:26:12 +01:00
Jakob Bornecrantz 0fc4cdcd0f st/gui: Get the number of samples in a fifo for graph 2020-09-16 17:27:16 +01:00
Bart Ribbers 71f912ffc5 Fix compilation on Musl
Without this fix, compilation failed on Musl due to ssize_t being an
unknown type

In file included from ../src/xrt/state_trackers/prober/p_prober.c:15:
../src/xrt/state_trackers/prober/p_prober.h:67:2: error: unknown type name 'ssize_t'
   67 |  ssize_t interface;
      |  ^~~~~~~
2020-09-16 10:44:06 +02:00
Jakob Bornecrantz f7ff6c08ed st/gui: Plot vec3_f32 filter fifos 2020-09-15 16:41:07 +00:00
Jakob Bornecrantz 468f72d62f st/gui: Include ImPlot and Monado-ImGui in gui_imgui header 2020-09-15 16:41:07 +00:00
Jakob Bornecrantz f843c59c37 imgui: Add ImPlot 2020-09-15 16:41:07 +00:00
Jakob Bornecrantz 36ea1825bf imgui: Update to 1.78 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
Christoph Haag ddf3eb5789 st/oxr: Use space graph in global-to-local space transform
This takes care of transforming the velocities.
2020-09-11 19:06:16 +02:00
Christoph Haag f41edee4b4 st/oxr: Use space graph resolve result relation flags instead of pure pose relation 2020-09-11 18:52:01 +02:00
Christoph Haag 19acc7be25 st/oxr: Pass actual ViewStateFlags to application with xrLocateViews
These flags are originally set by the driver, then processed by the space graph resolver.
2020-09-11 18:52:01 +02:00
Christoph Haag 2b90b4ea89 st/oxr: Destroy compositor on instance destroy
Fixes direct mode on subsequent instance creation in the same process
when no session was created.
2020-09-11 18:52:01 +02:00
Christoph Haag 844daee844 st/oxr: Check xrLocateViews quaternion only if orientation valid 2020-09-11 18:52:01 +02:00
Jakob Bornecrantz 8e24dda794 xrt: Remove out_timestamp argument to xrt_device::get_tracked_pose 2020-09-07 23:37:09 +01:00
Jakob Bornecrantz eaffa05a37 xrt: Remove acceleration components from xrt_space_relation 2020-09-07 23:36:34 +01:00
Jakob Bornecrantz d60cce8977 st/oxr: Use new xrt_space_graph 2020-09-07 23:33:28 +01:00
Jakob Bornecrantz 6846ab7637 xrt: Add stream capture type 2020-09-02 11:52:59 +01:00
Christoph Haag cde94cc8a2 build: Remove libv4l2 dependency from meson
We use the linux/v4l2-common.h header to access v4l devices, not libv4l from v4l-utils.
2020-08-28 12:10:53 +00:00
Jakob Bornecrantz 557dacbb02 st/oxr: Special case the any path for pose actions 2020-08-28 10:34:19 +00:00
Jakob Bornecrantz deb5633bf9 d/psmv: Introduce proper grip and aim poses
Correctly rotate the grip pose to follow the spec more closely.
2020-08-27 10:42:05 +01:00
Ryan Pavlik ff603d3acd st/oxr: Add layer type conditionals around depth-image manipulation 2020-08-26 12:28:43 -05:00
Ryan Pavlik 2ac0013e25 st/oxr: Verify that the compositor created can actually do the layer types claimed. 2020-08-26 12:28:35 -05:00
Jakob Bornecrantz cac588bbf2 st/oxr: Get maximum layers from the compositor info 2020-08-26 15:25:00 +01:00
Jakob Bornecrantz bf9f0e6e39 st/oxr: Use the right depth projection function 2020-08-25 14:55:43 +01:00
Christoph Haag 2cd010b65f st/oxr: Verify that projection layer has 0 or view count depth layers 2020-08-24 12:29:47 +02:00
Christoph Haag a9193b0e89 st/oxr: Pass through depth layer to compositor
The compositor does not make use of this layer yet.
2020-08-24 10:30:23 +02:00
Christoph Haag 4f2d421903 st/oxr: Verify depth layer 2020-08-24 10:30:23 +02:00
Christoph Haag 5a854fc806 st/oxr: projection layer swapchain NULL check 2020-08-24 10:18:12 +02:00
Jakob Bornecrantz a4693f3162 st/oxr: Include m_mathinclude.h and tidy includes 2020-08-21 12:18:09 +01:00
Christoph Haag 8a17481301 st/oxr: handle subimage rect in submit_cylinder_layer 2020-08-21 02:11:03 +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 54149b12b9 st/oxr: Handle the android extension 2020-08-19 11:01:12 -05:00
Jakob Bornecrantz 8a4db7b3ef st/oxr: Make sure that an identity transform is only inserted when needed 2020-08-18 19:44:26 +01:00
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
Jakob Bornecrantz a36753443a st/oxr: Make all oxr_error calls uniform and improve output 2020-06-03 09:30:18 +01:00
Jakob Bornecrantz f4fadc6f55 st/oxr: Validate xrSuggestInteractionProfileBindings better 2020-06-03 09:30:18 +01:00
Jakob Bornecrantz 6ff4b23a76 st/oxr: Add a lightweight function to test for XrPath validness 2020-06-03 09:30:18 +01:00
Jakob Bornecrantz 2b60f70d30 st/oxr: Validate attachmentness of action sets and actions better 2020-06-03 09:30:18 +01:00
Jakob Bornecrantz 6fc410dadd st/oxr: Do dup checking on actions and action sets 2020-06-03 09:30:18 +01:00
Jakob Bornecrantz e5c9636f10 st/oxr: Correct the error messages on sub action paths errors 2020-06-03 09:30:18 +01:00
Jakob Bornecrantz 6d61b9dec2 st/oxr: Correct localized name validation 2020-06-03 09:30:18 +01:00
Jakob Bornecrantz a69cae7516 st/oxr: Improve subImage bounds checking 2020-06-03 09:30:18 +01:00
Jakob Bornecrantz 981bae8d0a st/oxr: Return correct error on bad sub action path 2020-06-02 13:02:04 +01:00
Jakob Bornecrantz 00818881de st/oxr: Use correct path for gamepad 2020-06-02 13:02:04 +01:00
Jakob Bornecrantz 57af7a7ce4 st/oxr: Correctly wait with emitting sync event 2020-06-02 13:02:04 +01:00
Jakob Bornecrantz f0e160f45c st/oxr: Improve the xrGetReferenceSpaceBoundsRect stub-ness 2020-06-02 13:02:04 +01:00
Jakob Bornecrantz d693bc2ef9 st/oxr: Enforce static swapchain acquire semantics 2020-06-02 13:02:04 +01:00
Jakob Bornecrantz cdfd03a762 st/oxr: Overhaul the acquire, wait, release handling 2020-06-02 13:02:04 +01:00
Jakob Bornecrantz b3523a7259 st/oxr: Protoct event queue with a mutex 2020-06-02 13:02:04 +01:00
Jakob Bornecrantz 76e4092e30 st/oxr: Purge event queue of destroyed sessions 2020-06-02 13:02:04 +01:00
Jakob Bornecrantz 185036489c st/oxr: Ensure get gfx requirements has been called 2020-06-02 13:02:04 +01:00
Jakob Bornecrantz 12d78144f6 st/oxr: Verify XrViewConfigurationType in xrEnumerateEnvironmentBlendModes 2020-06-02 13:02:04 +01:00
Jakob Bornecrantz fb867b02c3 xrt: Remove array_size field on xrt_swapchain 2020-06-02 13:02:04 +01:00
Christoph Haag f68252bfbe st/oxr: Check quadlayer swapchain for NULL 2020-06-01 18:38:54 +02:00
Christoph Haag 6045742561 st/oxr: Translate relation_flags in oxr_space_locate() 2020-05-29 01:46:42 +02:00
Christoph Haag 7fe0f3610b st/oxr: Fill entire xrt_space_relation in oxr_xdev_get_pose_at, not just pose
In particular the relation_flags indicate whether the pose is valid or a fallback pose.
2020-05-29 01:25:57 +02:00
Christoph Haag f10b341f57 st/oxr: Don't assert on invalid pose
ensure_valid_position_and_orientation() inserts fallback poses when
driver reported poses are invalid.
2020-05-29 01:09:54 +02:00
Christoph Haag c9b692903c st/oxr: Don't indiscriminately set orientation & position to valid in oxr_space_action_relation() 2020-05-29 01:02:31 +02:00
Christoph Haag 3bdc57c4b3 st/oxr: Don't indiscriminately set orientation & position to valid in ensure_valid_position_and_orientation() 2020-05-29 00:57:35 +02:00