shader: lower multi-component typed buffer loads in mesh (Part of #3703) #3846
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3846"
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 timbot103 on 2026-12-02T08:48:43Z.
Part of #3703.
Summary
Targets the #2 remaining wall from the 2 Dec stacked mesh census (
buffer_load_format_xyzw, 164 programs):buffer_load_formatlowering insrc/gfx1013_direct_mesh.inlto support 1- through 4-component descriptor-table typed loads (buffer_load_format_x,_xy,_xyz,_xyzw) on wave32 and wave64, includingEXECZskips andSAVEEXECarms (recordingpartial_writesfor allformat_widthdestinations).scalar_counttoformat_widthfor group-uniform propagation (uniform_values+group_uniform) and clearsexchanged_groupwhenever a multi-component table load spansv5.R32_UINTresource-heap contract (format_width == 1) and refuses wider resource-heap loads without a runtime contract.Verification
compile_dxilin Debug (dev) and Release (release) with zero new C++20/W4warnings on edited lines.ctest --preset pr --no-tests=error --output-on-failure -R '^native_mesh_buffer_load_format_ir$': passed (46 validated DXIL modules + 26 expected refusals).dev) and Release (release): 3/3 passed (native_mesh_buffer_load_format_ir|native_direct_mesh|native_direct_container), zero skips.tests/bidi_controls_check.py,tests/docs_links_check.py, andgit diff --check origin/main..HEADpassed.#3514's 5-PR ready cap.Imported from R0Y00/Xbox2Windows. Originally posted by lukaslw-lab on 2026-12-02T09:34:33Z.
Review: APPROVED
Reviewed
5bddf66d(draft) by reading the diff and running an offline mesh census of this PR alone; not otherwise built or run.Verdict: approve. Typed table loads of 1–4 components go through the shared typed-buffer path, and the widened uniformity and
v5bookkeeping follow the component count. No MUST.Census,
f365f125+ this PR alone, same capture as #3703 (6,685 mesh programs): 1,036 translate on both builds, none lost, no validation failures. 35 programs move offv_readfirstlane_b32, because the loaded words are now uniform: 17 tods_swizzle_b32, 10 tos_load_dwordx4, 5 to the VCC whole-wave mask. The 164-programbuffer_load_format_xyzwwall appears only after other PRs clear earlier walls, so this capture cannot show it directly.lower_mesh.buffer_load_formatonly with IDXEN-only (or, direct, no) addressing, no0x02000000bit and SOFFSET inline 0 (gfx1013_compute_native.cpp:290), so no OFFEN or per-lane offset can reach the uniform rule.format_width = op + 1(gfx1013_direct_mesh.inl:1447) now drivesscalar_count,partial_writesunder narrowed EXEC (:1765) and the group-uniform marking, so a wider load no longer marks or leaves stale VGPRs beyond its destination.:2590) only under the existing full-EXEC, no-store, uniform-index rule.v5clearsexchanged_group(:2606), which the old single-register check missed.Tests:
native_mesh_buffer_load_format_ir(46 modules, 26 refusals) is in theprfilter.Imported from R0Y00/Xbox2Windows. Originally posted by lukaslw-lab on 2026-12-02T20:27:35Z.
Review: APPROVED
Re-review on
2117867b(rebased on5770f14e:vector_execfrom main; MUBUF format loads widened toop0–3).Verdict: approve.
Census, same capture and method as before (6,685 distinct mesh programs), main
5770f14evs this head:v_readfirstlane_b32(see the update)The earlier head moved 35 against
f365f125. Checked:format_widthisop+1only forbuffer_load_formatop0–3, partial writes cover every component, and the one-component path keeps the R32_UINT runtime contract.Update: the first run was on a main that refused 257 programs early (my #3707, #3892; fixed by #3893). I reran main
5770f14eand this head, both with that fix: 35 moved, 0 lost, 0 gained, all fromv_readfirstlane_b32: tods_swizzle_b3217,s_load_dwordx4root mapping 10,VCC branch without a whole-wave mask5,v_min_f323. The earlier head also moved 35; my first run here showed 3 because of the masking. Main has since merged #3790 in the same code (uniform buffer loads), so the rebase needs care there.AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by timbot103 on 2026-12-02T23:05:02Z.
Merged
main(67862ee4) into this branch; the reviewed commit2117867bis unchanged.v5invalidation, and main's nested-CMPX instruction tracking.36a6376amakes the uniformity probe inspect reaching values without reading operands before load validation. A destination overflow now reports its own diagnostic again.Tests, Windows 11 26200 with RTX 5080 and WARP. The mesh filter was
native_direct_mesh|native_direct_container|native_mesh_plus this PR's own tests. Every branch passed a full Debug build of every target, including the C++17native_compute_pack_refusal_check.accepted=1 refused=0). They also fail on a clean67862ee4, and every one of them passed withX2W_SYNC_MESH_REQUESTS=1.All six mesh PRs (#3832, #3835, #3838, #3842, #3843 and #3846) were also merged together onto
67862ee4. That combined tree passed 47/47 in Debug and 47/47 in Release, plus 8/8 under the PR preset. All 15 pairs merge cleanly.Imported from R0Y00/Xbox2Windows. Originally posted by timbot103 on 2026-12-03T01:30:56Z.
Merged
main(f3ab02fe) into this branch; the only conflict was thedocs/experiments.mdindex, where both entries are kept. The mesh filter passes in Debug and Release, and so does the PR preset (1/1). The remaining failures also fail on cleanf3ab02fe:native_mesh_entry_registers_ir(a #3838/#3894 test interaction, with a fix PR coming) and the asynchronous WARP allocation fixtures, which pass withX2W_SYNC_MESH_REQUESTS=1.Imported from R0Y00/Xbox2Windows. Originally posted by timbot103 on 2026-12-03T04:01:09Z.
Merged
main(41a83a9a, which includes #3907) into this branch; the merge was clean. The mesh filter passed 19/19 in Debug. Release passed 16/19; the 3 failures are the existing asynchronous WARP allocation fixtures, which pass withX2W_SYNC_MESH_REQUESTS=1.native_mesh_entry_registers_irpasses again, and the PR preset passed 1/1.Imported from R0Y00/Xbox2Windows. Originally posted by timbot103 on 2026-12-03T04:01:26Z.
Marked Ready for review now that slots have freed up, keeping within 5 non-draft PRs per #3514. The branch merges cleanly with current
main.Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-12-03T04:15:13Z.
Review: APPROVED
Independently reviewed
04d96ff8and tested it both as submitted and in a clean trial merge onto43055293after #3842. The descriptor-table case uses the shared typed load and tracks all written components through EXECZ joins. The resource-heap path still requires one component. MSVC Debugctest --preset dev --no-tests=error -j 1 -V -R '^(native_mesh_readfirstlane_active_controls|native_mesh_buffer_load_format_ir)$'passed 2/2 on the combined tree: 46 validated DXIL modules and 26 expected refusals in the new suite. Removing just theexchanged_groupinvalidation for a wide load that starts below and overwrites v5 fails the typed-load fixture. Limiting onlymark_uniform_buffer_load()to one component still passes these fixtures because the group-uniform path also marks outputs on fully uniform loads. I restored both edits. This verification is DXIL validation and refusal coverage.