victory-shader: support line-topology mesh shaders #1711
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1712"
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 Marvisak/VIctory. Originally posted by tjthebigbearcat-hub on 2026-11-24T21:05:22Z.
Summary
Adds support for line-output mesh shaders (
topology = 1) alongside triangles (topology = 2) invictory-shader:emit/lower.rswithemit_primitiveto unpack two vertex indices (bits 0 and 10) for lines—leaving the third DXILemitIndicesindexundef—while preserving primitive culling (bit 31 and unexported primitives).0,3, etc.) cleanly refused with clearer diagnostic messages.emit/mod.rsmodule docs to reflect line and triangle mesh shader support.Verification (Windows 11 + SDK
dxil.dll10.0.26100 + WARP)emit/mod.rs(zero game bytes; verified withxtaskasset-policy check):mesh_programs_draw_lines_or_triangles: validates line and triangle programs (normal and culled) againstdxil.dll 10.0.26100and verifiesPSV0topology output, while confirming topologies0and3are refused.mesh_lines_light_one_texel_row: executes a line mesh pipeline on WARP (D3D12), verifying 15 lit texels along row 8 and 0 lit texels when culled (verified failure when bit-unpacking offset was mutated).cargo test --workspace --locked: all crates pass, 0 failures.cargo clippy --workspace --all-targets --locked -- -D warnings: 0 warnings.Imported from Marvisak/VIctory. Originally posted by DenRakEiw on 2026-11-24T21:26:31Z.
Review: APPROVED
Verified locally merged onto
origin/main(Windows 11 x64, NVIDIA GeForce RTX 5090 + WARP, Rust 1.98.1 MSVC, withdxil.dllvalidator):cargo test -p victory-shader --lib mesh_— 6 passed, 0 failed on both RTX 5090 hardware andVICTORY_D3D12_WARP=1(includingmesh_programs_draw_lines_or_trianglesandmesh_lines_light_one_texel_row)cargo clippy -p victory-shader --all-targets— 0 warningscargo xtask policy— okClean line-topology mesh shader lowering with end-to-end rendering verification on hardware and WARP. Looks good.
AI-assisted (Gemini 4 Neon).
Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-24T21:40:02Z.
Review: APPROVED
Tested locally on macOS arm64 (rustc 1.98.1): PR head merged cleanly into current main (
ffe310e), cargo test -p victory-shader --locked → 97 passed, 0 failed. Hardware/valu/waterfall execution tests are #[cfg(all(test, windows))] and run only on Windows; macOS covers lowering/structure unit tests.Line-topology mesh shaders: emitIndices takes two indices for lines (third undef, validator accepts for line topology), primitives past the program's count are culled via zero-area/zero-length sentinels, and a clear error is returned for mesh shaders drawing neither lines nor triangles. +1 macOS test.
Imported from Marvisak/VIctory. Originally posted by steven-seagull27 on 2026-11-24T21:42:12Z.
Tested PR head
57c2560on an RTX 5080 (driver 621.24) and built-in Windows WARP. Both lit exactly the same 15 pixels on row 8, columns 0–14 inclusive, on the 16 × 16 target. With the cull bit set, both lit 0 of 256 pixels.The full RGBA readbacks matched bit for bit between adapters on both draws. Both original mesh tests also passed on the clean PR head.
Imported from Marvisak/VIctory. Originally posted by mercuryVM on 2026-11-24T22:24:55Z.
Review: APPROVED
Tested
57c25604on Windows 11, RTX 5070, MSVC:cargo test -p victory-shader -- --test-threads=1passes on the head (122 passed, 1 ignored).The change looks right:
corners()drives both the index unpacking and theemitIndicesarity, with the third indexundeffor lines.topology: ms.topology), so the validator sees a line mesh.It conflicts with #1718 in
lower.rsandmod.rs(the same unpacking loop and the test module), so I couldn't merge it into our fork after #1718. Once #1718 lands, please rebase onto it, and keep the 9-bit0x1FFmask in the new unpacking.AI-assisted (Claude Code).
Imported from Marvisak/VIctory. Originally posted by kais7654 on 2026-11-24T22:35:55Z.
Reviewed and verified at runtime (Windows): the six mesh tests pass,
including the draw one — the line lit exactly texel row 8 on both the
hardware device and WARP, the culled export lit nothing, and the
translated modules' PSV0 carries the right topology byte. Topologies
other than lines and triangles stay refused with the new message.
One coordination note: this and #1718 touch the same mask line in
emit_indices (10-bit here, 9-bit plus edge flags there) — whoever
merges second needs a trivial rebase of that one line.
Imported from Marvisak/VIctory. Originally posted by DeerSilver on 2026-11-24T23:06:35Z.
Setup: one laptop with an NVIDIA GeForce RTX 5060 Laptop GPU (Blackwell,
10de:2d59, driver 621.24) and an Intel UHD Graphics (Raptor Lake Xe-LP,8086:a788, driver 32.0.101.7088), Windows 11 26300, Rust 1.98.1. The PR was merged ontomain70564ae.cargo test --workspace --all-features --locked --no-fail-fast -- --test-threads=1with the D3D12 debug layer on (VICTORY_D3D12_DEBUG=1, and a local, uncommitted change that also turns the debug layer on in victory-shader's testHost): 477 passed, 5 failed, 7 ignored. The 5 failures are the onesmain70564aehas by itself on NVIDIA (the view-heap cap and the structured-view stride, already reported in #1744); this PR adds none. No new debug-layer messages compared withmain.cargo clippy --workspace --all-targets --locked -- -D warnings, with and without--all-features: cleanmesh_lines_light_one_texel_rowgives the same result on both devices:hardware: the line lit 15 texels of row 8on the RTX, and the same on WARP.mesh_programs_draw_lines_or_trianglespasses.No game data used. AI-assisted (Claude Code).
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T01:34:55Z.
Automated triage for the maintainers.
Merge candidate. This lets mesh programs that draw lines translate.
mesh_prologueand the primitive export incrates/victory-shader/src/emit/lower.rsgo through a newemit_primitive, which passes as many 9-bit indices ascorners(topology)gives and leaves the third undefined for a line. Topologies other than 1 and 2 stay refused. The topology numbering (1 lines, 2 triangles) is the oneMeshIo::topologyinnative.rsalready documents, and it matches DXIL's, which passes it through to PSV0. Upstream's0x1FFindex mask is kept. The new draw test,mesh_lines_light_one_texel_row, was reported in this thread to light only row 8 and to cull completely on an RTX 5080, an RTX 5060 Laptop, an Intel UHD and WARP.Thanks for the rebase, which kept
main's edge-flag tests. It merges cleanly now, so this is the first content review.CI: passing (
check).Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by tjthebigbearcat-hub on 2026-11-25T03:21:00Z.
Rebased cleanly onto current
main(940d32f→ff8c445):0x1FFvertex index edge-flag mask into the line/triangle primitive export loop and kept both upstream's edge-flag tests and our line-mesh tests.cargo test -p victory-shader --locked mesh(7 passed, 0 failed) andcargo clippy(0 warnings).Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T01:51:45Z.
Review: COMMENTED
Reviewed and verified against
main(63bcca43) on Windows 11 with native Mesh Shaders on RTX 5090 + WARP (VICTORY_D3D12_DEBUG=1) anddxil.dll(10.0.26100.0) — looks clean and ready to merge:corners(topology)(1 -> Some(2),2 -> Some(3), rejecting others) and the sharedemit_primitive(prim, indices)helper cleanly cover bothmesh_prologueandemit_indices, preserving bit-31 primitive culling (SLT 0 -> 0), dropping edge flags, and passingundeffor the 3rd corner todx.op.emitIndices(opcode169) on line topology — accepted bydxil.dll.emit/container.rs(info[27]) andvictory-gpustream PSO /dispatch_meshalready consume the PSV0 topology directly with no GPU-crate changes needed.63bcca43, this bringscrates/victory-shader/src/emit/lower.rsto 521,619 B (+1,056 B, 2,669 B under the524,288 Bcap) — passescargo xtask policynow, just worth keeping an eye on merge order with otherlower.rsPRs.Local verification:
emit::tests::mesh_programs_draw_lines_or_triangles&mesh_lines_light_one_texel_row: passed on both RTX 5090 and WARP (the line lit 15 texels of row 8, culled0x8000_0400segment unlit)victory-shadermesh +emit::lower::tests: 40/40 passed (RTX 5090 +DEBUG=1), 7/7 passed (WARP +DEBUG=1)cargo clippy(default &--all-features) +cargo xtask policy(191 files ok): 0 warningsView command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.