Commit Graph

125 Commits

Author SHA1 Message Date
Ilya 92c136bc73
Merge branch 'bjornbytes:master' into picofix 2022-12-01 21:20:33 +03:00
bjorn f9d7742dfd Add support for headless headset rendering;
Although the name is unfortunate, this allows access to lovr.headset
when no window is opened or when the graphics module is disabled.  This
requires the XR_MND_headless extension to be supported by the runtime.
2022-11-26 14:40:39 -08:00
Ilya Chelyadin 13d8c4a207 Interaction profiles suggestion improvement
At least one profile should be supported. Monado fails on Neo 3 profile.
2022-11-25 21:16:42 +03:00
Ilya Chelyadin 3f20364c3f Pico is back!
Tested on Pico Neo 3 with PUI v4.9.3
Also included generic (Monado-Android) Android flavor.
2022-11-22 22:01:13 +03:00
bjorn 6d1bbe9c5c Fix Android build on new NDKs;
Some Android header defines DEPTH, which clashes with a symbol in the
OpenXR driver.  This change just stops using Android headers in there
and declares more granular private functions.  It also removes a few
unused private os functions.
2022-11-15 20:35:39 -08:00
Josip Miskovic 9b6e884f7f Remove problematic bindings from Index controller
The "system" button on Valve Index controller may not be exposed to
applications through OpenXR. Oculus runtime throws error when binding
for that button is attempted.
2022-10-18 21:50:48 -07:00
bjorn 0d7ed04789 Fix Quest pinch axis; 2022-10-02 14:00:52 -07:00
bjorn b5620fb185 Revert "Fix Quest hand model orientation;"
This reverts commit a766bf4a35.
2022-09-26 14:58:34 -07:00
bjorn a766bf4a35 Fix Quest hand model orientation; 2022-09-23 17:52:21 -07:00
bjorn d2ceb6b81a Fix skeletal animation on some GPUs;
The animation compute shader was not specializing the workgroup size
properly, so it was only working on GPUs with a subgroup size of 32.

The Quest 1 has a subgroup size of 32 and the Quest 2 has a subgroup
size of 64, so this resulted in hand models breaking on Quest 2 only!
2022-09-23 14:36:20 -07:00
bjorn 311d1511bc Fix quest keyboard tracking; 2022-09-21 14:58:30 -07:00
bjorn ece73be868 lovr.headset.getPose works with keyboard device on Quest; 2022-09-20 20:16:58 -07:00
bjorn d1b6bd3d15 OpenXR: fall back to d24s8 when d32fs8 isn't supported;
Window was already doing this.

Quest currently doesn't work with stencil = true because of this.
2022-09-20 19:09:04 -07:00
bjorn 6444aba832 OpenXR: Map Index system buttons to menu;
SteamVR doesn't expose these, but monado does, so might as well bind them.
2022-09-14 21:35:43 -07:00
bjorn de44f88b5f rm XR_KHR_android_create_instance;
It's not needed anymore.
2022-08-26 23:21:01 -07:00
bjorn ede1036694 Temporary Passes;
Sigh, back to getPass.  I don't even know at this point.  Basically now
that we came up with a half-solution for temp buffers, it makes sense to
apply this to passes as well, since we aren't going with the workstream
idea and temp passes are more convenient than retained passes.
2022-08-25 21:57:15 -07:00
bjorn 10252686aa Fix typo; 2022-08-22 20:18:47 -07:00
bjorn 8b83626051 Increase size of swapchain format array; 2022-08-20 11:03:14 -07:00
bjorn 6fa8b570da Fix OpenXR usage of setBackground; 2022-08-13 21:21:17 -07:00
bjorn 6052ed7a95 Rename ModelData enums;
To better match graphics.
2022-08-13 21:10:03 -07:00
bjorn 31d49fe8c6 When graphics module is destroyed, stop XR session;
Terrible, but better.
2022-08-08 23:27:35 -07:00
bjorn 8aa1cf91b2 Submit depth buffer to OpenXR; 2022-08-06 22:52:18 -07:00
bjorn 6011e61d52 Fix lovr.headset.newModel and lovr.headset.animate; 2022-08-06 00:29:46 -07:00
bjorn fcbeccdfb1 Fix background colors; 2022-08-05 21:05:02 -07:00
bjorn a23f0351cc WIP OpenXR layout transitions; 2022-08-05 18:36:51 -07:00
bjorn 9b19a1cd47 Fix lovr.headset.animate; 2022-08-02 23:06:49 -07:00
bjorn 4ee092e81b Make Pass a regular object;
It uses newPass instead of getPass.  Temporary objects had lifetime
issues that were nearly impossible to solve.  And normal objects are
easier to understand because they behave like all other LÖVR objects.

