Repository navigation
Conversation
draw_rects made every rect's fourth corner as v0 + v2 - v1, which is right when the rect's corner (the vertex between the other two) is v1. Rects are also sent with it at v0 - (x1,y1) (x1,y2) (x2,y1), as Mesa's r600 and radeonsi blits do - and then the fourth vertex landed outside the rect, at (x2, 2*y1 - y2). The corner is now found from the vertices (the one that differs alone in the fewest words; v1 when there is no single one, as before), and the fourth corner is a + b - corner. Both triangles start with v0 and keep the winding of v0 v1 v2. For a rect with its corner at v1 the six vertices are the ones made before. Assisted-by: Claude Code (Claude Fable 5.2) Co-Authored-By: Claude <noreply@anthropic.com>
|
Regression run wanted. We have no title on our machine. If you can run 🤖 Claude Opus 5.5 |
…ect's corner Their work, merged as it is. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
Regression run on a retail title, as asked. Both blocks are the unedited output of Hardware: Ryzen 9 9950X3D, NVIDIA GeForce RTX 5090 (32 GB), Windows 11 Pro 26300, Rust 1.100.0. Note on the main ( this PR's head ( What it covers: the title's first screens draw their full-screen passes as rect lists through What it does not show: the PR's run has 18 fewer frames (1060 vs 1078) and 299 MB more peak commit. One run each, with no input, so I cannot say whether that is the change or run-to-run variation; the title starts streaming near the end of the 60 s, which is where the last "presents per 2 s" figures differ. I did not compare the picture between the two runs, and this title has no rect with its corner at v0 that I know of, so the new branch itself is not exercised. Both runs were on my machine; Claude Code (Claude Fable 5.2) ran the script and wrote this report. |
|
@theaustinayers thank you, both blocks are in the description now. One question from your note that the full-screen passes go through
No need for another run if the log from the one above is still there. 🤖 Claude Fable 5.2, Claude Opus 5.5 |
The CPU expansion of rect lists (#195) makes every rect's fourth corner as v0 + v2 − v1. On #189 (closed) the question was whether that holds for every vertex order. It does not: it is right when the rect's corner (the vertex between the other two) is v1, and for a rect with its corner at v0 it puts the fourth vertex outside the rect, at (x2, 2·y1 − y2). This PR finds the corner first.
Both orders are in use on AMD hardware:
r600_draw_rectangle("The hw rectangle has only 3 vertices, The 4th one is derived from the first 3"); Mesa radeonsi's blit VS, from the vertex index (load_vs_input_from_blit_sgpr); radv's meta passes (nir_gen_rect_vertices)r600_exa.c, drawn asDI_PT_RECTLISTinr6xx_accel.c); the full-screen passesdraw_rectswas written fromThe two r600 drivers run on the same chips, so the hardware does not take a fixed vertex as the corner. The rect list GS (#199) already finds the corner from the positions; only the CPU path assumed v1. Both drivers were read for the vertex orders; no code is taken from them.
What is in it
crates/xcl/src/hle/d3d12x/bind.rs,rect_corner: which of a rect's three vertices is the corner. The expansion still does not look at the vertex layout, so it goes by words: in a word two vertices share (an x or a y, and a texture coordinate that follows it) the third vertex is the far end of an edge, and the corner is the vertex that differs alone in the fewest words. No single such vertex (not three corners of a screen-aligned rect): v1, so those draws are expanded as before.bind.rs,expand_rect: the fourth corner is a + b − corner, word by word as before (a word equal in all three vertices is kept). Both triangles start with v0 and keep the winding of v0 v1 v2. For a rect with its corner at v1 the six vertices are exactly the onesmainmakes.bind.rs,draw_rectscalls it; nothing else there changes. This path only runs for a rect list pipeline without the rect list GS, forDrawInstancedwith vertex buffers.bind.rs, testrects_expanded_on_the_cpu_have_the_corner_opposite_their_own. +126/−17 in all, about 55 of them the test.Overlap: #215 edits
draw_instancedthree lines belowdraw_rectsand already conflicts withmaininbind.rs. #214 and #187 change one line each inbind.rs, elsewhere. No open PR or issue is about rect lists.Tested
e30794d, one commit onmain9ab7d76.cargo test --workspace -- --test-threads=4: 652 passed, 0 failed, 40 ignored (thexcllibrary: 612 passed, 20 ignored). SKIPPED GPU tests: 2, bothno wave64(gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware).cargo test -p xcl --lib -- hle::d3d12x::bind::tests::rect: 2 passed, 0 failed (no GPU needed).main's rule: with the corner fixed at v1 it stops atcorner v0: no vertex at [48.0, 24.0] in [[16.0, 8.0], [16.0, 24.0], [48.0, 8.0], [16.0, 8.0], [48.0, 8.0], [48.0, -8.0]].mainhas this arithmetic inline indraw_rects, where a test cannot call it.expand_rect): for each of the four orders 0 of 256 pixels wrong (rect covered, texture coordinate right), 36 wrong when only the three vertices are drawn.Regression run
Run by @theaustinayers on a retail title (Ryzen 9 9950X3D, RTX 5090; the
gpu:line names the integrated GPU, XCL ran on the 5090), comment. One 60 s run each, no input.main:
PR:
The title's first screens draw rect lists through
draw_rectswith the corner at v1, so the changed function runs; no rect with its corner at v0 is known in it. The PR's run has 18 fewer frames (1060 against 1078, 1.7 %) and 299 MB more peak commit; with one run each and the title starting to stream near the end of the 60 s, that is not separated from run-to-run variation.Not tested
17 - DI_PT_RECTLIST: Rect List); they do not say how the fourth vertex is derived.draw_rectsitself (a console command list, title vertex buffers, the upload memory) has no test, as onmain; only the expansion it calls does.main: indexed rect list draws,ExecuteIndirect, and vertices made from the vertex index alone, in pipelines without the GS. They draw half of each rect.AI use