Commit Graph

3748 Commits

Author SHA1 Message Date
Quantum
db1182da43 [idd] helper: add setting for exclusive monitor (default: yes) 2026-07-23 09:44:00 +10:00
Geoffrey McRae
786f52e8ea [idd] fix failure to detect GPU acceleration is available 2026-07-23 09:44:00 +10:00
Geoffrey McRae
d3e05a7958 [idd] disable HDR and post-processing when in software mode 2026-07-23 09:44:00 +10:00
Geoffrey McRae
cd09c080b8 [obs] hdr: apply the complete HDR cursor transform
Keep transform-only cursor messages independent from visibility and use
the cursor-specific SDR white level reported by IddCx.

Apply the Windows XYZ matrix, scalar, and transfer-domain LUT before
compositing colour and masked-colour cursors into OBS scRGB. Preserve
premultiplied alpha and leave monochrome logical masks unchanged.
2026-07-23 09:44:00 +10:00
Geoffrey McRae
4c7b5b2531 [client] wayland: harden native HDR colour state
Serialize asynchronous image-description state and publish compositor
capabilities safely across the Wayland and render threads.

Use the predefined Windows-scRGB description, query each output image
description for its configured reference white, and reapply HDR when the
surface moves to an output with different colour settings.
2026-07-23 09:44:00 +10:00
Geoffrey McRae
0e14e9c357 [client] egl: make native HDR encoding-safe
Request true floating-point EGL configs for scRGB and expose the native
encodings supported by the selected surface. Fall back to software HDR
mapping when the surface cannot represent the incoming wire format.

Resample PQ in linear light, keep SDR-only effects out of native PQ
chains, and consume the cursor-specific white level without changing
binary monochrome cursor mask operations.
2026-07-23 09:44:00 +10:00
Geoffrey McRae
cdc8ed96bf [idd] hdr: complete HDR display and cursor metadata
Publish BT.2020 chromaticities in the virtual monitor EDID so
Windows receives a valid HDR colour volume.

Extend cursor messages with their IddCx SDR white level and an
explicit visibility-valid flag. Consumers can then calibrate cursors
without treating colour-transform-only messages as cursor hides.
2026-07-23 09:44:00 +10:00
Geoffrey McRae
a047b7d68a egl: follow active native HDR state
Keep software HDR mapping enabled until the display server activates the
requested image description. Re-evaluate the state while rendering so
asynchronous readiness or failure updates the desktop, cursor, and overlay
together with a full redraw.
2026-07-23 09:44:00 +10:00
Geoffrey McRae
2d4f0dbf00 wayland: make HDR descriptions asynchronous
Publish HDR metadata through a locked request snapshot and wait for
image-description readiness before using it. Commit encoding changes with
matching content, preserve the active description during same-format
metadata replacements, and handle creation failures without protocol
errors.
2026-07-23 09:44:00 +10:00
Geoffrey McRae
c0b0aa0566 [all] fix copyright headers 2026-07-23 09:44:00 +10:00
Geoffrey McRae
74f3b426e1 [idd/client] apply the Windows display color transform
Honor the IddCx 3x4 XYZ matrix and post-transfer LUT in the IDD
conversion pipeline. Carry transform changes to the client so EGL applies
the same calibration to hardware cursors, and invalidate the full frame
whenever calibration changes.
2026-07-23 09:44:00 +10:00
Geoffrey McRae
c234866055 [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-23 09:44:00 +10:00
Geoffrey McRae
5dbaf42b7c [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-23 09:44:00 +10:00
Geoffrey McRae
e7e156dc69 [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-23 09:44:00 +10:00
Geoffrey McRae
09acb0153b [client] main: validate damage metadata 2026-07-23 09:44:00 +10:00
Geoffrey McRae
9b02742934 [idd] rgb24: fix packed-texel damage endpoints 2026-07-23 09:44:00 +10:00
Geoffrey McRae
f8b50e741c [idd] accumulate damage from dropped frames 2026-07-23 09:44:00 +10:00
Geoffrey McRae
3e67052cb4 [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-23 09:44:00 +10:00
Geoffrey McRae
d316bcdd22 [idd] helper: fix dependency cycle issue on windows 10 2026-07-23 09:44:00 +10:00
Geoffrey McRae
7707decc57 [idd] debug: add additional logging 2026-07-23 09:44:00 +10:00
Geoffrey McRae
6f2a81edf8 [idd] ensure the only active monitor is the IDD 2026-07-23 09:44:00 +10:00
Quantum
58e0cf340d [idd] helper: implement deferred mode save and revert 2026-07-23 09:44:00 +10:00
Quantum
df861e6a15 [idd] helper: add buttons for deferred mode save and revert 2026-07-23 09:44:00 +10:00
Quantum
a23614d371 [idd] helper: rearrange UI in preparation for deferred saves 2026-07-23 09:44:00 +10:00
Geoffrey McRae
9e4de870fc [client] egl: fix messy white level default definition 2026-07-23 09:44:00 +10:00
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