[PR #3726] [MERGED] Render: present offscreen views through a window compositor #5174

Closed
opened 2026-11-03 05:10:44 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/3726
Author: @martipops
Created: 10/29/2026
Status: ✅ Merged
Merged: 10/29/2026
Merged by: @levzzz5154

Base: main ← Head: split/01-compositor


📝 Commits (1)

  • f9a97f2 Add a compositor for offscreen frames on one GPU device

📊 Changes

4 files changed (+385 additions, -0 deletions)

View changed files

➕ crates/horizon-client-render/examples/compositor.rs (+151 -0)
📝 crates/horizon-client-render/src/gfx.rs (+1 -0)
➕ crates/horizon-client-render/src/gfx/compositor.rs (+214 -0)
➕ docs/design/compositor.md (+19 -0)

📄 Description

🤖 Opened by martipops's AI agent (Codex), not by martipops themselves.

Blocked by: none (independent)

What and why

Part 1 of the splitscreen series (#3541), independent of the shared-audio part. Present offscreen BGRA frames at assigned positions on a window surface using their existing GPU device. Frames are clipped at the window edge and uncovered pixels are cleared to black. Zero-sized and oversized windows suspend presentation. The renderer exposes its frame and surface handoff for later player-session integration; the normal game rendering path is unchanged.

The standalone compositor example shows red and blue views without game resources or player data. cargo run --profile fast -p horizon-client-render --example compositor -- --smoke presents 20 frames, exercises resizing and invalid dimensions, switches vsync, and exits. It passed on the Mac GPU; martipops also reports Windows/Linux validation. Surfaces must support COPY_DST and Bgra8Unorm; unsupported capabilities return an error.

No launcher/account changes or player-facing setting. Suggested label: skip-release.

Vanilla reference

Horizon-only rendering infrastructure. Gameplay and protocol behavior are unchanged.

Self-check

The quick gate passes. On macOS, TMPDIR=/private/tmp avoids the existing parity-runner fixture's unresolved /var versus /private/var path comparison. Parity harnesses were not run (--quick).

pr_ready (tools/pr_ready.py --quick --base upstream/main on Mac, against upstream/main at 9c15e18c6, 2 min 12 s)

Check Result
Scope ✅ 4 files, +385 −0
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 416 passed (28 s)
rustfmt ✅ (4 s)
clippy ✅ (25 s)
tests: horizon-client-render ✅ 521 passed (42 s)
doc tests ✅ 0 passed (33 s)
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ not run (--quick): CI's parity job picks the affected harnesses
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

The standalone GPU smoke test, clipping unit test, and client library/binary cargo checks also pass. One bounded subagent review found no compositor issue.

🤖 Generated with Codex.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/3726 **Author:** [@martipops](https://github.com/martipops) **Created:** 10/29/2026 **Status:** ✅ Merged **Merged:** 10/29/2026 **Merged by:** [@levzzz5154](https://github.com/levzzz5154) **Base:** `main` ← **Head:** `split/01-compositor` --- ### 📝 Commits (1) - [`f9a97f2`](https://github.com/horizon-rust/horizon/commit/f9a97f264fd5339b7684803a6f4ec995c9b38eff) Add a compositor for offscreen frames on one GPU device ### 📊 Changes **4 files changed** (+385 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `crates/horizon-client-render/examples/compositor.rs` (+151 -0) 📝 `crates/horizon-client-render/src/gfx.rs` (+1 -0) ➕ `crates/horizon-client-render/src/gfx/compositor.rs` (+214 -0) ➕ `docs/design/compositor.md` (+19 -0) </details> ### 📄 Description > 🤖 Opened by martipops's AI agent (Codex), not by martipops themselves. **Blocked by:** none (independent) ## What and why Part 1 of the splitscreen series (#3541), independent of the shared-audio part. Present offscreen BGRA frames at assigned positions on a window surface using their existing GPU device. Frames are clipped at the window edge and uncovered pixels are cleared to black. Zero-sized and oversized windows suspend presentation. The renderer exposes its frame and surface handoff for later player-session integration; the normal game rendering path is unchanged. The standalone `compositor` example shows red and blue views without game resources or player data. `cargo run --profile fast -p horizon-client-render --example compositor -- --smoke` presents 20 frames, exercises resizing and invalid dimensions, switches vsync, and exits. It passed on the Mac GPU; martipops also reports Windows/Linux validation. Surfaces must support COPY_DST and Bgra8Unorm; unsupported capabilities return an error. No launcher/account changes or player-facing setting. Suggested label: `skip-release`. ## Vanilla reference Horizon-only rendering infrastructure. Gameplay and protocol behavior are unchanged. ## Self-check The quick gate passes. On macOS, `TMPDIR=/private/tmp` avoids the existing parity-runner fixture's unresolved `/var` versus `/private/var` path comparison. Parity harnesses were not run (`--quick`). **pr_ready** (`tools/pr_ready.py --quick --base upstream/main` on Mac, against upstream/main at 9c15e18c6, 2 min 12 s) | Check | Result | | --- | --- | | Scope | ✅ 4 files, +385 −0 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 416 passed (28 s) | | rustfmt | ✅ (4 s) | | clippy | ✅ (25 s) | | tests: horizon-client-render | ✅ 521 passed (42 s) | | doc tests | ✅ 0 passed (33 s) | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ not run (--quick): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | The standalone GPU smoke test, clipping unit test, and client library/binary cargo checks also pass. One bounded subagent review found no compositor issue. 🤖 Generated with [Codex](https://openai.com/codex/). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:10:44 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#5174
No description provided.