Shaders: translate the 32-bit and 64-bit scalar zero-bit counts #171

Open
github-bot wants to merge 1 commit from github-bot/gh-171 into main AGit
Owner

@⁠GeaorgeAyvazov on GitHub · 2026-11-24 22:06 UTC · original
GeaorgeAyvazov:shader/scalar-zero-count → main · +40 −2 · 2 files · 1 commits · open

The decoder and IR already represent S_BCNT0_I32_B32 and S_BCNT0_I32_B64, but scalar lowering falls through to the unsupported-instruction path. This translates both to the operand width minus its population count, using the existing dword pair representation for the wide form. SCC reflects whether the resulting count is nonzero.

The regression builds two synthetic GFX10 compute shaders, consumes the count and SCC together, and checks the UAV output for all zeros, all ones, asymmetric halves, and mixed bits. It uses the normal shader translator and D3D12 test harness. No game assets.

Tested on Windows with Rust 1.98.1. The focused test passed on RTX 3070 Ti Laptop and Iris Xe with temporary explicit DXGI selection, and through the ordinary hardware/WARP harness. Running the full victory-shader library suite with the new test on the original emitter gave 203 passed, 8 failed, 2 ignored. With this patch: 204 passed, 7 failed, 2 ignored. The same seven existing intersection, LDS and wave64 tests failed both times. No title-level performance or visual claims.

Implemented and tested with OpenAI Codex.

**@⁠GeaorgeAyvazov** on GitHub · 2026-11-24 22:06 UTC · [original](https://github.com/fxceless/victory-fork/pull/171) `GeaorgeAyvazov:shader/scalar-zero-count` → `main` · +40 −2 · 2 files · 1 commits · open The decoder and IR already represent S_BCNT0_I32_B32 and S_BCNT0_I32_B64, but scalar lowering falls through to the unsupported-instruction path. This translates both to the operand width minus its population count, using the existing dword pair representation for the wide form. SCC reflects whether the resulting count is nonzero. The regression builds two synthetic GFX10 compute shaders, consumes the count and SCC together, and checks the UAV output for all zeros, all ones, asymmetric halves, and mixed bits. It uses the normal shader translator and D3D12 test harness. No game assets. Tested on Windows with Rust 1.98.1. The focused test passed on RTX 3070 Ti Laptop and Iris Xe with temporary explicit DXGI selection, and through the ordinary hardware/WARP harness. Running the full victory-shader library suite with the new test on the original emitter gave 203 passed, 8 failed, 2 ignored. With this patch: 204 passed, 7 failed, 2 ignored. The same seven existing intersection, LDS and wave64 tests failed both times. No title-level performance or visual claims. Implemented and tested with OpenAI Codex.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:37:30 +00:00
This pull request has changes conflicting with the target branch.
  • crates/victory-shader/src/emit/valu_tests.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/171/head:github-bot/gh-171'
git switch 'github-bot/gh-171'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-171'
git switch 'github-bot/gh-171'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-171'
git switch 'github-bot/gh-171'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-171'
git switch 'main'
git merge --squash 'github-bot/gh-171'
git switch 'main'
git merge --ff-only 'github-bot/gh-171'
git switch 'main'
git merge 'github-bot/gh-171'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.