Rect-list expansion for VS+PS pipelines #189

Closed
opened 2026-11-26 04:14:26 +00:00 by github-bot · 2 comments
Owner

@⁠Kalmarv on GitHub · 2026-11-23 19:47 UTC · original

I am taking a bounded, independent implementation/test pass on the rect-list gap recorded in HANDOFF.md. On main 956a476bf, console IA topology 17 is mapped to TRIANGLELIST and PSO topology type 19 to TRIANGLE; the current code explicitly renders only the first half of each rectangle.

Scope: ordinary VS+PS pipelines, synthetic coverage and interpolation tests, and expansion that follows established vertex-order/provoking-vertex semantics. I will establish those semantics before choosing the expansion; no screen-space corner heuristic. Mesh/NGG and existing console geometry-shader pipelines are outside this initial scope.

Checked the current open PRs for overlapping rectangle expansion; found only contextual topology mappings in #162/#163/#170. Please flag any work coordinated elsewhere so I can avoid duplication.

No GPU result or fix is claimed yet. Planned local check: Windows / RTX 5070 Ti, synthetic inputs only, no game data. AI-assisted (Claude Code and Codex). Contribution tracking: https://github.com/Kalmarv/Leonida/issues/1

**@⁠Kalmarv** on GitHub · 2026-11-23 19:47 UTC · [original](https://github.com/xcl-dev/xcl/issues/189) I am taking a bounded, independent implementation/test pass on the rect-list gap recorded in HANDOFF.md. On main 956a476bf, console IA topology 17 is mapped to TRIANGLELIST and PSO topology type 19 to TRIANGLE; the current code explicitly renders only the first half of each rectangle. Scope: ordinary VS+PS pipelines, synthetic coverage and interpolation tests, and expansion that follows established vertex-order/provoking-vertex semantics. I will establish those semantics before choosing the expansion; no screen-space corner heuristic. Mesh/NGG and existing console geometry-shader pipelines are outside this initial scope. Checked the current open PRs for overlapping rectangle expansion; found only contextual topology mappings in #162/#163/#170. Please flag any work coordinated elsewhere so I can avoid duplication. No GPU result or fix is claimed yet. Planned local check: Windows / RTX 5070 Ti, synthetic inputs only, no game data. AI-assisted (Claude Code and Codex). Contribution tracking: https://github.com/Kalmarv/Leonida/issues/1
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:14:27 +00:00
Author
Owner

@⁠YeetSkillet on GitHub · 2026-11-23 20:03 UTC · original

There is related downstream work. The fork author reports that depth-view and vertex/index-buffer fixes made the first menu visible on an RTX 5090. It was cut along the diagonal until build 5 expanded non-indexed rectangles. The fork documents the three positions and UVs it saw in a fullscreen pass. Build 4 result · Build 5 expansion

I used that corner order in a standalone native D3D12 test. Two runs on an RTX 3060 Ti and on WARP gave identical 64×64 RGBA8 readbacks. The pixel shader checked interpolated UV against the expected coordinate at every covered pixel.

Synthetic draw Pixels written / 4,096 Pixels with wrong UV
Original three corners as one triangle 2,016 0
Same triangle drawn three times 2,016 0
Rectangle as two triangles, one draw 4,096 0
Same rectangle with only the fourth corner’s UV deliberately wrong 4,096 2,016

The fixture covers one vertex order, float attributes and constant clip-space W. Provoking-vertex rules and flat attributes still need independent evidence.

A separate control held the two-triangle geometry and pipeline fixed. Copying zeroed vertices at bind time, then filling the original CPU array, produced 0 lit pixels. A fresh copy, or writing directly to the GPU-visible upload before submission, produced all 4,096. This gives a way to distinguish missing geometry from a late vertex write when investigating #186.

The available retail report gives a count of three draws per frame. An existing trace excerpt with the draw types, shader hashes, bound buffers and render-target IDs matched to the presented resource would let us identify those three individually. This test used only synthetic data.

**@⁠YeetSkillet** on GitHub · 2026-11-23 20:03 UTC · [original](https://github.com/xcl-dev/xcl/issues/189#issuecomment-7112492059) There is related downstream work. The fork author reports that depth-view and vertex/index-buffer fixes made the first menu visible on an RTX 5090. It was cut along the diagonal until build 5 expanded non-indexed rectangles. The fork documents the three positions and UVs it saw in a fullscreen pass. [Build 4 result](https://github.com/theaustinayers/xcl/releases/tag/v0.1.0-mod.4) · [Build 5 expansion](https://github.com/theaustinayers/xcl/commit/73bd45a0645eb5859812ed7e7c4c17cddb351e89) I used that corner order in a standalone native D3D12 test. Two runs on an RTX 3060 Ti and on WARP gave identical 64×64 RGBA8 readbacks. The pixel shader checked interpolated UV against the expected coordinate at every covered pixel. | Synthetic draw | Pixels written / 4,096 | Pixels with wrong UV | | --- | ---: | ---: | | Original three corners as one triangle | 2,016 | 0 | | Same triangle drawn three times | 2,016 | 0 | | Rectangle as two triangles, one draw | 4,096 | 0 | | Same rectangle with only the fourth corner’s UV deliberately wrong | 4,096 | 2,016 | The fixture covers one vertex order, float attributes and constant clip-space W. Provoking-vertex rules and flat attributes still need independent evidence. A separate control held the two-triangle geometry and pipeline fixed. Copying zeroed vertices at bind time, then filling the original CPU array, produced 0 lit pixels. A fresh copy, or writing directly to the GPU-visible upload before submission, produced all 4,096. This gives a way to distinguish missing geometry from a late vertex write when investigating #186. The available retail report gives a count of three draws per frame. An existing trace excerpt with the draw types, shader hashes, bound buffers and render-target IDs matched to the presented resource would let us identify those three individually. This test used only synthetic data. - Run on Windows x64 with `python xcl-draw-probe.py.txt`. [xcl-draw-probe.py.txt](https://github.com/user-attachments/files/35297103/xcl-draw-probe.py.txt) - Per-adapter pixel counts and UV checks from the same probe. [xcl-draw-readbacks.json](https://github.com/user-attachments/files/35297102/xcl-draw-readbacks.json)
Author
Owner

@⁠ivall on GitHub · 2026-11-23 20:58 UTC · original

Status on main: rect lists of non-indexed vertex-buffer draws are drawn whole now. The CPU expansion from #195 (bind::draw_rects) makes the fourth corner as v0 + v2 - v1 per 4-byte word. Words equal in all three vertices are kept. Not covered: vertices a shader makes from the vertex index alone, and indexed draws. #199 does it with a generated GS instead and is waiting for a rebase on main. The semantics pass you describe would be useful on top of either: the provoking vertex, and whether the console's implied corner really is v0 + v2 - v1 for every vertex order.

**@⁠ivall** on GitHub · 2026-11-23 20:58 UTC · [original](https://github.com/xcl-dev/xcl/issues/189#issuecomment-7113813516) Status on main: rect lists of non-indexed vertex-buffer draws are drawn whole now. The CPU expansion from #195 (`bind::draw_rects`) makes the fourth corner as v0 + v2 - v1 per 4-byte word. Words equal in all three vertices are kept. Not covered: vertices a shader makes from the vertex index alone, and indexed draws. #199 does it with a generated GS instead and is waiting for a rebase on main. The semantics pass you describe would be useful on top of either: the provoking vertex, and whether the console's implied corner really is v0 + v2 - v1 for every vertex order.
This discussion has been locked. Commenting is limited to contributors.
No description provided.