victory-shader: mask mesh primitive vertex indices to 9 bits (drop edge flags) #1718
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!1718
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1718/head"
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?
@tjthebigbearcat-hub on GitHub · 2026-11-24 21:14 UTC · original
tjthebigbearcat-hub:fix/third-pr→main· +188 −7 · 3 files · 1 commits · merged 2026-11-25 00:15 UTCSummary
Fixes mesh primitive export vertex index unpacking in
victory-shader(crates/victory-shader/src/emit/lower.rsandio.rs):0x1FF) instead of 10 bits (0x3FF) so hardware edge-flag bits (bits 9, 19, and 29) are not mixed into vertex indices.crates/victory-shader/src/io.rs.Verification (Windows 11 + SDK
dxil.dll+ WARP)crates/victory-shader/src/emit/mod.rs(zero game bytes; verified withxtaskasset-policy check):primitive_export_indices_drop_the_edge_flags: validates plain, edge-flagged (0x20280600), and culled triangles againstdxil.dll.edge_flagged_triangles_draw_as_unflagged_ones: executes on WARP (D3D12), verifying edge-flagged triangles rasterize all 256 texels identically to unflagged triangles (whereas the previous0x3FFmask rendered 0/256 texels).cargo test --workspace --locked: all crates pass, 0 failures.cargo clippy --workspace --all-targets --locked -- -D warnings: 0 warnings.@steven-seagull27 on GitHub · 2026-11-24 21:37 UTC · original
The edge-flagged triangle matched the unflagged reference pixel for pixel on both the RTX 5080 (driver 621.24) and built-in Windows WARP. I tested PR head
c0228d9on Windows 11 build 26300.10075 and read back the 16 × 16 RGBA target after each draw.0x002004000x202806000xa0280600With all three flags set, every pixel matched the reference RGBA value
[1.0, 0.5, 0.25, 1.0]bit for bit. I also set bit 9, bit 19, and bit 29 individually. Each single-bit draw produced 0 differing pixels out of 256 on each adapter. With culling enabled, all four channels were zero across the target on both adapters.Both original mesh tests passed on the clean PR head. The Windows SDK DXIL validator also accepted the unflagged, flagged, and flagged-and-culled shader variants.
@kais7654 on GitHub · 2026-11-24 22:32 UTC · original
Reviewed and verified at runtime on a host that caps its heaps
(Windows): cargo check clean, and both new tests pass — the validator
one, and the hardware/WARP draw test (edge-flagged corners drew as
unflagged, the culled export lit nothing). The 9-bit index + edge flag
layout is consistently updated in io.rs; no other 10-bit mesh mask
remains.
@DeerSilver on GitHub · 2026-11-24 23:06 UTC · original
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: cleanedge_flagged_triangles_draw_as_unflagged_onesdraws on both devices:hardware: edge-flagged triangles drewon the RTX andwarp: edge-flagged triangles drew.primitive_export_indices_drop_the_edge_flagspasses.No game data used. AI-assisted (Claude Code).