Commit Graph
389 Commits
Author SHA1 Message Date
donny 5e2fd18b5c common: align each display's atlas offset for direct scanout
build / module (push) Failing after 18s
build / client (Debug, map[cc:clang cxx:clang++], libdecor) (push) Failing after 22s
build / client (Debug, map[cc:gcc cxx:g++], libdecor) (push) Failing after 21s
build / client (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Failing after 21s
build / client (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Failing after 21s
build / client (Release, map[cc:clang cxx:clang++], libdecor) (push) Failing after 21s
build / client (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Failing after 21s
build / client (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Failing after 21s
build / client (Release, map[cc:gcc cxx:g++], libdecor) (push) Failing after 21s
build / host-linux (push) Failing after 21s
build / host-windows-cross (push) Failing after 19s
build / obs (clang) (push) Failing after 20s
build / docs (push) Failing after 3s
build / obs (gcc) (push) Failing after 19s
build / host-windows-native (push) Canceled after 0s
build / idd (push) Canceled after 0s
The alignment argument only rounded up the atlas width, so a display's X
offset was an arbitrary running sum of the widths before it. A consumer
pointing display hardware at one display's region needs that region's base
address 256 byte aligned, and with unaligned offsets some displays would
land on legal addresses and some would not — giving the fast path to only
some monitors, which is worse than uniform slowness because the difference
is hard to diagnose.

Each display's X offset is now aligned as well, and the candidate shelf
widths account for the padding so they still describe shelves that can
hold the set. Both capture backends pass an alignment derived from their
pixel size.

Costs nothing for common resolutions: 3840, 2560 and 1920 are all
multiples of 64. Only unusual widths pad at all — a 2160 wide portrait
display grows the atlas by 16 pixels.

Also documents the consumer contract: the alignment guarantee, frame
lifetime under the two deep queue and one second subscriber timeout, and
that damage is in packed frame coordinates.
2026-07-28 09:09:24 +00:00
donny e582faed84 dxgi: track damage per output and translate it into atlas space
build / client (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Failing after 20s
build / client (Debug, map[cc:gcc cxx:g++], libdecor) (push) Failing after 20s
build / client (Debug, map[cc:clang cxx:clang++], libdecor) (push) Failing after 21s
build / module (push) Failing after 16s
build / client (Release, map[cc:clang cxx:clang++], libdecor) (push) Failing after 20s
build / client (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Failing after 20s
build / client (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Failing after 20s
build / obs (gcc) (push) Failing after 20s
build / client (Release, map[cc:gcc cxx:g++], libdecor) (push) Failing after 20s
build / client (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Failing after 20s
build / host-linux (push) Failing after 19s
build / host-windows-cross (push) Failing after 19s
build / obs (clang) (push) Failing after 20s
build / docs (push) Failing after 3s
build / idd (push) Canceled after 0s
build / host-windows-native (push) Canceled after 0s
Damage is now gathered from every output that presented this cycle rather
than reporting the whole frame. An output that did not present contributes
nothing, so a static monitor costs no transfer at all — which matters when
the atlas is tens of megabytes and only one display is moving.

The translation clips each rectangle to the display it came from, so one
output's damage can never reach into another's part of the atlas, and
scaling is applied after placement since the downscale applies to the frame
as a whole. If the combined damage cannot be described the count is left at
zero, meaning full damage: redrawing too much only costs time, whereas
redrawing too little leaves stale pixels on screen.

lgDisplaysRectToAtlas is in common and unit tested, including a sweep of
awkward inputs asserting no translated rectangle ever escapes its display.
The DXGI plumbing around it still needs hardware.
2026-07-28 08:43:57 +00:00
donny e425b15a87 doc: record DXGI multi-monitor support and its limits
build / module (push) Failing after 16s
build / docs (push) Failing after 3s
build / obs (clang) (push) Failing after 19s
build / obs (gcc) (push) Failing after 19s
build / host-linux (push) Failing after 19s
build / host-windows-cross (push) Failing after 19s
build / client (Debug, map[cc:clang cxx:clang++], libdecor) (push) Failing after 19s
build / client (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Failing after 19s
build / client (Debug, map[cc:gcc cxx:g++], libdecor) (push) Failing after 19s
build / client (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Failing after 19s
build / client (Release, map[cc:clang cxx:clang++], libdecor) (push) Failing after 19s
build / client (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Failing after 20s
build / client (Release, map[cc:gcc cxx:g++], libdecor) (push) Failing after 19s
build / client (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Failing after 19s
build / host-windows-native (push) Canceled after 0s
build / idd (push) Canceled after 0s
Marks the DXGI path as implemented but unproven on hardware, documents
the fallback conditions, and notes that packing every display into one
frame means they share a frame rate.
2026-07-28 08:36:08 +00:00
donny 06df69b9e2 dxgi: capture all of the adapter's outputs into one frame
build / client (Debug, map[cc:gcc cxx:g++], libdecor) (push) Failing after 21s
build / client (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Failing after 21s
build / client (Debug, map[cc:clang cxx:clang++], libdecor) (push) Failing after 21s
build / client (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Failing after 19s
build / client (Release, map[cc:clang cxx:clang++], libdecor) (push) Failing after 20s
build / client (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Failing after 20s
build / module (push) Failing after 17s
build / client (Release, map[cc:gcc cxx:g++], libdecor) (push) Failing after 20s
build / client (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Failing after 21s
build / host-windows-cross (push) Failing after 22s
build / host-linux (push) Failing after 24s
build / obs (clang) (push) Failing after 21s
build / docs (push) Failing after 3s
build / obs (gcc) (push) Failing after 19s
build / host-windows-native (push) Canceled after 0s
build / idd (push) Canceled after 0s
Duplicates every attached output on the chosen adapter and composes them
into an atlas texture with CopySubresourceRegion, handing that to the post
processors in place of the acquired texture. Nothing downstream is aware
of the difference.

Secondary outputs are polled with a zero timeout rather than waited on,
since outputs present independently and waiting in turn would drag the
frame rate down to that of the slowest monitor. A display with nothing new
keeps the pixels it already has in the atlas. Acquired frames are released
at the start of the next capture, not after the copy, because the copies
are only recorded into the device context and releasing a frame
invalidates its surface.

Falls back to capturing a single output, which is what this backend has
always done, whenever the situation cannot be handled safely: mixed
capture formats, since a subresource copy cannot convert between them, a
rotated output, since the packer expects final orientation, or a specific
output having been requested. A wrong atlas is worse than one display.

Damage is reported as full frame while composing. The dirty rectangles
come from the primary alone and in its own coordinates, so they say
nothing about the other displays, and a wrong damage rectangle leaves
stale pixels on screen.

Cross compiles clean. Untested on hardware: the acquire, release and
timing behaviour needs a real multi-monitor Windows machine.
2026-07-28 08:35:19 +00:00
donny 456462f8fb dxgi: document what multi-monitor capture requires on Windows
build / client (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Failing after 20s
build / client (Debug, map[cc:clang cxx:clang++], libdecor) (push) Failing after 20s
build / client (Debug, map[cc:gcc cxx:g++], libdecor) (push) Failing after 22s
build / host-windows-cross (push) Failing after 19s
build / obs (clang) (push) Failing after 19s
build / docs (push) Failing after 3s
build / client (Release, map[cc:clang cxx:clang++], libdecor) (push) Failing after 20s
build / client (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Failing after 20s
build / client (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Failing after 20s
build / module (push) Failing after 16s
build / client (Release, map[cc:gcc cxx:g++], libdecor) (push) Failing after 20s
build / client (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Failing after 21s
build / host-linux (push) Failing after 19s
build / obs (gcc) (push) Failing after 20s
build / host-windows-native (push) Canceled after 0s
build / idd (push) Canceled after 0s
The frame format, packer and client compositor are backend agnostic and
already work; this backend still reports a single display. Records the
shape of the change and the hazards found reading it: mixed formats,
per-output HDR and rotation, frame timing, release discipline and COM
lifetime.
2026-07-28 07:37:37 +00:00
Quantum 4fa697e165 [host] installer: add new page suggesting IDD usage 2026-07-23 10:01:17 +10:00
Quantum a3d7e3806b [host] installer: make multiline strings more readable 2026-07-23 10:01:17 +10:00
Quantum 71ba0bf8f6 [host] installer: offer the option of uninstalling IDD if detected 2026-07-23 10:01:17 +10:00
Geoffrey McRae 068362b816 [host] hdr: encode legacy captures as HDR10
Convert FP16 scRGB captures to BT.2020 PQ before storing them in the
10-bit wire format. Preserve linear-light downsampling, publish the real
SDR white level and display metadata, and advance the format version when
those properties change.
2026-07-23 09:44:00 +10:00
Quantum 0da56a67bb [host] delete redundant / sizeof(char)
`sizeof(char) == 1` always per standard, so this is redundant.
2026-07-23 09:44:00 +10:00
Quantum 215f7cb096 [host] windows: report Windows 11 OS name correctly
This commit brings bc96319b9486798edc6599841dd67476feea5e43's improved logic
in the IDD to the host application.
2026-07-23 09:43:59 +10:00
Quantum 1f3051e81a [host] d12: handle IDXGIAdapter::EnumOutputs errors
Before, the code treated any errors other than DXGI_ERROR_NOT_FOUND as if
they were successes, which is incorrect.
2026-06-17 21:43:19 +10:00
Geoffrey McRae 69f44a003d [all] refresh copyright 2026-05-31 15:13:57 +10:00
Geoffrey McRae e9b7bdfea1 Revert "[all] refresh copyright"
Corrupted IDD sources due to lack of UTF-8 with BOM support in the
script.
2026-05-31 15:10:44 +10:00
Geoffrey McRae 98602fb95e [all] refresh copyright 2026-05-31 15:03:37 +10:00
Geoffrey McRae 9174b1ae0f [host] d12: perform full re-initialization if the heapTest fails 2025-03-05 16:44:29 +11:00
Geoffrey McRae 420eaebb71 [cmake] all: update cmake_minimum_required version to 3.10 2025-03-05 12:27:23 +11:00
Geoffrey McRae 551298ed5b [doc] all: update copyright year 2025-03-05 12:24:38 +11:00
Geoffrey McRae 77f6054f0a d12: implement indirectCopy fallback for compatibillity
When the heapTest fails for DMA copies to shared memory, fallback to
conventional CPU copy via mapped resources. While this is less optimal,
it is still faster then the older DXGI capture backend.
2025-02-19 16:30:27 +11:00
Geoffrey McRae ecd3692e1e [host] dxgi: fix crash during init due to out of order accesses 2024-04-04 22:44:49 +11:00
Geoffrey McRae d902afa3dc [host] d12: fix error output string format 2024-03-11 20:32:34 +11:00
Geoffrey McRae 6e37305765 [host] d12: check if the device was removed during init 2024-03-11 20:27:36 +11:00
Geoffrey McRae dd6c79594b [host] d12: check for failure to obtain d3d12 functions 2024-03-11 20:16:00 +11:00
Geoffrey McRae ce9ed5da5d [host] d12: add additional debug tracing 2024-03-11 20:12:41 +11:00
Geoffrey McRae fdad5daff8 [host/common] d12: add debug tracing 2024-03-11 19:14:54 +11:00
Geoffrey McRae 8d25469d27 [host] d12: limit the dx11 interop level to one version 2024-03-11 18:44:26 +11:00
Geoffrey McRae 8c5d1d47ee [host] nvfbc: mark NvFBC as deprecated 2024-03-11 14:16:12 +11:00
Geoffrey McRae 989fe2bb0b [host] d12: test if creating resources in the heap works at init
AMD GPUs and older NVidia GPUs can initialize fine but fail when we
start to create resources in the shared memory heap, we must test it
early to detect this so we can fallback to a working capture method.
2024-03-11 14:16:12 +11:00
Geoffrey McRae 90b27ae1f7 [host] d12: revert ivshmem heap order change
Moving this prevented the RX580 crash early in init, but later
presents during the capture. As we want to ensure fallback to DXGI
if this happens we need to catch this fault during init. This moves
the order back so that we fail back into a working state.
2024-03-09 12:11:54 +11:00
Geoffrey McRae 4d388d6b9b [host] d12: move ivshmem heap creation to later in init
This has been moved to try to isolate a failure with RX580 startup
2024-03-09 11:56:14 +11:00
Geoffrey McRae d5b32225f4 [host] d12: don't attempt to use realtime priority
Some GPUs such as the RX580 seem to completely crash when attempting
to use `D3D12_COMMAND_QUEUE_PRIORITY_GLOBAL_REALTIME`.
2024-03-09 11:00:44 +11:00
Geoffrey McRae eb31815b46 [host] windows: add OutputDebugString capture for diagnostics 2024-03-07 11:34:46 +11:00
Geoffrey McRae 545e736389 [host] windows: handle graceful shutdown on user switch 2024-03-06 15:02:37 +11:00
Geoffrey McRae 6a72633674 [host] windows: move the service log to the temp directory
Often this log is provided instead of the actual host log, as this
log is largely useless for debugging this moves it to the temp
directory out of view of the user.
2024-03-06 13:11:48 +11:00
Geoffrey McRae 9123984ecc [host] windows: rotate the host log out keeping at most 3 prior versions 2024-03-06 12:59:15 +11:00
Geoffrey McRae 03662f45a7 [host] nvfbc: add warning to encourage migration to D12 2024-03-04 16:34:47 +11:00
Geoffrey McRae a4e761bedc [host] win: make D12 the default copy backend 2024-03-04 16:31:14 +11:00
Geoffrey McRae beb8de922d [host] dxgi: remove the deprecated and broken d3d12 copyBackend
This backend has been deprecated and has been replaced by the new D12 capture
interface.
2024-03-04 16:29:43 +11:00
Geoffrey McRae e247f1fc7b [host] d12: enlarge downsampler damage rects 2024-02-28 20:34:09 +11:00
Geoffrey McRae 4463ca15f6 [host] d12: added downsampler 2024-02-28 20:21:47 +11:00
Geoffrey McRae 97d91a32c8 [host] d12: make effects fully self-contained 2024-02-28 16:05:56 +11:00
Geoffrey McRae 2d41cda640 [host] d12: fix target for wait fence when effects are active 2024-02-28 12:31:56 +11:00
Geoffrey McRae a894348530 [host] d12: correct the pitch when HDR16 is in use 2024-02-28 12:23:41 +11:00
Geoffrey McRae ad7ac6540f [host] d12: implement hdr16 to hdr10 conversion 2024-02-28 11:59:58 +11:00
Geoffrey McRae 0184ddeedd [host] d12: properly handle format changes by effects 2024-02-28 09:40:35 +11:00
Geoffrey McRae b87d8d2f33 [host] d12: disable RGB24 if the capture is HDR 2024-02-28 07:46:47 +11:00
Geoffrey McRae 5c4540ed8b [host] d12: pass frame information in a description structure 2024-02-28 07:30:39 +11:00
Geoffrey McRae c7f1aadb9e [host] d12: pass back rotation metadata to the client 2024-02-28 05:54:40 +11:00
Geoffrey McRae 71b826458d [host] fix host-windows-cross github compilation 2024-02-27 19:14:58 +11:00
Geoffrey McRae 4408359597 [host] d12: fix damage tracking with RGB24 enabled 2024-02-24 09:04:59 +11:00