Lubosz Sarnecki
0dbbe423d9
c/layer_renderer: Implement eye visibility.
2020-06-18 16:03:49 +01:00
Jakob Bornecrantz
e76f698463
c/main: Respect alpha blending layer flag
2020-06-18 16:03:49 +01:00
Jakob Bornecrantz
e8d62d948f
aux/vk: Add helper to create image view with component swizzles
2020-06-18 13:48:10 +01:00
Jakob Bornecrantz
3055102217
tests: Use project code formatting on tests
...
v2: Increase line length, and add to formatting script (rpavlik)
2020-06-17 17:32:23 -05: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
Ryan Pavlik
876c8bc5d7
inc/xrt: Remove now-unneeded enum.
2020-06-17 11:48:43 +01: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
Christoph Haag
fb103659ef
build: Support building with v4l2 installed but driver disabled
2020-06-17 11:33:13 +02: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
d778c236fe
c/client: A working but non-spec conforming way to get Vulkan clients working
2020-06-16 16:33:04 +01:00
Jakob Bornecrantz
04c150a50d
xrt: Add new error and types for Vulkan command buffers
2020-06-16 00:01:48 +00:00
Benjamin Saunders
f81f568931
aux/vk: Add helper to translate usage bits to Vulkan bits
2020-06-16 00:01:48 +00:00
Benjamin Saunders
fe734bb6e2
aux/vk: Add functions to create semaphores from FDs
2020-06-16 00:01:48 +00:00
Benjamin Saunders
3f744331e1
aux/vk: Declare consistent usage for xr swapchain images
2020-06-16 00:01:48 +00:00
Benjamin Saunders
27d2163f37
aux/vk: Delete nonsensical image usage case
2020-06-16 00:01:48 +00:00
Benjamin Saunders
f45f482d5e
aux/vk: Store Vulkan queue handle directly
2020-06-16 00:01:48 +00:00
Jakob Bornecrantz
65dcc82e3a
comp+ipc: Respect view space layer flag
2020-06-15 23:59:04 +00:00
Jakob Bornecrantz
abf8d5b8bd
st/oxr: More correctly handle spaces for layers
2020-06-15 23:59:04 +00:00
Jakob Bornecrantz
fbd41e0413
xrt: Add new layer flag for view space poses
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
821706e0e4
u/hashmap: Add "empty" function.
...
Used for cleanup assertions to start with: i.e. at some known point,
the hash map should be empty.
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
Ryan Pavlik
79b2cf6703
inc/xrt: Improve docs
2020-06-15 10:36:28 -05:00
Christoph Haag
8141a3c761
ipc: Reset waitframe semaphore when client disconnects
...
The semaphore was usually kept at a value of 1 after a client disconnected,
meaning the next client to connect was never blocked on it.
2020-06-15 15:47:56 +02: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
Gonzalo Aguilar Delgado
cdde7cd2c2
FIX #88 : Add required dependencies
2020-06-13 17:05:14 +00:00
Jakob Bornecrantz
e4a4a5e7b2
st/oxr: Use correct enum type when converting from eye visibility NFC
2020-06-13 13:58:14 +01:00
Ryan Pavlik
172ff0f434
ipc: Simplify code by just copying a structure.
2020-06-09 17:13:06 -05:00
Ryan Pavlik
1881bb6357
ipc: Further de-duplication of structures
2020-06-09 17:07:22 -05:00
Ryan Pavlik
b6b5052d48
ipc: Remove structs that effectively duplicate xrt_layer_data
...
The only non-duplicate members are the swapchain IDs,
so store those in their own array as already done elsewhere in the
codebase.
2020-06-09 17:07:22 -05:00
Ryan Pavlik
f407fb9461
ipc: Doc comments
2020-06-09 17:07:22 -05:00
Ryan Pavlik
eaa4c186ce
ipc: Port to using xrt_sub_image where possible.
...
This highlighted several places where we are not considering an image rect,
but possibly should be.
2020-06-09 16:26:01 -05:00
Ryan Pavlik
26ab046fba
comp: Remove no-longer-needed comp_layer_quad struct.
...
Replaced by xrt_comp_layer_quad.
Also add some comments.
2020-06-09 16:19:39 -05:00
Ryan Pavlik
7446dc08d5
xrt: Rename output parameter of acquire_image to out_image.
...
As is tradition.
2020-06-09 15:56:26 -05:00
Ryan Pavlik
03f85fcd0a
inc/xrt: Doc comment improvements
2020-06-09 15:52:33 -05:00
Ryan Pavlik
d7562ba65c
fixup commit
2020-06-09 15:32:51 -05:00
Ryan Pavlik
8ffad1112f
inc/xrt: Update docs to fix Doxygen warnings
2020-06-09 15:32:39 -05:00
Ryan Pavlik
e0e5aeceda
xrt: name xrt_swapchain pointers consistently "xsc" or similar.
...
As is tradition.
2020-06-09 15:29:46 -05: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
Jakob Bornecrantz
320c9ab3cb
ipc+comp: Use new xrt_layer_data and friends struct
2020-06-09 19:04:48 +00:00
Jakob Bornecrantz
5912964ded
ipc+comp: Even more make layers the same
2020-06-09 19:04:48 +00:00
Lubosz Sarnecki
08d81e5950
ipc+comp: Make layer structs more consistent.
...
Add missing fields.
Sort layer struct members.
ipc/protocol: Move xdev_id and name to common layer struct.
2020-06-09 19:04:48 +00:00
Jakob Bornecrantz
15be0209b9
xrt: Introduce xrt_layer_[quad|stereo_projection]_data struct
2020-06-09 19:04:48 +00:00
Lubosz Sarnecki
cbb8573d35
xrt: Move layer enums to compositor header.
2020-06-09 19:04:47 +00:00
Lubosz Sarnecki
b1d39e7f07
xrt: Move layer enum to xrt namespace.
2020-06-09 19:04:47 +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
Christoph Haag
db5db10a19
ipc: Replace ipc_result_t with global xrt_result_t
...
Functions down the line should be able to fail and return a status.
They can be called either through IPC or directly depending on compile settings,
therefore we need an internal result type for various XR_ERROR_* errors, but also IPC failure.
For now functions in ipc_client_utils.c only return XRT_SUCCESS or XRT_ERROR_IPC_FAILURE.
If there is no IPC failure, the generated protocol will extract and return the called functions'
actual return value from the reply.
v2: make failure results negative
2020-06-05 16:02:38 +02:00
Jakob Bornecrantz
dab96ef356
st/oxr: Validate view configuration type
2020-06-04 21:56:08 +00:00
Jakob Bornecrantz
077087bb15
xrt: Introduce xrt_comp_fd_destroy to avoid some error prone casting
2020-06-04 16:37:06 +00:00
Ryan Pavlik
c39df58763
st/oxr: Additional doxygen improvements.
2020-06-03 17:26:35 -05:00
Ryan Pavlik
4ee0ad7767
comp/client: Decrease visibility of downcast helpers.
2020-06-03 16:28:36 -05:00
Ryan Pavlik
d0468a7697
inc/xrt: Remove no-longer-needed fd-related downcast helpers.
2020-06-03 16:28:36 -05:00
Ryan Pavlik
cc609f5fb7
comp/client: Use helper functions, comment.
2020-06-03 16:28:36 -05:00
Ryan Pavlik
0f7fe8f3fa
inc/xrt: Add a specialized create_swapchain helper for xrt_compositor_fd
2020-06-03 16:28:36 -05:00
Ryan Pavlik
b38a8e8c24
targets/service: Remove unneeded xrt_prober_create function.
2020-06-03 16:28:21 -05:00
Ryan Pavlik
bc6cc85e7d
xrt: Improve doxygen documentation.
2020-06-03 16:28:18 -05:00
Lubosz Sarnecki
435d5a9b9e
c/comp: Remove internal Vulkan validation init.
...
Instead of maintaining this chunk of code and build options, the Vulkan
loader can be used to load up validation. This has the advantage that no
layer name needs to be hard coded inside Monado, which was subject of
change recently.
Instead of using our own environment variable we can easily set the one
from the loader, e.g. `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`.
2020-06-03 11:17:51 +00: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
Jakob Bornecrantz
09baeb91bc
c/swapchain: Close and remaining open FDs
2020-06-02 13:02:04 +01:00
Jakob Bornecrantz
753b910b5a
c/swapchain: Don't only give out the zero index
2020-06-02 13:02:04 +01:00
Jakob Bornecrantz
5b0085f1c1
c/client: Mark consumed FDs as invalid
2020-06-02 13:02:04 +01:00
Jakob Bornecrantz
9ec0b559d4
ipc/util: Don't follow null pointers and add alignment paranoia
2020-06-02 13:02:04 +01:00
Jakob Bornecrantz
05827abd8e
ipc/server: Fix swapchain handling
2020-06-02 13:02:04 +01:00
Jakob Bornecrantz
ebd5773fb8
util: Add function for u_hashset to allocate a item
2020-06-02 13:02:04 +01:00
Jakob Bornecrantz
0d2a24b9a0
util: Add a index fifo
2020-06-02 13:02:04 +01:00
Jakob Bornecrantz
371622c199
d/psvr: Normalize rotation
2020-06-02 13:02:04 +01:00
Lubosz Sarnecki
7186bddf60
c/comp+ipc: Use array indices again.
...
This fixes a regression introduced by the IPC and layer rendering
patchsets and passes the array_index to the correct places, so the
correct VkImageView is used instead of the one with index 0.
2020-06-02 12:42:42 +02:00
Christoph Haag
f68252bfbe
st/oxr: Check quadlayer swapchain for NULL
2020-06-01 18:38:54 +02:00
Jakob Bornecrantz
77c2b9cb5d
c/main: Include <math.h> in comp_layer_renderer.c
2020-05-29 23:37:22 +01:00
Jakob Bornecrantz
ace4d0e825
os/threading: Incude xrt_compiler.h
2020-05-29 23:36:23 +01: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
Christoph Haag
384114b821
d/survive: Don't invert valid position condition
2020-05-29 00:35:58 +02:00
Lubosz Sarnecki
1e8106c974
c/compositor: Render multiple layers without IPC.
...
Hook up layer rendering when XRT_FEATURE_SERVICE is not set.
2020-05-28 22:16:57 +00:00
Lubosz Sarnecki
4ad806df38
ipc/server_process: Check for swapchain NULL pointer.
...
Skip rendering when swapchains are invalid.
2020-05-28 22:16:57 +00:00
Jakob Bornecrantz
066009c0c5
c/layer_renderer: Enable blending.
2020-05-28 22:16:57 +00:00
Lubosz Sarnecki
d0539161dc
c/renderer+ipc: Use layer renderer.
...
Make the renderer and IPC aware of multiple projection and quad layers
using the layer renderer.
Remove redundant code related to idle images and imported buffers and
command buffer rebuild, since we now always just display the layer
renderer's frame buffer.
Get view and projection properties from xrt_device.
2020-05-28 22:16:57 +00:00
Lubosz Sarnecki
aedd4d9ff8
c/layers: Implement layer renderer.
...
Implements a layer renderer capable of handling multiple quad
and projection layers rendered in it's own Vulkan pipeline.
2020-05-28 22:16:57 +00:00
Lubosz Sarnecki
fc271ad5da
aux/math: Add function to calculate quad model matrix.
2020-05-28 22:16:57 +00:00
Lubosz Sarnecki
68c5eecb96
aux/vk: Add image helper struct and functions.
2020-05-28 22:16:56 +00:00
Lubosz Sarnecki
589c7e4fef
aux/vk: Add buffer helper structs and functions.
2020-05-28 22:16:56 +00:00
Lubosz Sarnecki
905040319a
aux/vk: Use optimal tiling in vk_create_image_simple.
...
Fixes an validation issue on NVIDIA and should bring more performance.
2020-05-28 22:16:56 +00:00
Jakob Bornecrantz
03f802de77
st/oxr: Correctly validate time in xrLocateSpace
2020-05-28 22:56:59 +01:00
Jakob Bornecrantz
dd04379209
st/oxr: Now that layers are supported up the max layers to what the spec requires
2020-05-28 22:56:59 +01:00
Ryan Pavlik
cef1970340
ipc: Make script more pythonic
2020-05-28 13:22:30 -05:00
Ryan Pavlik
ff3a4d8b50
ipc: Fix all Flake8 warnings
2020-05-28 13:20:28 -05:00
Ryan Pavlik
4efdb6762a
ipc: More script simplification.
2020-05-28 11:56:22 -05:00
Ryan Pavlik
0964a6dd07
ipc: Clean up generation script
2020-05-28 11:34:36 -05:00
Ryan Pavlik
a44a915151
ipc: Put generator main in a function, for testing purposes
2020-05-28 11:34:36 -05:00
Ryan Pavlik
8bd1ac776e
ipc: Fix class methods, mistaken use of class variables in IPC generator
2020-05-28 11:34:36 -05:00
Christoph Haag
7b2c54c223
d/survive: don't report invalid poses as valid
2020-05-28 17:37:09 +02:00
Christoph Haag
25bafd71c8
d/survive: Remove useless loop
...
We already have a SurviveSimpleObject, no need to look for it through iteration
2020-05-28 17:20:46 +02:00
Jakob Bornecrantz
7cd9dfabc8
st/oxr: Translate swapchain usage flags
2020-05-28 15:50:47 +01:00
Jakob Bornecrantz
23b882df08
st/oxr: Write out pose values on failure, better say which layer failed and also check projection layer poses
2020-05-28 15:50:47 +01:00
Jakob Bornecrantz
9d791cdfd3
math: Use non-squared 'length' of quat in validation
...
Correctly validate quaternion using non-squard "length" instead of squard
"length", certain combinations of elements would produce valid regular "length"
but not valid squard ones.
2020-05-28 15:50:47 +01:00
Ryan Pavlik
8c54139f79
inc/xrt: Remove declaration of xrt_prober_create.
2020-05-27 18:40:56 -05:00
Ryan Pavlik
a034260ec3
ipc/client: Remove implementation of xrt_prober_create
2020-05-27 18:40:56 -05:00
Ryan Pavlik
293ec1e6dd
st/p: Use helper functions for xrt_device
2020-05-27 18:40:56 -05:00
Ryan Pavlik
011a68704c
st/gui: Use helper functions for xrt_device
2020-05-27 18:40:56 -05:00
Ryan Pavlik
1438541147
st/gui: Port to using xrt_instance, instead of xrt_prober directly.
2020-05-27 18:40:56 -05:00
Ryan Pavlik
1a313b6f58
t/cli: Port to use xrt_instance, instead of xrt_prober directly.
2020-05-27 18:40:56 -05:00
Ryan Pavlik
51dba8ad94
t/common: Add a target_instance_no_comp library
2020-05-27 18:40:56 -05:00
Ryan Pavlik
3b1f003705
t/openxr: Remove reference to/implementation of xrt_prober_create
2020-05-27 18:40:56 -05:00
Ryan Pavlik
6c77b8d314
t/common: Replace references to xrt_prober_create
2020-05-27 18:40:56 -05:00
Ryan Pavlik
c42675437b
st/gui: Remove no-longer-needed timekeeping.
2020-05-27 18:40:56 -05:00
Ryan Pavlik
c7841fd73c
inc/xrt: Improve docs for prober interface.
2020-05-27 18:40:56 -05:00
Jakob Bornecrantz
aa0523e535
c/main: Only allocate one image for static swapchains
2020-05-27 21:57:48 +01:00
Jakob Bornecrantz
e8e7493679
ipc: Pass all arguments to create swapchain image
2020-05-27 21:57:48 +01:00
Jakob Bornecrantz
efd35da334
st/oxr: Correctly translate XrSwapchainCreateFlags
2020-05-27 21:21:00 +01:00
Jakob Bornecrantz
0aeb2ccfb2
st/oxr: Turn XrPaths into atoms
2020-05-27 21:21:00 +01:00
Jakob Bornecrantz
7cf5edbf87
st/oxr: Now that IPC correctly wait frames check predicted display for zero
2020-05-27 18:12:26 +01:00
Jakob Bornecrantz
51545411f9
st/oxr: Validate time better xrConvertTimeToTimespecTimeKHR
2020-05-27 18:12:26 +01:00