199 Commits
Author SHA1 Message Date
Jonathan Steffan 3c927dd80b Raise the vulkan h265 encoder's minimum coding block to 16x16
The SPS allowed coding blocks down to 8x8. On NVIDIA that costs 4x the
encode time: 13.4 ms per 1920x1472 frame against 4.4 ms for the same
GPU's NVENC path, so the encoder sustained 36.5 fps against a 90 Hz
target. At 16x16 it is 3.2 ms and holds 90 Hz.
2026-09-08 08:01:54 +02:00
Patrick Nicolas e604848409 Remove WIVRN_DUMP_TIMINGS 2026-08-17 21:30:57 +02:00
Patrick Nicolas 4d1de2eab9 Don't collect copy times for iGPU (vulkan encoder) 2026-07-14 20:15:53 +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 468b30dec4 Fix debug build 2026-05-28 18:13:01 +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 54b96430f6 Addjust some IDR handler logs 2026-05-10 11:35:50 +02:00
Patrick Nicolas 7e81f23f0f Add missing includes 2026-05-02 20:39:37 +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 74c360ebe1 Fix nvenc max encode size check 2026-04-27 14:59:41 +02:00
Patrick Nicolas 775022d065 Remove useless semaphore wait (same queue) 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 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 b3479eb418 Remove vkResetCommandBuffer 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 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 b71a1eddf5 Add support for intra-refresh with vulkan video 2026-04-02 15:17:17 +02:00
Patrick Nicolas cd9b3fc031 fix race condition in vulkan encoder 2026-04-02 14:39:48 +02:00
Patrick Nicolas 706f76b18d Prevent concurrent vulkan encode operations 2026-04-02 14:39:48 +02:00
Patrick Nicolas 14089200ab Unify vulkan encode checks 2026-04-02 14:39:48 +02:00
Patrick Nicolas 78b449e84b Fix doubled bitrate 2026-03-31 16:30:07 +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
Patrick Nicolas b3b2c49da4 Fix vulkan object naming 2026-03-11 18:39:55 +01:00
Patrick Nicolas 13a94f3dec Don't shard over TCP 2026-03-11 18:39:55 +01:00
BERADQ 0f21191e9b Check NVENC intra-refresh capability before enabling the feature 2026-02-26 15:00:05 +01:00
BERADQ 6254386370 Set intra refresh period and count to fixed values. 2026-02-26 15:00:05 +01:00
BERADQ e32d3bbf36 Enable intra refresh for H264/HEVC/AV1 with period=fps and count=fps/2 2026-02-26 15:00:05 +01:00
Patrick Nicolas f8a6db5834 vk/video: fix crash on iGPU 2026-02-20 15:56:34 +01:00
Patrick Nicolas 42c64a6569 vk/video: don't copy the whole buffer 2026-02-19 13:43:08 +01:00
Patrick Nicolas b4349767ce vk/video: properly lock queues 2026-02-19 13:43:04 +01:00
Patrick Nicolas b8e9c79180 vk/video: don't query offset, it is always 0 2026-02-19 13:43:04 +01:00
Patrick Nicolas df6667fd0d vk/video: unify encoded image copy code 2026-02-19 13:42:51 +01:00
Patrick Nicolas 399477edf5 Skip some memory copies in vulkan encode 2026-02-11 14:34:06 +01:00
Jonathan Steffan 5ac1e06291 fix(encoder_settings): fix FTBFS when only WIVRN_USE_VULKAN 2026-02-07 20:57:00 +01:00
Patrick Nicolas 1398b9ebfd Fix raw encoding 2026-02-06 23:11:51 +01:00
Patrick Nicolas 2919f7d820 Fix vulkan error on queue transfer
Queue transfer acquire was performed by each encoder, it needs to be
done only once, for the first one.
2026-01-30 16:29:53 +01:00
Patrick Nicolas f6d151c040 Fix 0 refresh rate used with Auto refresh rate 2026-01-30 15:18:06 +01:00
Patrick Nicolas 0efa540ce0 Use R16_UNORM, fixes 10bit encoding on NVIDIA 2026-01-30 15:00:21 +01:00
Patrick Nicolas c846cb1ed2 Don't force 10 bit for H.265 and AV1 2026-01-25 12:26:19 +01:00
Patrick Nicolas 20a81ed004 Add check for VAAPI 10 bit encoding 2026-01-25 12:21:50 +01:00
Patrick Nicolas 43bbb8b0f8 Add check for 10 bit GPU image support 2026-01-06 18:48:47 +01:00
Patrick Nicolas ea7ab55198 Fix software encoding configuration 2025-12-29 18:03:09 +01:00
Sapphire 3df615cb8a Fix nvenc build without vaapi 2025-12-26 19:43:58 -06:00
Patrick Nicolas f4c4021e20 Fix build with old vulkan_hpp 2025-12-20 18:50:12 +01:00
Patrick Nicolas d43d864dee Prevent assertion failure in nvenc probe 2025-12-15 14:28:51 +01:00