Commit Graph

3737 Commits

Author SHA1 Message Date
Geoffrey McRae
ad5d7753e8 [client] wayland: forward HDR mastering metadata
Propagate valid ST 2086 mastering primaries and luminance data, MaxCLL,
and MaxFALL to the Wayland compositor using the protocol's expected
units.
2026-07-19 02:16:19 +10:00
Geoffrey McRae
1f6dbb0dae [idd] hdr: propagate per-frame HDR metadata
Handle DEFAULT, NEW, and UNCHANGED IDDCX HDR10 metadata states and
publish valid mastering metadata through KVMFR. Preserve the metadata
across post-processing without reallocating resources for
metadata-only changes.
2026-07-19 02:13:57 +10:00
Geoffrey McRae
624fa9f8bc [client] egl: correct surface damage reporting
Apply the same sampling margin to swap damage as buffer-age repair and
clip reported rectangles to the EGL surface. This ensures compositors
update every pixel affected by scaling or filtering.
2026-07-19 01:08:26 +10:00
Geoffrey McRae
45114c75c8 [client] main: validate damage metadata 2026-07-19 01:08:26 +10:00
Geoffrey McRae
d8dee8806b [idd] rgb24: fix packed-texel damage endpoints 2026-07-19 01:02:08 +10:00
Geoffrey McRae
86824a0010 [idd] accumulate damage from dropped frames 2026-07-19 01:00:22 +10:00
Geoffrey McRae
84e0a1b956 [idd] cancel stale swap chain assignments
Invalidate in-progress swap chain setup when IddCx unassigns the
monitor, and serialize replacement assignments so workers are
never started on abandoned handles.

