Repository navigation
shader: extend mesh image load contracts (Part of #3703) - #3844
Conversation
lukaslw-lab
left a comment
There was a problem hiding this comment.
Reviewed ace75bfb (draft) by reading the diff; not built or run.
Verdict: approve. Every new image-load form packs its DMASK channels into exactly the VGPRs the guest writes. Bound-table loads need a declared SRV slot, and integer formats are refused at bind time. No MUST.
- SHOULD Reconcile with #3836 before either leaves draft. Both rewrite the same mesh Texture1D heap load (
gfx1013_direct_mesh.inl:1818): #3836 adds D16 there with a float-exact runtime gate, while this PR still refuses D16 (bit 31 in the0xfde00000mask). Whichever lands second has to merge the DMASK/NSA/mip handling with the D16 packing, andvec_countis defined in both. - SHOULD Run a before/after
m86census onf365f125. The bind-time integer refusal (native_mesh86.inl:457) also applies to MS table textures thatmainbinds today, so the census plus a draw-time count would show whether any existing pipeline now fails to bind. - NIT This also conflicts with #3806.
- Checked, no finding:
vec_count= popcount(DMASK) (:1518) drives the destination overflow check, the inactive-lane preservation andpartial_writes, so neighbouring VGPRs keep their values under narrowed EXEC.- Operand checks (
:1818): R128, TFE, LWE, A16 and D16 are refused. UNORM and GLC/SLC/DLC are accepted, which is right for integer texel coordinates on a read-only load.image_load_mipreads the level from the next address VGPR, or from the NSA word. - Bound tables (
:1822): only 1D, 2D and 2D-array. The slot must lie in a reflected table record, or in an SRV range of the root table with APPEND offsets resolved in order (:1851), and then goes through the sharedimage_io.
Tests: native_mesh_image_contract_ir (14 cases, 29 refusals) is in the pr filter.
|
Census follow-up for the SHOULD in my review:
All 193 |
Resolved conflict in src/gfx1013_direct_mesh.inl against R0Y00#3806 (5545de9): kept the R0Y00#3844 image_load lowering, DMASK/bound-table contracts, and partial_writes tracking while adopting R0Y00#3806's vector_exec predicate on both the image_load and mtbuf branches.
9f0142e to
0b4fe28
Compare
There was a problem hiding this comment.
Re-review on 0b4fe284 (rebased on 5770f14e: vector_exec from main in the image and MTBUF conditions).
Verdict: approve.
Census, same capture and method as before (6,685 distinct mesh programs), main 5770f14e vs this head:
| Programs | |
|---|---|
| Translate, main / with this PR | 1,047 / 1,143 |
| Gained | 96 (all from mesh image load lacks a remapped Texture1D heap contract) |
| Lost | 0 |
| First refusal moved | 122: to v_med3_f32 43, position mask 40, packed vertex export 33, v_readfirstlane_b32 6 |
The earlier head gained 71 against f365f125. The extra 25 stopped at unsupported mesh scalar branch destination on the earlier head; main has since merged the scalar loops (#3707). Main has since merged #3758 and #3712, which add the table texture load and the integer-format refusal this PR also adds (lower_mesh, native_mesh86.inl). The rebase should drop or merge those parts and will need a fresh census.
Update: the first run was on a main that refused 257 programs early (my #3707, #3892; fixed by #3893). I reran main 5770f14e and this head, both with that fix: 96 gained, 122 moved, 0 lost. The numbers above are unchanged.
AI-assisted.
Share the table and remapped Texture1D paths across level-zero and mip loads. Preserve the separate full-descriptor heap path and use the merged Mesh86 table format validator.
A seeded destination now preserves its incoming value when EXEC excludes the lane. Assert that the selected value reaches the export and keep a refusal for a destination with no incoming value.
|
Merged
Tests, Windows 11 26200 with RTX 5080 and WARP:
The census gain from the earlier re-review (+96 programs on |
|
Marked Ready for review now that #3827 and #3829 have merged, keeping to 5 non-draft PRs per #3514. CI is green at this head. All 17 open PRs from this batch were also merged together onto main |
R0Y00
left a comment
There was a problem hiding this comment.
Independently reviewed this head. The packed write count drives EXEC joins and the explicit raw SRV range check rejects gaps. MSVC Debug: ctest --preset dev --no-tests=error -j 1 --output-on-failure -R '^(native_mesh_image_contract_ir|native_direct_mesh|native_direct_container)$' passed 3/3. Removing only the raw SRV range refusal made table-gap translate and failed the fixture. The restored head passed again.
Part of #3703.
Summary
Extends mesh
image_loadandimage_load_miplowering (mesh image load lacks a remapped Texture1D heap contract, 193 programs in #3703):dmask(1..15), packs selected channels into consecutive VGPRs, preserves inactive lanes and neighboring registers under narrowed EXEC (vec_count), and supports both UNORM settings, read-only cache hints (GLC/DLC/SLC), and NSA mip addressing.Texture1Dvia the mesh heap slot map as well asTexture1D,Texture2D, andTexture2DArrayfrom bound SRV descriptor tables (verified against reflection or root descriptor-table SRV ranges).bind_native_mesh86for mesh table views (since emitted DXIL usestextureLoad.f32), and keeps invalid/overwritten descriptors, R128, LWE/TFE, and D16 refused in this path.Verification
compile_dxilandstartup_indirect_draw_indexedin both 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_image_contract_ir$': passed (14 positive DXIL cases + 29 refusal controls).dev) and Release (release): 3/3 passed (native_mesh_image_contract_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.