perf(shader,gpu): add opt-in SM 6.2 native half emission gated on Native16BitShaderOpsSupported (VICTORY_NATIVE_FP16=1) #420
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/420"
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 TaynanGT/Vice-Tay. Originally posted by Vladimir-Human on 2026-11-28T15:22:49Z.
Implements an opt-in, hardware-capability-gated SM 6.2 native
halffoundation for item #1 from #401 (VICTORY_NATIVE_FP16=1, default OFF =0).Summary (
1be693f)host.rs,shader_cache.rs,pipeline/library.rs): requires bothVICTORY_NATIVE_FP16=1andD3D12_FEATURE_DATA_D3D12_OPTIONS4::Native16BitShaderOpsSupported == true(falls back cleanly to baseline widened FP32 translation otherwise); keys shader/PSO disk caches separately when active.emit/bitcode.rs,bitcode/opt.rs,lower.rs,mod.rs,shader.rs,container.rs): selects SM 6.2 where compatible (SFI0bit 18NativeLowPrecision+ DXIL entry metadata bit 23), lowers native binary16 constants, bitcasts,fadd/fsub/fmul/fmad, min/max, comparisons,fpext/fptrunc, and aligned raw half load/extract/store while cleanly keeping transcendentals/mixed-precision/LDS on safe FP32 fallback.VICTORY_NATIVE_FP16is unset (0), emitted DXIL matches baselineorigin/mainbyte-for-byte;Cargo.lockuntouched.Verification
cargo xtask policy: OKcargo clippy -p victory-shader -p victory-gpu --all-targets --locked -- -D warnings&--features diagnostics: 0 warningscargo test -p victory-shader --locked -- fp16: 4/4 passed (validated via Windows SDK10.0.26100.0\x64\dxil.dll); fullcargo test -p victory-shader --locked: 347/347 passedVICTORY_D3D12_DEBUG=1&VICTORY_D3D12_WARP=1cargo test -p victory-gpu --features diagnostics --locked --lib fp16: 4/4 passed on both (hardware/WARP buffer parity against widened baseline)Imported from TaynanGT/Vice-Tay. Originally posted by Garu667 on 2026-11-28T18:48:21Z.
Tested on an RTX 3080 10 GB (
1be693f, Series S, 5 min runs, 1 warm-up run excluded, 3 pairs).native_fp16=trueshows up in the log, so the gate works on this card.VICTORY_NATIVE_FP16=1So on Ampere it's a clear regression, mostly at entry (~2.5 fps for the first samples on every on-run, vs ~12.7 off) and the runs reach the same scenes later. The picture renders, though character surfaces in the boat cutscene looked smeared or partly see-through in one on-run capture; I can't rule out TAA/motion blur from a single frame.
Imported from TaynanGT/Vice-Tay. Originally posted by TaynanGT on 2026-11-29T11:35:40Z.
Thanks for the three matched pairs. The substantial Ampere startup regression means this should remain opt-in, even when Native16BitShaderOpsSupported is true. The possible character artifact also needs repeated matched captures before we consider enabling it by default.
Imported from TaynanGT/Vice-Tay. Originally posted by TaynanGT on 2026-11-30T17:08:02Z.
mainhas moved to a new line of the code and everything is now named Vice-Tay, so this PR no longer applies as it is (details in #468). If you'd like this change in, please rebuild it on the currentmainand open a new PR; I'll review it there.Pull request closed