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.
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.
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.
This saves a lot of GPU power for partial updates. Running testufo with
lanczos downscaling and FSR upscaling consumed over 90 W, but with this
commit, consumed only 75 W.
This mesh will later be used to render only damaged portions of the desktop.
We also moved the coordinate transformation for damage overlay into a matrix
and computed by the shader.
The way things were handled in EGLTexture is not only very hard to
follow, but broken. This change set breaks up EGLTexture into a modular
design making it easier to implement the various versions.
Note that DMABUF is currently broken and needs to be re-implemented.
The $escape+S keybinding now cycles through the available scale algorithms.
This allows the user to switch between algorithms if the automatic detection
turns out to be problematic.
The algorithms are renumbered so that 0 can be LG_SCALE_AUTO.
Instead of duplicating the #defines from the shader into the C code,
this commit adds a custom CMake rule that exports all the #defines
from a shader into a C header.