Also initialize all worker dependencies before starting the processing
thread and treat teardown during SetDevice as normal cancellation.
2026-07-19 00:28:56 +10:00
Geoffrey McRae
e0d3794c1d [idd] helper: fix dependency cycle issue on windows 10 2026-07-19 00:14:40 +10:00
Geoffrey McRae
a700db51a0 [idd] debug: add additional logging 2026-07-19 00:13:58 +10:00
Geoffrey McRae
ab96c7ea81 [idd] ensure the only active monitor is the IDD
Some checks failed
build / client (Debug, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / module (push) Has been cancelled
build / host-linux (push) Has been cancelled
build / host-windows-cross (push) Has been cancelled
build / host-windows-native (push) Has been cancelled
build / idd (push) Has been cancelled
build / obs (clang) (push) Has been cancelled
build / obs (gcc) (push) Has been cancelled
build / docs (push) Has been cancelled
2026-07-18 22:21:18 +10:00
Quantum
83209fd3a9 [idd] helper: implement deferred mode save and revert 2026-07-18 17:45:18 +10:00
Quantum
064fef1f62 [idd] helper: add buttons for deferred mode save and revert 2026-07-18 17:45:18 +10:00
Quantum
0e05ff9742 [idd] helper: rearrange UI in preparation for deferred saves 2026-07-18 17:45:18 +10:00
Geoffrey McRae
e3e0cfd43a [client] egl: fix messy white level default definition 2026-07-18 16:39:55 +10:00
Geoffrey McRae
85d0dbf83c [client] glsl: fix failure to build on clang
Clang with -ffast-math doesnt have `isfinite`, instead implement it
locally.
2026-07-18 16:24:47 +10:00
Quantum
47aebcda0c [client] resources: clean up icon handling
This commit turns the icon handling into using a macro so we don't need to do
weird conversions from unsigned long (needed by X11) to uint32_t (needed by
Wayland).

Also simplified the error handling path on Wayland.
2026-07-18 15:44:22 +10:00
Geoffrey McRae
6a9957650c [client] add a MPV glsl style effect loader
Some checks failed
build / client (Debug, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / module (push) Has been cancelled
build / host-linux (push) Has been cancelled
build / host-windows-cross (push) Has been cancelled
build / host-windows-native (push) Has been cancelled
build / idd (push) Has been cancelled
build / obs (clang) (push) Has been cancelled
build / obs (gcc) (push) Has been cancelled
build / docs (push) Has been cancelled
2026-07-18 08:42:38 +10:00
Quantum
d206e788af [host] windows: report Windows 11 OS name correctly
Some checks failed
build / client (Debug, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / module (push) Has been cancelled
build / host-linux (push) Has been cancelled
build / host-windows-cross (push) Has been cancelled
build / host-windows-native (push) Has been cancelled
build / idd (push) Has been cancelled
build / obs (clang) (push) Has been cancelled
build / obs (gcc) (push) Has been cancelled
build / docs (push) Has been cancelled
This commit brings bc96319b9486798edc6599841dd67476feea5e43's improved logic
in the IDD to the host application.
2026-07-18 04:51:41 +10:00
Quantum
dcb84451f0 [idd] helper: make WS_CHILD | WS_VISIBLE the default in widgets
This avoids literally every widget we load having to declare
`WS_CHILD | WS_VISIBLE` and then just break if you forget.
2026-07-18 04:51:22 +10:00
Geoffrey McRae
b48f8d6fec [idd] remove debounce logic now the lifecycle is properly protected 2026-07-18 04:41:38 +10:00
Geoffrey McRae
87db473122 [idd] apply resolution after the final replug
Preserve the requested display mode across intermediate swap chains when
rapid resolution changes cause replugs to be coalesced. Apply and clear
the mode only once the final replacement swap chain is ready.
2026-07-18 04:36:42 +10:00
Geoffrey McRae
791da3387a [idd] serialize monitor replugs with swap chain teardown
Keep the replug lifecycle gated until the old swap chain has drained and
released its pending frame, and the replacement swap chain is fully
initialized. Coalesce additional requests into a follow-up replug to
prevent overlapping topology changes and IddCx release-frame timeout
bugchecks.
2026-07-18 04:30:21 +10:00
Geoffrey McRae
9676b30299 [idd] stop flooding the log with parsed modes 2026-07-18 04:22:14 +10:00
Geoffrey McRae
4631a14c44 [idd] implement config reload 2026-07-18 04:12:13 +10:00
Geoffrey McRae
6e70f36134 [idd] never add the extraMode to the EDID
Doing so causes windows to treat a new EDID as a new monitor
2026-07-18 04:01:19 +10:00
Geoffrey McRae
234f8623dc [idd] avoid release frame timeouts during replug
Drop frames when the LGMP queue is full instead of blocking
while holding an IddCx surface. Always finish every
acquired frame, including duplicate frame numbers, so
replug teardown cannot trigger the release-frame watchdog.
2026-07-18 03:53:24 +10:00
Geoffrey McRae
3095a86556 [idd] fix failure to initialize variables 2026-07-18 03:42:16 +10:00
Geoffrey McRae
47ade6395d [client] wayland: fix fullscreen option launch bug 2026-07-18 03:31:22 +10:00
Geoffrey McRae
acb5c06794 egl: correct ImGui overlay luminance in HDR
Render ImGui to an intermediate SDR framebuffer and map it into the
native PQ or scRGB output using the Wayland surface reference white.
Preserve premultiplied alpha during conversion and limit composition to
damaged overlay regions.
2026-07-18 03:02:19 +10:00
Geoffrey McRae
37d7f0e48f [idd] keep the generated EDID immutable
Generate the EDID once during adapter initialization and update only the
live mode list when resolutions change.

Changing the EDID during a monitor replug causes Windows to identify it
as a different monitor, losing the existing display configuration.
Reusing the original EDID preserves the monitor identity while still
allowing dynamic modes to be advertised through IddCx.
2026-07-18 02:14:12 +10:00
Geoffrey McRae
b69dd4d897 client: move LGMP session probing off the event thread
LGMP session validation may wait 500 ms for the shared-memory heartbeat
to advance. Run it on a worker so Wayland input remains responsive while
preserving stale-data detection.
2026-07-18 01:30:15 +10:00
Geoffrey McRae
1187800259 [obs] fix DMABUF import attributes
Match the EGL client’s DRM formats, use implicit linear modifiers, and
reset cached imports safely across format changes and restarts. Fall
back to CPU upload if either DMA buffer cannot be imported.
2026-07-18 00:19:57 +10:00
Geoffrey McRae
d0bc4f3e07 [idd] publish frames after copy submission
Submit the D3D12 copy before exposing the frame through LGMP, preventing
clients from waiting on work that has not yet been queued. Track the
last published buffer separately for safe subscriber resends and handle
submission failures.
2026-07-17 23:49:57 +10:00
Geoffrey McRae
21b978e1df [client] egl: avoid per-frame DMABUF flushes
Only fence and flush when initially attaching an EGLImage. Subsequent
imports rely on framebuffer write completion, avoiding periodic driver
stalls.
2026-07-17 23:39:13 +10:00
Geoffrey McRae
c4285dcb6e [client] egl: cache post-process configuration
Build the active filter chain only when its configuration changes,
including filter settings or order, input format, dimensions, output
size, and DMA mode.

Unchanged frames now execute only the cached active filters, avoiding
repeated setup, preparation, and output-resolution queries.
Reconfiguration forces a full-frame pass to prevent stale intermediate
framebuffer contents.

Also refresh CAS and FSR uniforms when loading presets and move
downscale pass selection out of the per-frame path.
2026-07-17 23:01:54 +10:00
Geoffrey McRae
e5c4fe68dc [client] egl: cache renderer GL state
Some checks failed
build / client (Debug, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / module (push) Has been cancelled
build / host-linux (push) Has been cancelled
build / host-windows-cross (push) Has been cancelled
build / host-windows-native (push) Has been cancelled
build / idd (push) Has been cancelled
build / obs (clang) (push) Has been cancelled
build / obs (gcc) (push) Has been cancelled
build / docs (push) Has been cancelled
Track context-local GL bindings to avoid redundant program, framebuffer,
buffer, texture, sampler, viewport, blend, and scissor state changes.

Invalidate the cache across context switches, ImGui rendering, and
shared object changes. Preserve CPU-backed texture upload correctness by
explicitly clearing pixel unpack buffer bindings where required.

This reduces hot-path driver overhead without adding waits or GPU
synchronization.
2026-07-17 22:38:46 +10:00
Geoffrey McRae
b2c40a80af [client] egl: remove blocking waits from frame submission
Track PBO fences per upload slot and wait only when a slot is reused,
allowing rendering to proceed without a CPU stall. Use GPU-side waits
for cross-context DMABUF synchronization.

Also propagate KVMFR write-completion failures so incomplete
shared-memory frames are never submitted, while retaining incremental
damage-copy waits to avoid added latency.
2026-07-17 22:02:05 +10:00
Geoffrey McRae
e3616ed4b9 [client] egl: add cached uniforms and multipass effects
Replace the per-frame uniform list with stable, name-cached handles that
retain their values across shader recompilation. Track dirty uniforms so
only changed values are uploaded, reducing redundant GL calls and buffer
management.

Add a reusable effect-pass pipeline with per-pass shaders, samplers,
formats, resolutions, and intermediate render targets. This makes
external effects easier to integrate and supports arbitrary multipass
chains.

Migrate the desktop, cursor, damage, 24-bit, downscale, CAS, and FSR
rendering paths to the new APIs. Also ensure framebuffer objects are
released correctly.
2026-07-17 21:05:47 +10:00
Geoffrey McRae
af47e7c1e9 [obs] hdr: use BT.2020 gamut for PQ decoding
Mastering display primaries do not define the pixel encoding gamut.
2026-07-17 18:35:05 +10:00
Geoffrey McRae
2006fb640f [idd/client/obs] hdr: wire up the SdrWhiteLevel from the capture 2026-07-17 17:50:23 +10:00
Geoffrey McRae
3b69e6bdf4 [client] egl: fix masked color cursor HDR mapping 2026-07-17 17:15:13 +10:00
Geoffrey McRae
405ed65858 [obs] hdr: improve hdr cursor rendering 2026-07-17 17:08:35 +10:00
Geoffrey McRae
d41c9fdc5d [client] egl: improve HDR cursor rendering, fixes alpha blending 2026-07-17 16:48:57 +10:00
Geoffrey McRae
04441bfd85 [obs] fix masked color and monochrome cursors 2026-07-17 16:22:39 +10:00
Geoffrey McRae
9803f5b12a [client] egl: implement SDR to HDR mapping for cursors 2026-07-17 04:44:38 +10:00
Geoffrey McRae
f77986b863 [client] wayland: set the application icon
Some checks failed
build / client (Debug, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / module (push) Has been cancelled
build / host-linux (push) Has been cancelled
build / host-windows-cross (push) Has been cancelled
build / host-windows-native (push) Has been cancelled
build / idd (push) Has been cancelled
build / obs (clang) (push) Has been cancelled
build / obs (gcc) (push) Has been cancelled
build / docs (push) Has been cancelled
2026-07-17 03:12:06 +10:00
Geoffrey McRae
aa25b0cfe3 [idd] hdr: correct the BT.709 to BT.2020 conversion 2026-07-17 03:10:55 +10:00
Geoffrey McRae
e332dc77f2 [obs] fix HDR support to properly convert from PQ 2026-07-16 23:13:36 +10:00
Geoffrey McRae
adb4fcb57a [client] fix the HDR colorspace mapping to SDR
Some checks failed
build / client (Debug, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / module (push) Has been cancelled
build / host-linux (push) Has been cancelled
build / host-windows-cross (push) Has been cancelled
build / host-windows-native (push) Has been cancelled
build / idd (push) Has been cancelled
build / obs (clang) (push) Has been cancelled
build / obs (gcc) (push) Has been cancelled
build / docs (push) Has been cancelled
2026-07-16 20:25:20 +10:00
Geoffrey McRae
ef8a4e2923 [idd] use the actual surface colorspace instead of guessing 2026-07-16 20:24:23 +10:00