mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 22:50:53 +01:00
[PR #682] [MERGED] OLD-9940: draw Xbox rectangle and indexed quad lists as triangles #722
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#722
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/682
Author: @QemmHD
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/25/2026
Merged by: @aslan2142
Base:
main← Head:qemmhd/old-9940-rectangle-quad-lists📝 Commits (10+)
21f07a0d3d12: draw the console's rectangle lists (17, PSO type 19) and quad lists (19) as triangles0688b83d3d12: rectangle list stage emits (v1 v2 v4) (v1 v4 v3) with capability Geometry, log cut-off quads (review fixes)abe64d4d3d12: quad lists draw as triangle-list indices (0 1 2) (0 2 3) so flat inputs use the first quad vertex, and the PSO topology type is read as raw bitse3c22ccd3d12: rect_list_geometry records that packed f16 attributes cannot be told apart from float outputs on the vertex side (comment only)0bd3c99d3d12: rectangle list geometry picks the right-angle corner per rectangle (the vertex opposite the longest screen edge) instead of assuming the first; tests for the corner at the second and third vertex and for a non-right triangleee9db97d3d12: rect list test: every pixel well inside a non-right triangle is drawn; geometry notes edges are measured in NDC8311d89d3d12: the quad list index counts are 32-bit constants, not narrowed from size_t (C4267)7739895vulkan_scratch: the chunks can take usage beyond transfer source and destinationa9fb805d3d12: indexed quad lists draw from triangle indices a compute pass expands on the GPU (OLD-9940)6ce66cfd3d12: GPU test for indexed quad lists: both index sizes, a base vertex, flat inputs, overlapping instances (d3d12_quad_index)📊 Changes
18 files changed (+2203 additions, -43 deletions)
View changed files
📝
docs/d3d12_vulkan.md(+37 -1)📝
docs/testing.md(+3 -3)📝
runtime/CMakeLists.txt(+40 -0)📝
runtime/shims/d3d12_vulkan_device.cpp(+79 -23)➕
runtime/src/quad_index_expand.comp(+44 -0)➕
runtime/src/quad_index_expand.h(+182 -0)➕
runtime/src/quad_index_expand_spv.h(+148 -0)➕
runtime/src/rect_list_geometry.h(+268 -0)📝
runtime/src/vulkan_backend.h(+34 -3)📝
runtime/src/vulkan_replay.h(+106 -8)📝
runtime/src/vulkan_scratch.h(+6 -3)➕
runtime/test/d3d12_quad_index_test.cpp(+359 -0)➕
runtime/test/d3d12_rect_list_test.cpp(+421 -0)➕
runtime/test/replay_quad_list_test.cpp(+406 -0)➕
runtime/test/shaders/ps_quad_flat.asm(+15 -0)➕
runtime/test/shaders/vs_quad_inst.asm(+28 -0)📝
runtime/test/vulkan_scratch_test.cpp(+25 -1)📝
scripts/run_gpu_tests.py(+2 -1)📄 Description
Claimed 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).
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.