However, Pass commands are not retained from frame to frame.  Pass
objects must be re-recorded before every submit, and must be reset
before being recorded again.

Pass objects now provide a natural place for render-pass-related info
like clears and texture handles.  They also allow more information to be
precomputed which should reduce overhead a bit.

It is now possible to request a stencil buffer and antialiasing on the
window and headset textures, via conf.lua.

lovr.graphics.setBackground should instead set the clear color on the
window pass.  Though we're still going to try to do spherical harmonics
in some capacity.

There are still major issues with OpenXR that are going to be ironed
out, and the desktop driver hasn't been converted over to the new
headset Pass system yet.  So lovr.headset integration is a bit WIP.
2022-08-02 22:06:44 -07:00
bjorn 289f08b0df Fix OpenXR texture layer count; 2022-08-01 22:43:44 -07:00
bjorn 83fa750a4d Support and default to reverse-z with infinite far plane; 2022-07-17 12:37:59 -07:00
bjorn 1946fbb540 Reduce default near plane;
I feel like we've (un)done this before...
2022-07-17 11:05:24 -07:00
bjorn d088c5471d Model;
Does not include some of the fancier accessors yet.
2022-07-03 17:26:31 -07:00
bjorn 7def390f9c OpenXR/CMake fixes; 2022-06-20 15:51:24 -07:00
bjorn c1bb47d737 Merge branch 'master' into dev 2022-06-16 23:50:11 -07:00
bjorn d5325b87b4 Headset support; 2022-06-05 20:38:14 -07:00
Samuel Gosselin 255f4e4a34 fixup: keep coding style consistent. 2022-05-06 10:55:29 -07:00
Samuel Gosselin 02c67d090d fixup: gracefully handle XR_ERROR_DISPLAY_REFRESH_RATE_UNSUPPORTED_FB and return |false| instead. 2022-05-06 10:55:29 -07:00
Samuel Gosselin 425a2ca343 Add support for setting the display refresh-rate.
OpenXR provides APIs to enumerate the supported refresh-rates, and
selecting a new refresh-rate. This patch adds two new APIs to the
lovr.headset module:

  - lovr.headset.getDisplayFrequencies():
	Returns a table containing the supported refresh-rates on
	success; nil otherwise.
  - lovr.headset.setDisplayFrequency(refreshRate:number):
	Returns true on success, false otherwise.

Only the OpenXR backend has support for this feature and it is
gated by the "refreshRate" feature flag, similarly to what the
"getDisplayFrequency()" API does.
2022-05-06 10:55:29 -07:00
Ryan Pavlik 307d33b327 Allow XR_KHR_android_create_instance to be optional.
It's essentially replaced by KHR_loader_init_android,
and will eventually not be provided by new/updated runtimes
2022-05-06 09:28:15 -07:00
jascase901 51d96f6fa2 include required for linux support. 2022-04-24 13:07:59 -07:00
jascase901 aeb269b24a use static assert macro instead of keyword
This change fixes a linker error I noticed when compiling on my windows
sytstem. see #551

According to this link the macro is prefered to the keyword.
https://docs.microsoft.com/en-us/cpp/c-language/static-assert-c?view=msvc-170#:~:text=The%20_Static_assert%20keyword%2C%20and%20the%20static_assert%20macro%2C%20both,runtime%20and%20incur%20a%20runtime%20cost.%20Microsoft-specific%20behavior
2022-04-24 13:07:59 -07:00
bjorn 37221afbc6 rm graphics module; 2022-04-21 17:39:58 -07:00
bjorn b32244b787 OpenXR: Make update idempotent;
The state tracking here is getting pretty complicated... oh well!
2022-03-30 13:33:02 -07:00
bjorn 0238549e66 OpenXR: sync all subaction paths; 2022-03-30 13:33:02 -07:00
bjorn 2ec5a1a9dd OpenXR: Valve Index grip improvements; 2022-03-30 11:13:55 -07:00
bjorn 3972a8df20 Reset OpenXR event type after polling;
Otherwise the struct will have the wrong type when polling the next
event.  Kind of annoying.
2022-03-29 08:56:26 -07:00
bjorn 243e686ea4 rm lovr.headset.getDisplayMask; 2022-03-22 19:45:44 -07:00
bjorn 1eed2bc83c lovr.headset.isFocused; 2022-03-22 19:43:00 -07:00
bjorn 1f3c5dea79 dt uses headset time instead of system time; 2022-03-22 17:52:16 -07:00
bjorn 2da18d419b mv util src; 2022-03-22 00:13:38 -07:00
bjorn 721d4e180d Clean up OpenXR extensions;
One per line, with scannable name strings.
2022-03-21 17:01:03 -07:00