Native UI gradient draw leaves a diagonal gap in the color target #3131

Closed
opened 2026-11-27 16:22:13 +00:00 by R0Y00 · 2 comments
R0Y00 commented 2026-11-27 16:22:13 +00:00 (Migrated from github.com)
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-27T16:22:13Z.


A native indexed UI gradient pass leaves a sharply bounded region uncovered. The artifact is already visible in the color target immediately after the draw, before text and presentation. A short recording-time vertex read uses a 12-byte stride. The reason for the missing coverage is open.

Build a public synthetic reproduction with an eight-vertex quad and edge ring, indexed triangle list, 12-byte vertex records, XY at +4, mask-controlled PS and RGBA8 target. Use the normal runtime entry and capture the bound vertex/index bytes, stream-output positions, and pre/post-draw pixels inside and outside the observed diagonal. Add a constant-color pixel shader control to distinguish coverage from sampling or blending. A synthetic stand-in is a proposed reproduction; reproducing the original symptom with it is part of the task.

Acceptance: identify the first differing stage, fix its shared implementation and add a regression checking both sides of the boundary. Report Windows build, adapter, driver, revision and debug-layer status. Target main. Use source-built or synthetic inputs only. Comment here to claim.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6650304671 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/3131). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-27T16:22:13Z. --- A native indexed UI gradient pass leaves a sharply bounded region uncovered. The artifact is already visible in the color target immediately after the draw, before text and presentation. A short recording-time vertex read uses a 12-byte stride. The reason for the missing coverage is open. Build a public synthetic reproduction with an eight-vertex quad and edge ring, indexed triangle list, 12-byte vertex records, XY at +4, mask-controlled PS and RGBA8 target. Use the normal runtime entry and capture the bound vertex/index bytes, stream-output positions, and pre/post-draw pixels inside and outside the observed diagonal. Add a constant-color pixel shader control to distinguish coverage from sampling or blending. A synthetic stand-in is a proposed reproduction; reproducing the original symptom with it is part of the task. Acceptance: identify the first differing stage, fix its shared implementation and add a regression checking both sides of the boundary. Report Windows build, adapter, driver, revision and debug-layer status. Target main. Use source-built or synthetic inputs only. Comment here to claim.
lambirou commented 2026-11-27 17:19:07 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-11-27T17:19:07Z.


Claiming. Windows build 10.0.26300.10075, AMD Radeon RX 9060 XT (driver 32.0.32029.2010), MSVC 19.51, Windows SDK/DXC 10.0.26100.0.

Plan: a source-built eight-vertex quad plus edge ring (12-byte vertex records, XY at +4, indexed triangle list, mask-controlled PS, plus a constant-color control), through the normal runtime entry; capture the bound vertex/index bytes, stream-output positions and pre/post-draw pixels inside and outside the diagonal; identify the first differing stage, fix the shared implementation and add a regression checking both sides of the boundary. Target main.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7224272023 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/3131#issuecomment-7224272023). Originally posted by [lambirou](https://github.com/lambirou) on 2026-11-27T17:19:07Z. --- Claiming. Windows build 10.0.26300.10075, AMD Radeon RX 9060 XT (driver 32.0.32029.2010), MSVC 19.51, Windows SDK/DXC 10.0.26100.0. Plan: a source-built eight-vertex quad plus edge ring (12-byte vertex records, XY at +4, indexed triangle list, mask-controlled PS, plus a constant-color control), through the normal runtime entry; capture the bound vertex/index bytes, stream-output positions and pre/post-draw pixels inside and outside the diagonal; identify the first differing stage, fix the shared implementation and add a regression checking both sides of the boundary. Target main.
lambirou commented 2026-11-27 18:02:09 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-11-27T18:02:09Z.


