Shaders: track literal bit operations in sampler descriptors #946

Open
avt0m4t48 wants to merge 1 commit from upstream-pr/947 into main
avt0m4t48 commented 2026-11-25 13:27:58 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by avt0m4t48 on 2026-11-25T13:27:58Z.


The descriptor tracer already folds inline operands for s_brev_b32 and s_not_b32. The same scalar operations with a literal dword left the sampler word unresolved, so a later image instruction could reject an otherwise constant sampler. Fold the literal operand for either operation's scalar result.

A synthetic pixel program verifies the same four sampler dwords with literal moves, a literal bit reverse, and a literal complement. The old tracer refused the bit-reverse variant. On Linux, the full shader library suite passed (172 passed, two ignored), and the Windows MSVC-target check and asset policy passed. The native Windows shader suite also passed (216 passed, three ignored). I did not test a physical GPU or a title shader. Windows run

AI-assisted using Codex.

<!-- greyfinch-sync:fxceless/victory-fork:issue:6605564240 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/947). Originally posted by [avt0m4t48](https://github.com/avt0m4t48) on 2026-11-25T13:27:58Z. --- The descriptor tracer already folds inline operands for `s_brev_b32` and `s_not_b32`. The same scalar operations with a literal dword left the sampler word unresolved, so a later image instruction could reject an otherwise constant sampler. Fold the literal operand for either operation's scalar result. A synthetic pixel program verifies the same four sampler dwords with literal moves, a literal bit reverse, and a literal complement. The old tracer refused the bit-reverse variant. On Linux, the full shader library suite passed (172 passed, two ignored), and the Windows MSVC-target check and asset policy passed. The native Windows shader suite also passed (216 passed, three ignored). I did not test a physical GPU or a title shader. [Windows run](https://github.com/avt0m4t48/victory-fork/actions/runs/45627268771) AI-assisted using Codex.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/947:upstream-pr/947'
git switch 'upstream-pr/947'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/947'
git switch 'upstream-pr/947'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/947'
git switch 'upstream-pr/947'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/947'
git switch 'main'
git merge --squash 'upstream-pr/947'
git switch 'main'
git merge --ff-only 'upstream-pr/947'
git switch 'main'
git merge 'upstream-pr/947'
git push origin 'main'
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
fxceless/victory-fork!946
No description provided.