gpu,shader: port NaN-safe compose clamp and pixel HDR range clamp #534
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!534
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-534"
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?
@Wiktorxd-1 on GitHub · 2026-11-28 00:27 UTC · original
Wiktorxd-1:fix/compose-nan-and-hdr-clamp→main· +56 −5 · 2 files · 1 commits · openWhat this fixes
Ported two visual-artifact fixes from
aki-gta6/aki-runtime(33c21b9,01f6f31) by way ofProjectLeonida/mandy(a8d2f48,1411b6c, GPL-3.0):NaNblack specks (crates/victory-gpu/src/compose.rs):saturate(NaN)evaluates to0.0(black) in HLSL, turningNaNs from upscaling or frame generation into black specks / black sun glints.clean1()uses a bit-level NaN/Inf check ((asuint(x) & 0x7FFFFFFFu) > 0x7F800000u ? 1.0 : saturate(x)) soNaNand+Infclamp to1.0instead of black (VICTORY_COMPOSE_NAN=0restores plainsaturate).crates/victory-shader/src/emit/lower.rs): The title renders light intoR9G9B9E5targets (clamped at65408on console), whereas the host uses 16-bit float targets where values above65504become+Inf, which the title's tonemapper turns black (black sun / black glitter / dark patches).clamp_hdr()holds pixel float colour outputs to[-65024, 65024]and mapsNaNto65024.0(VICTORY_HDR_CLAMP=0disables it).The commits
VICTORY_COMPOSE_NAN) and pixel HDR range clamp (VICTORY_HDR_CLAMP).Tests
cargo test --locked -p victory-shader --lib emit::tests(passed, 0 failed)cargo test --locked -p victory-gpu --lib descriptor::host::tests(47 passed; 0 failed)cargo build --release --locked -p victory(succeeded in1m 30s)Setup
NVIDIA GeForce RTX 5070, driver
621.14.0, Windows 11 (10.0.26300). My own dump:<game dir>. No game files are attached or quoted.This change and its testing were done with an AI assistant (Antigravity), and I checked the results on my machine.
View 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.