Result: the described synthetic draw does not reproduce the diagonal gap, but it exposed a real defect in the shared indexed-rectangle rule.

  • Reproduction (tests/startup_rect_gap.cpp, startup_rect_gap_check.py): eight 12-byte records (mask at +0, XY at +4), two vertex-buffer views over the same records, an R16 indexed triangle list and a six-vertex rectangle list of the same quad and edge ring, a mask-controlled PS plus a constant-colour control, RGBA8 target, with and without back-face culling. Bound vertex/index bytes, the translated fetch and every pixel match the model. Both runtime backends reported the Microsoft Basic Render Driver, so this is a WARP result.
  • First differing stage: the indexed rectangle stage identified the right-angle corner only by axis alignment. A rectangle turned by 15 degrees matched no corner, the stage returned before emitting either triangle, and its region stayed clear (32/32 pixels). The vertex-stage expansion (v0 + v2 - v1) never had that restriction, so the two implementations disagreed.
  • Fix: also identify the corner opposite the diagonal (the longest edge), with the two sides required to meet at a right angle so a non-rectangle stays undrawn; the axis test keeps precedence. Applied to src/startup_stubs/indexed_rect_geometry.h and src/gfx1013_rect_geometry.cpp.
  • Evidence: startup_rect_geometry 2/2 (WARP + RX 9060 XT): rotated case 32/32 differing pixels before, 0/32 after; axis and swung orders unchanged; non-rectangle refusal kept. Existing rectangle regressions 6/6, docs link check 98 files. Debug layer unavailable on the host.

PR #3142 targets main. The exact #3131 pass is still unreproduced; docs/experiments/startup-rect-gap.md records three next candidates (a vertex view declaring fewer bytes than the indices name, a translated non-indexed indirect rectangle list keeping the three-vertices-per-rectangle count, and flat FPARAM taking the first vertex's value for both triangles instead of each provoking vertex).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7225049340 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/3131#issuecomment-7225049340). Originally posted by [lambirou](https://github.com/lambirou) on 2026-11-27T18:02:09Z. --- Result: the described synthetic draw does not reproduce the diagonal gap, but it exposed a real defect in the shared indexed-rectangle rule. - **Reproduction** (`tests/startup_rect_gap.cpp`, `startup_rect_gap_check.py`): eight 12-byte records (mask at +0, XY at +4), two vertex-buffer views over the same records, an R16 indexed triangle list and a six-vertex rectangle list of the same quad and edge ring, a mask-controlled PS plus a constant-colour control, RGBA8 target, with and without back-face culling. Bound vertex/index bytes, the translated fetch and every pixel match the model. Both runtime backends reported the Microsoft Basic Render Driver, so this is a WARP result. - **First differing stage**: the indexed rectangle stage identified the right-angle corner only by axis alignment. A rectangle turned by 15 degrees matched no corner, the stage returned before emitting either triangle, and its region stayed clear (32/32 pixels). The vertex-stage expansion (`v0 + v2 - v1`) never had that restriction, so the two implementations disagreed. - **Fix**: also identify the corner opposite the diagonal (the longest edge), with the two sides required to meet at a right angle so a non-rectangle stays undrawn; the axis test keeps precedence. Applied to `src/startup_stubs/indexed_rect_geometry.h` and `src/gfx1013_rect_geometry.cpp`. - **Evidence**: `startup_rect_geometry` 2/2 (WARP + RX 9060 XT): rotated case 32/32 differing pixels before, 0/32 after; axis and swung orders unchanged; non-rectangle refusal kept. Existing rectangle regressions 6/6, docs link check 98 files. Debug layer unavailable on the host. PR #3142 targets main. The exact #3131 pass is still unreproduced; `docs/experiments/startup-rect-gap.md` records three next candidates (a vertex view declaring fewer bytes than the indices name, a translated non-indexed indirect rectangle list keeping the three-vertices-per-rectangle count, and flat `FPARAM` taking the first vertex's value for both triangles instead of each provoking vertex).
Sign in to join this conversation.
No labels
No milestone
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.

Reference
R0Y00/Xbox2Windows#3131
No description provided.