Commit graph

2525 commits

Author SHA1 Message Date
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 0673c2e375 doc: Document !666 and !667 2021-01-25 00:12:03 +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
Dan Weatherford bd381561d8 d/vive: Fix distortion center config parsing 2021-01-23 14:02:31 -06: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
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 844d2c9d58 doc: add changelog for MR 638 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 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
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 e09d2db8e5 xrt: Add various device and input enum values 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 69fc55e15e xrt: cast XRT_GET_INPUT_TYPE result
Useful for C++ compilers.
2021-01-20 18:23:09 +01:00
Christoph Haag db2b77c9cb build/meson: Copy steamvr assets at build time, not configure time 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 c3d12a2dc4 ipc: Tidy logging 2021-01-20 16:24:47 +00: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
Jakob Bornecrantz 57bfbb615f ipc: Tidy code and clang-format 2021-01-19 18:15:02 +00:00
Jakob Bornecrantz a0598c07ae st/gui: Tidy code and clang-format 2021-01-19 18:15:02 +00:00
Jakob Bornecrantz b48036a3ff st/oxr: Tidy code and clang-format 2021-01-19 18:15:02 +00:00
Christoph Haag 9481013081 comp: add VkDisplayKHR window backend
Must be activated/selected with an env var for now: XRT_COMPOSITOR_FORCE_VK_DISPLAY=2
2021-01-19 17:00:46 +00:00
Ryan Pavlik 1ea5403435 t/oxr_android: Add empty service for runtime advertisement 2021-01-19 16:13:44 +00:00
Ryan Pavlik 36b9d9e7c5 gradle: Update comment 2021-01-19 16:13:44 +00:00
Ryan Pavlik 50ddf1c11c gradle: Remove redundant, unused task 2021-01-19 16:13:44 +00:00
Christoph Haag 5e8338a6de comp: Render with pose for next display time, not last 2021-01-15 18:25:27 +01:00
Jakob Bornecrantz 3abbd75ef4 scripts: Add support for clang-format 10 and 11 2021-01-15 16:38:56 +00:00
Jakob Bornecrantz 360dbb63a7 d/ns: Work-around clang-format stuff 2021-01-15 16:38:54 +00: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
Jakob Bornecrantz c6db6dc653 xrt: Change number of columns to 120 2021-01-15 13:44:44 +00:00
Christoph Haag 9c03f244b0 d/survive: Wait max 5 seconds for HMD and device configs
Sometimes the Index is in weird hardware states and doesn't respond properly.
In such cases, time out after 5 seconds and continue with no HMD present.

Previously we also relied on the controller configs to be already available
once the HMD config was available. In rare cases they were not - wait for
the controller configs with the same timeout.
2021-01-15 00:50:20 +01:00
Lubosz Sarnecki 621a4bbe59 aux/vk: Add formats used in CTS to format string function. 2021-01-14 13:54:19 +01:00