Shader: preserve the sign in bit-field extraction #13

Closed
Ingenioeren wants to merge 1 commit from upstream-pr/13 into main
Ingenioeren commented 2026-11-23 22:59:32 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Ingenioeren on 2026-11-23T22:59:32Z.


What

Address the signed bit-field extraction case from #2. Use an arithmetic right shift for signed scalar and vector BFE so a field crossing bit 31 keeps the source sign. Unsigned extraction keeps its logical shift.

Tested

The new synthetic regression failed against the original lowering (LShr instead of AShr). It checks the emitted signed and unsigned shift opcodes. Ran cargo test --locked --offline -p victory-shader --lib -- --nocapture on Windows x64 with Rust 1.98.1. Compiler-dependent differential tests returned early because the required shader compilers were unavailable. This does not claim an RDNA2 hardware reproduction.

AI assistance: Codex prepared the change and regression test and verified the results. No game assets were used.

Windows shader crate tests: 58 passed; 0 failed; 0 ignored.

<!-- greyfinch-sync:Marvisak/VIctory:issue:6570588027 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/13). Originally posted by [Ingenioeren](https://github.com/Ingenioeren) on 2026-11-23T22:59:32Z. --- ## What Address the signed bit-field extraction case from #2. Use an arithmetic right shift for signed scalar and vector BFE so a field crossing bit 31 keeps the source sign. Unsigned extraction keeps its logical shift. ## Tested The new synthetic regression failed against the original lowering (LShr instead of AShr). It checks the emitted signed and unsigned shift opcodes. Ran cargo test --locked --offline -p victory-shader --lib -- --nocapture on Windows x64 with Rust 1.98.1. Compiler-dependent differential tests returned early because the required shader compilers were unavailable. This does not claim an RDNA2 hardware reproduction. AI assistance: Codex prepared the change and regression test and verified the results. No game assets were used. Windows shader crate tests: 58 passed; 0 failed; 0 ignored.
upstream-sync closed this pull request 2026-11-24 06:50:54 +00:00
Marvisak commented 2026-11-24 06:54:30 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-23T23:14:14Z.


Already fixed, thanks anyways

<!-- greyfinch-sync:Marvisak/VIctory:comment:7116719041 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/13#issuecomment-7116719041). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-23T23:14:14Z. --- Already fixed, thanks anyways

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Marvisak/VIctory!13
No description provided.