OLD-9940: draw Xbox rectangle and indexed quad lists as triangles #682
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
missing claim
needs rebase
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/ubiquitarianism--leonida!682
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/682/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@QemmHD on GitHub · 2026-11-24 11:50 UTC · original
ubiquitarianism:qemmhd/old-9940-rectangle-quad-lists→main· +2203 −43 · 18 files · 13 commits · merged 2026-11-25 02:33 UTCClaimed in #14 as OLD-9940. Follow-up to #207. This branch carries tedin7's six original patches onto current
mainand keeps their authorship.What and why
The Xbox rectangle-list pipeline uses topology type 19. The Vulkan backend currently rejects it. This adds the rectangle geometry stage and draws quad lists as triangles.
The first indexed quad implementation used a triangle fan per quad. That picks the wrong vertex for flat attributes and changes draw order when instances overlap. This branch expands indices on the GPU and issues a single instanced triangle-list draw. Flat attributes come from the quad's first vertex and instance order is preserved.
Shader-addressable standalone buffers now round their Vulkan backing size to a four-byte word for 16-bit index loads. D3D resource sizes and index-view bounds stay the same.
Tested
main21625bca8.d3d12_rect_list,d3d12_quad_index,replay_quad_list,vulkan_scratch, andd3d12_xmem_placed: 5/5 passed.replay_query_predicationfixture and the replay and GPU quad tests. GPU validation remained clean.git diff --check, and local merge check passed.Live game coverage for this branch is pending. AI-assisted: yes (Claude Code and Codex).
@towade on GitHub · 2026-11-24 15:25 UTC · original
@QemmHD, a heads-up for when this meets #511 (
LEONIDA_LAZY_PSO): the two merge without a textual conflict, but in the mergedd3d12_vulkan_device.cpp, #511'sstage.words = {};(end of the stage loop) runs before this PR'sif (rect_list)block. That block callsleonida::rect_list_geometry(vs_stage.words, why), so it would get empty words. The clear is outside #511's lazy branch, so this happens withLEONIDA_LAZY_PSOunset too, and every rectangle-list PSO would returnE_NOTIMPL("cannot be drawn as a rectangle list").Building the rectangle-list stage before the clear, or keeping the vertex stage's words until after it, would avoid it. The same word-lifetime problem was found for #207 on #511.
Found by reading the merged source (
git merge-treeof both heads,6aa8eb11cand88658f1b3). I have not built or run the combination yet.AI-assisted (Claude Code).
@Dezmonius on GitHub · 2026-11-24 15:36 UTC · original
Native Windows follow-up to the #511 integration warning. I applied the #511 diff at
88658f1bto #682 at6aa8eb11. Windows 10 22H2, RTX 5070 / NVIDIA 610.88, MSVC 19.51.36256, Khronos Vulkan validation 1.4.369.LEONIDA_LAZY_PSO=0and=1,d3d12_rect_listfailed on the same message:the vertex shader is not a SPIR-V module. Indexed quad and replay tests passed in both modes.vs_stage.wordswhenrect_listis set and released it immediately afterrect_list_geometry. Both modes passed all three tests with validation enabled. The three rectangle colour-plane cases matched 4,096/4,096 pixels each, and all seven indexed-quad frames matched 4,096/4,096 pixels each.This checks the combined revisions with synthetic fixtures only. No game files or retail boot. AI-assisted (Codex).