37 Commits
Author SHA1 Message Date
schlegp 04837ba215 Add Vulkan AV1 video encoder (#1087)
Experimental support, is never automatically selected.
2026-11-16 17:24:08 +01:00
Patrick Nicolas 879c50c743 Add back unused-variable warning 2026-10-16 08:03:21 +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
Jonathan Steffan 86e58449c2 feat(vulkan): use distro Vulkan packages instead of setup-vulkan-sdk
With the pinned SDK gone, CI builds against distro headers, so raise the
server requirement to 1.4.304 to match what is actually tested and
supported: Ubuntu 26.04 has 1.4.341, the Ubuntu package build (plucky)
has 1.4.304, as does Debian 13. This subsumes the separate 1.3.283 check
for Vulkan video encode, and makes VK_HEADER_VERSION >= 304 always true
for the server. The client conditionals stay, it is built for Android
against the 1.3.268 headers fetched in common/CMakeLists.txt.
2026-07-26 10:16:46 +02:00
Patrick Nicolas eed9e052fc Correctly report if tracing is enabled 2026-07-14 20:15:53 +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 1fc70945cb Downgrade message for vk queue family indices 2026-06-09 21:07:46 +02:00
Patrick Nicolas 1f71ade4f1 Configurable max number of vulkan encoders 2026-05-19 14:20:57 +02:00
Patrick Nicolas 9313ccbc1d Use multiple vulkan encode queues if possible 2026-05-19 06:59:03 +02:00
Patrick Nicolas 8d6245330a Add support for VK_KHR_unified_image_layouts 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 19c5285479 Respect NVIDIA constraints for vulkan encode input
Images can't have mutable flag for vulkan encode on NVIDIA, perform a
copy instead, as they allow transfer dst.
2026-04-12 16:03:05 +02:00
Patrick Nicolas 9c3615dd0b Log GPU and queues on vulkan instance creation 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 6c6519fab5 Use VK_KHR_maintenance9 (drop queue transfer) 2026-04-04 13:40:47 +02:00
Patrick Nicolas b71a1eddf5 Add support for intra-refresh with vulkan video 2026-04-02 15:17:17 +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
Patrick Nicolas aa3a1808f8 really fix crash when vulkan video is not supported 2025-11-01 20:11:21 +01:00
Patrick Nicolas 07bc8c9bac Fix crash when vulkan video is not supported 2025-11-01 09:33:55 +01:00
galister c6e05754c8 update monado 2025-10-07 09:52:57 +02:00
Patrick Nicolas fcbdda9908 Don't fake user presence, use focused instead 2025-09-27 10:08:51 +02:00
Patrick Nicolas e3356acc16 Update Monado 2025-09-22 23:35:28 +02:00
Patrick Nicolas c15de9bf27 Automatically name image/buffer allocations 2025-08-16 14:15:29 +02:00
Patrick Nicolas 5be3a8aef4 Utility to name vulkan objects 2025-06-12 15:46:37 +02:00
Patrick Nicolas be177ed002 Template utility to cast member functions 2025-03-02 20:34:32 +01:00
Patrick Nicolas e4e61e2b0a Fix build with vulkan headers 304 2025-01-10 21:51:10 +01:00
Patrick Nicolas 6f434ec4cd Register debug callback 2024-10-27 11:31:29 +01:00
Patrick Nicolas 04260752e9 Experimental h264 vulkan video encode 2024-10-27 11:31:29 +01:00
Patrick Nicolas 28284a9694 wivrn namespace: move all server classes 2024-10-03 23:39:32 +02:00
Patrick Nicolas 685061ca59 Relax pipeline barriers if possible 2024-08-16 21:24:50 +02:00
Patrick Nicolas d935eabf14 Quit if no client when connection ends 2024-06-03 20:59:06 +02:00
Guillaume Meunier 9cceaac648 clang-format 2024-03-30 17:00:34 +01:00
Patrick Nicolas 959d82ede3 update monado 2024-03-05 17:00:35 +01:00
Patrick Nicolas 6e90a7e594 fix build with Vulkan SDK 1.3.268 2024-02-18 16:15:55 +01:00
Patrick Nicolas e385e459ee Always do yuv conversion in vulkan 2024-02-18 16:15:55 +01:00