From 9e811d2f2f1037ba4ec08ab0e05b350e6cf69e66 Mon Sep 17 00:00:00 2001 From: srdusr <99972264+srdusr@users.noreply.github.com> Date: Fri, 8 Aug 2025 23:28:00 +0200 Subject: Render real window content on the GPU render path Past clear-color + cursor: a GPU-driven head now renders every visible window's real content too, via surface_content_elements (the same generic-over-renderer helper the Pixman path uses, unmodified against gpu.renderer instead of udev.renderer). Content pushed after the cursor (so the cursor stays on top), in the same front-to-back `ids` order the Pixman path's own custom_elements already relies on for correct occlusion between windows - plain painter's-algorithm draw order, no separate clip needed since content is window-shaped. Deliberately the *unrounded* path: no corner masking (that's built against PixmanRenderer specifically on this backend) and no decorations (border, titlebar) - a GPU-driven head now shows real window content, square corners, no chrome. Decorations are the remaining real gap before this path has parity with the software one. Per-window geometry/position math (geom from window_anims or w.geometry, band for a decorated window's titlebar reservation, content_offset clamped non-negative) mirrors the Pixman path's own content push exactly, including an earlier double- subtraction and negative-margin fixes - so a CSD client with a real shadow margin positions the same way on either render path. Untested on real GPU-enabled hardware as of this writing: builds, passes clippy, full test suite green, and matches the existing Pixman path's geometry logic by inspection, but SRDWM_GPU/general.gpu were both unset on the machine this was built on - noted honestly in gpu.rs's own module doc comment, DEFAULTS.md, and IMPLEMENTATION_STATUS.md. --- docs/DEFAULTS.md | 13 +++++++------ docs/IMPLEMENTATION_STATUS.md | 9 ++++++--- 2 files changed, 13 insertions(+), 9 deletions(-) (limited to 'docs') diff --git a/docs/DEFAULTS.md b/docs/DEFAULTS.md index ac18f7c..7e712c5 100644 --- a/docs/DEFAULTS.md +++ b/docs/DEFAULTS.md @@ -45,12 +45,13 @@ Read once at startup, not live-settable via `srd set` - the render backend is wired into the DRM pipeline when the compositor connects to its GPU, not something that can be swapped while running. -Still missing real window content and decorations as of this writing: -a GPU-driven head renders its own clear color and the real cursor, not -yet any windows - see `crates/wayland/src/udev/gpu.rs`'s own module -doc comment for the current state. `SRDWM_GPU=1` (an environment -variable) remains a separate, lower-level override for testing without -touching config - either it or `general.gpu` being set is enough to +Still missing decorations (border, titlebar) as of this writing: a +GPU-driven head renders its own clear color, the real cursor, and real +window content (plain, square-cornered, no border/titlebar) - see +`crates/wayland/src/udev/gpu.rs`'s own module doc comment for the +current state. `SRDWM_GPU=1` (an environment variable) remains a +separate, lower-level override for testing without touching config -- +either it or `general.gpu` being set is enough to attempt GPU rendering. ### Monitor Settings (`monitor.*`) diff --git a/docs/IMPLEMENTATION_STATUS.md b/docs/IMPLEMENTATION_STATUS.md index 3365831..6fe207b 100644 --- a/docs/IMPLEMENTATION_STATUS.md +++ b/docs/IMPLEMENTATION_STATUS.md @@ -159,9 +159,12 @@ once, so splitting it across three files would have hidden it. otherwise), falling back to the software path unchanged on any failure at any step. Every connected head it successfully initializes gets driven through it, VT-switch pause/activate is wired, and the - real cursor renders on top of its own clear color - window content - and decorations are the remaining gap: a GPU-driven head shows no - windows yet, only its clear color and cursor. + real cursor and real window content (plain, square-cornered, no + border/titlebar yet) both render on top of its own clear color -- + decorations are the remaining gap. Untested on real GPU-enabled + hardware as of this writing - builds and passes the full test suite, + but `SRDWM_GPU`/`general.gpu` were both unset on the machine this was + built on. `WaylandPlatform::connect` (winit) picks this backend automatically when no `WAYLAND_DISPLAY`/`DISPLAY` is set, falling back to nested winit if udev init fails for any reason. -- cgit v1.2.3