Commit Graph

3773 Commits

Author SHA1 Message Date
Geoffrey McRae
9d2b8da098 [client] glsl: fix failure to build on clang
Clang with -ffast-math doesnt have `isfinite`, instead implement it
locally.
2026-07-23 09:43:59 +10:00
Quantum
a87dd6f3b6 [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-23 09:43:59 +10:00
Geoffrey McRae
78802319e3 [client] add a MPV glsl style effect loader 2026-07-23 09:43:59 +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
b5bf5b5b5e [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-23 09:43:59 +10:00
Geoffrey McRae
5982a60d6c [idd] remove debounce logic now the lifecycle is properly protected 2026-07-23 09:43:59 +10:00
Geoffrey McRae
2f237a841c [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-23 09:43:59 +10:00
Geoffrey McRae
5adc22ebca [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-23 09:43:59 +10:00
Geoffrey McRae
de68e5ae97 [idd] stop flooding the log with parsed modes 2026-07-23 09:43:59 +10:00
Geoffrey McRae
1ec92a943d [idd] implement config reload 2026-07-23 09:43:59 +10:00
Geoffrey McRae
1da457affe [idd] never add the extraMode to the EDID
Doing so causes windows to treat a new EDID as a new monitor
2026-07-23 09:43:59 +10:00
Geoffrey McRae
4d3636dba5 [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-23 09:43:59 +10:00
Geoffrey McRae
2e616ddf79 [idd] fix failure to initialize variables 2026-07-23 09:43:59 +10:00
Geoffrey McRae
b397b7c66a [client] wayland: fix fullscreen option launch bug 2026-07-23 09:43:59 +10:00
Geoffrey McRae
275253181a 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-23 09:43:59 +10:00
Geoffrey McRae
e6ac8a2b75 [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-23 09:43:59 +10:00
Geoffrey McRae
96b16debad 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-23 09:43:59 +10:00
Geoffrey McRae
116cafc806 [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-23 09:43:59 +10:00
Geoffrey McRae
041ae0e9f4 [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-23 09:43:59 +10:00
Geoffrey McRae
bcd17ed220 [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-23 09:43:59 +10:00
Geoffrey McRae
8dadfab5c5 [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-23 09:43:59 +10:00
Geoffrey McRae
cd0d668076 [client] egl: cache renderer GL state
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-23 09:43:59 +10:00
Geoffrey McRae
b60fa8756f [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-23 09:43:59 +10:00
Geoffrey McRae
615adac090 [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-23 09:43:59 +10:00
Geoffrey McRae
5d6ef7d690 [obs] hdr: use BT.2020 gamut for PQ decoding
Mastering display primaries do not define the pixel encoding gamut.
2026-07-23 09:43:59 +10:00
Geoffrey McRae
845c612d0f [idd/client/obs] hdr: wire up the SdrWhiteLevel from the capture 2026-07-23 09:43:59 +10:00
Geoffrey McRae
0d2dc2694e [client] egl: fix masked color cursor HDR mapping 2026-07-23 09:43:59 +10:00
Geoffrey McRae
9bcf1d4994 [obs] hdr: improve hdr cursor rendering 2026-07-23 09:43:59 +10:00
Geoffrey McRae
93ce131d4f [client] egl: improve HDR cursor rendering, fixes alpha blending 2026-07-23 09:43:59 +10:00
Geoffrey McRae
27faae1116 [obs] fix masked color and monochrome cursors 2026-07-23 09:43:59 +10:00
Geoffrey McRae
7884c46cd6 [client] egl: implement SDR to HDR mapping for cursors 2026-07-23 09:43:59 +10:00
Geoffrey McRae
993c724e67 [client] wayland: set the application icon 2026-07-23 09:43:59 +10:00
Geoffrey McRae
f2b45646d7 [idd] hdr: correct the BT.709 to BT.2020 conversion 2026-07-23 09:43:59 +10:00
Geoffrey McRae
f9a77048ab [obs] fix HDR support to properly convert from PQ 2026-07-23 09:43:59 +10:00
Geoffrey McRae
f8f5576359 [client] fix the HDR colorspace mapping to SDR 2026-07-23 09:43:59 +10:00
Geoffrey McRae
4dd9d11cca [idd] use the actual surface colorspace instead of guessing 2026-07-23 09:43:59 +10:00
Geoffrey McRae
e245256860 [idd] collapse duplicate messages to the latest event only 2026-07-23 09:43:59 +10:00
Geoffrey McRae
e5e378f255 [client] fix reversed event timestamp logic 2026-07-23 09:43:59 +10:00
Geoffrey McRae
67d29242ba [idd] debounce resolution changes 2026-07-23 09:43:59 +10:00
Geoffrey McRae
f702576820 [idd] stop using IddCxMonitorUpdateModes(2)
While it would make much more sense to use these then a full replug to
change modes, Microsoft have not properly implemented the API to clear
the cached monitor mode states internally, making these calls useless.

Revert to just replugging the device on mode change
2026-07-23 09:40:49 +10:00
Geoffrey McRae
b97a0b79f1 [idd] don't rebuild the monitor from inside the old monitor's context
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 16:13:24 +10:00
Geoffrey McRae
fbf564f2e1 [idd] prevent races from corrupting the mode list and edid 2026-07-16 15:26:21 +10:00
Geoffrey McRae
0140a3f6fb [client/idd] hdr: fix incorrect tone mapping knee bug
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 10:48:10 +10:00
Geoffrey McRae
e502af7d9d Revert "[idd/client] correct HDR luminance when PQ conversion is in use"
This reverts commit 05d8bc5311.
2026-07-16 09:58:44 +10:00
Geoffrey McRae
05d8bc5311 [idd/client] correct HDR luminance when PQ conversion is in use 2026-07-16 09:34:02 +10:00
Geoffrey McRae
1b3305e1dc [client] wayland: fix hdr luminance scaling 2026-07-16 06:40:27 +10:00
Geoffrey McRae
ff1631da67 [idd] hdr: dont advertise non hdr formats as hdr
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 05:34:09 +10:00
Geoffrey McRae
2f59de572b [client] wayland: fix broken initialization 2026-07-16 05:34:09 +10:00
Geoffrey McRae
da7d1a2ead [client] wayland: fix color management errors 2026-07-16 05:34:09 +10:00
Geoffrey McRae
82d36a858f [idd] fix the HDR16 to HDR10 post processor
`linear` is a HLSL keyword
2026-07-16 05:34:09 +10:00