Commit Graph
38 Commits
Author SHA1 Message Date
Jonathan Steffan b8e24d7677 chore: update monado to be69de9e2, handle new xrt_view_type values 2026-10-15 23:00:44 +02:00
Patrick Nicolas e604848409 Remove WIVRN_DUMP_TIMINGS 2026-08-17 21:30:57 +02:00
Patrick Nicolas 333e080d1c Provide Vulkan version to Monado 2026-07-30 19:12:06 +02:00
Patrick Nicolas 4fb50ed556 Update Monado 2026-07-29 23:40:21 +02:00
umceko e57577d675 Fix main queue synchronization with monado
copy_mutex duplicated the pthread_mutex_t of vk.queue.mutex into
main_queue->mutex by value, which creates an independent mutex: monado
submissions on IPC client threads (comp_swapchain image transitions,
vkDeviceWaitIdle in image_cleanup) did not exclude wivrn's layer_commit
and encoder submissions on the same VkQueue. This intermittently
corrupts driver state when a client creates or destroys swapchains
while streaming, observed as SIGSEGV inside vkQueueSubmit2 and as
uncaught vk::SystemError from layer_commit on NVIDIA.

Initialize monado's queue mutexes and redirect vk.queue.mutex to the
main queue os_mutex so every submitter takes the same lock.
2026-07-14 09:25:35 +02:00
Jonathan Steffan b9c8a54d92 Add WiVRn-native Perfetto via Perfetto SDK
Optional server profiling built on the Perfetto SDK. Adds CPU spans
(compositor, encoder, network), GPU encode/copy slices from Vulkan timestamp
queries (Vulkan/NVENC/VAAPI), and headset feedback markers from dump_time.

WIVRN_TRACING enables tracing and selects the backend (system, inprocess, or
both); WIVRN_USE_PERFETTO gates it at build time and compiles it out otherwise.
WIVRN_TRACE_MONADO additionally drives Monado's percetto tracing from the same
switch so WiVRn and Monado land on one timeline.

Tooling: server-tracing[-monado] presets and a CI build, two Perfetto configs
(WiVRn-only and full-system), a wivrn_capture.py capture wrapper, a pftrace
summary script, and docs/profiling.md.
2026-07-01 21:04:08 +02:00
Patrick Nicolas d294a80678 Clear image when no layers are submitted 2026-06-18 09:59:58 +02:00
Patrick Nicolas 9940580fbd Don't forward 0 refresh rate to headset 2026-06-13 23:05:52 +02:00
Patrick Nicolas 43395e6e40 Add logs for refresh rate change 2026-06-13 23:05:52 +02:00
Patrick Nicolas 9313ccbc1d Use multiple vulkan encode queues if possible 2026-05-19 06:59:03 +02:00
Jonathan Steffan e79621d377 Fix vulkan encode QFOT layouts (NVIDIA green frame)
Compositor release left layouts as eUndefined while encoder acquire
transitioned to eVideoEncodeSrcKHR (or eTransferSrcOptimal on the NVIDIA
tmp_image path); the spec forbids that layout mismatch for exclusive-mode
QFOT. NVIDIA honoured it by treating encode-queue contents as undefined
(solid green frame).

Encoders now publish target_layout. The compositor's release and the
encoder's acquire both transition eGeneral -> target_layout in a single
barrier; per VkImageMemoryBarrier2 the layout transition is performed
exactly once between the queues, so no second non-QFOT barrier is needed.
target_layout is eVideoEncodeSrcKHR on the direct vulkan encode path and
eGeneral elsewhere.

Also fix optimal_transfer(): the inner `auto to = ...` shadowed the
parameter, so the maintenance9 check was effectively always false.
2026-05-19 06:59:03 +02:00
Patrick Nicolas 1420c167fe Add back COMP_TARGET_TIMING_POINT_SUBMIT_END 2026-05-05 15:19:33 +02:00
Patrick Nicolas 077a6552ef Replace vk::RemainingArrayLayers with values 2026-05-02 14:11:53 +02:00
Patrick Nicolas f1c02d8f68 Fix debug build 2026-04-30 16:04:15 +02:00
Patrick Nicolas e21b1adf1d Send both frame rate and refresh rate in description 2026-04-27 10:26:58 +02:00
Patrick Nicolas 28cffac9bd remove unused sem_value member 2026-04-25 18:55:12 +02:00
Patrick Nicolas 10387b9b00 Separate framerate/refresh rate 2026-04-19 09:14:03 +02:00
Patrick Nicolas 6d072e30cd Simplify some preferred refresh rate logic 2026-04-19 09:14:03 +02:00
Patrick Nicolas cf602beefb Update monado
move view_config from sys_info to callback
2026-04-17 16:42:53 +02:00
Patrick Nicolas 1f6e237f21 Only write alpha if useful 2026-04-11 16:55:02 +02:00
Patrick Nicolas 6ab58430e2 Mark command pools as transient 2026-04-11 16:55:02 +02:00
Patrick Nicolas d535f38938 Reintroduce renderdoc support 2026-04-11 16:55:02 +02:00
Patrick Nicolas a70caa529e Add compositor timings to debug GUI 2026-04-11 16:55:02 +02:00
Patrick Nicolas ce83e8fb03 Major synchronization rework
unify submit/post_submit encoder entrypoints
encoders must now wait for their command completion
use transfer queues for CPU -> GPU copy
2026-04-11 16:55:02 +02:00
Patrick Nicolas fe414c4450 Remove image layout transitions 2026-04-11 16:55:02 +02:00
Patrick Nicolas 6c6519fab5 Use VK_KHR_maintenance9 (drop queue transfer) 2026-04-04 13:40:47 +02:00
caszuu d1cbb730a2 don't send frames before a clock offset is found 2026-04-03 19:50:05 +02:00
Patrick Nicolas 6b58b63a33 Crop FOV in layer squasher 2026-04-03 14:19:54 +02:00
Patrick Nicolas 0aaf736b48 Return extent in do_layers() 2026-04-03 14:19:54 +02:00
Patrick Nicolas 3149ced724 request eye gaze in compositor 2026-04-03 07:15:40 +02:00
Patrick Nicolas 4f00287c6e Skip frame if encoders are still busy 2026-04-02 14:39:48 +02:00
Patrick Nicolas 6cabcfb047 fix fence status on skipped frames 2026-03-31 16:16:02 +02:00
Patrick Nicolas fc56ced616 Fill in refresh rates in compositor 2026-03-31 15:18:59 +02:00
Patrick Nicolas 1edae28630 Send video description on reconnect 2026-03-31 09:06:27 +02:00
Patrick Nicolas 5c60d70d24 use reinterpret_cast 2026-03-31 09:06:27 +02:00
Patrick Nicolas 796ec69728 Ignore network error in refresh rate change 2026-03-31 09:06:27 +02:00
Patrick Nicolas 23689abaa7 Skip barrier in no-copy vulkan video encode 2026-03-31 09:06:27 +02:00
Patrick Nicolas 22a819b8c8 Implement main compositor
Replace the patches to Monado's main compositor with a local
implementation, reusing code when relevant.

The layer squasher is very close to comp_render_cs, while distortion is
completely replaced by foveation.
2026-03-31 09:06:27 +02:00