shader: lower binary32 add, sub, subrev, mul, min and max in the depth-mask translator #1118
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1125"
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?
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T01:25:20Z.
Change
AI-assisted. Extends
tools/depth_mask_aot.pyso the two-table depth-only translator acceptsv_add_f32_e32,v_sub_f32_e32,v_subrev_f32_e32,v_mul_f32_e32,v_min_f32_e32andv_max_f32_e32. Before, any of them raised "Unsupported depth instruction". Reading a VGPR that no earlier instruction wrote now raises ValueError instead of KeyError (a small change in the same function, reachable through the new second source). No overlapping open PR found (gh pr list --state all, no related issue found withgh issue list --search depth).Verification
Commit on top of main
32f63f9e, LLVM 19 locally (CI uses LLVM 15, not available here):python3 -B tests/depth_mask_check.py binary llvm-mc-19 llvm-objcopy-19 /usr/lib/llvm-19/lib/libLLVM-19.so: exit 0 with the change.tools/depth_mask_aot.pyfrom main: exit 1,ValueError: Unsupported depth instruction: v_add_f32_e32.subrev's lowering tosub's operand order: exit 1 (pinned lowered line no longer matches).depth_mask_ops_draw_*(new CTest,depth_mask_check.py ops <dxc> <offscreen_check> <adapter>). It needs dxc and a D3D12 adapter, which this Linux host lacks. I only ran its Python flow against a stub compiler and stub renderer. No WARP or GPU readback of these six forms has been observed yet; capability skip is exit 77 as for the neighboring draw test.Evidence and follow-up
op(0.5, v7)and feeds the existing discard compare. The lowered line is pinned as a literal per form, and replacing that one instruction word with each of the other five forms must change the line to that form's.docs/experiments.md"Buffered depth export" updated.Checklist
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T01:25:29Z.
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
b66f869ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
Imported from R0Y00/Xbox2Windows. Originally posted by thepatrickworld on 2026-11-24T01:53:43Z.
Ran the draw you couldn't:
depth_mask_ops_draw_hardwareon an RX 9070 XT (vendor 1002, device 7550), driver32.0.32029.2010, Windows26200.9711, headb66f869bmerged onto45b3c5d2→50895ce3, tree159d1570, clean tree, DXC1.9.2602.17,devpreset,debug_layer=unavailable.4/4 passed, three consecutive runs. Timings from the first run:
depth_mask_draw_hardware2.31 s,depth_mask_ops_draw_hardware5.93 s, and the two warp entries 0.93 s and 2.56 s. The ops test makes 42 draws per run: 12 against their own reference (mismatches=0) and 30 against another form's reference, each rejected withDraw reference mismatchand counts 512 (×10), 768 (×10), 256 (×8), 1024 (×2) — the same in all three runs, and consistent with the reference I recomputed in Python.That recomputation is also the check on the two-case design: for (7, 0.25) and (29, 0.75), no two of the six forms produce the same pair of reference images. What carries it is worth stating: on the second case four of the six saturate at 1024/1024 low-depth pixels, so any separation between them rests on the first case — and there
subandsubrevshare the count 768 and differ only in which rows sit at the low depth. Counts alone never separate those two.AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by thepatrickworld on 2026-11-24T02:12:24Z.
Confirmed on the merge commit, since the run above was on a merge I built myself (tree
159d1570) rather than on the tree that shipped:0a4bd9da07e7b716647bbb26930733bd47a36c77, treee1335f5047bcb58223c5a4abfda9c5c4d6d442b5, clean tree.depth_mask_draw_hardware2.06 s,depth_mask_ops_draw_hardware5.65 s, and the two warp entries pass — 4/4, twice.AI-assisted.