experimental: shader: lower wave32 compare-mask consumers (draft, do not merge) #3895

Open
SimSalabimse wants to merge 18 commits from upstream-pr/3895 into main
SimSalabimse commented 2026-12-02 23:21:09 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by SimSalabimse on 2026-12-02T23:21:09Z.


Draft, do not merge. Experimental piece of the native graphics path work (getting the native shader path to draw real frames). Do not merge until it has been tested on the Windows test PC.

What it changes

Wave32 compare-mask consumers in the native lowering (src/gfx1013_direct_graphics.inl, src/gfx1013_compute_native.cpp). An odd SGPR compare mask is now accepted when every read of it is one of:

  • a v_cndmask_b32 of that SGPR,
  • an s_and_saveexec_b32 whose EXEC is restored by an s_mov_b32 or s_or_b32,
  • an s_and_b32 with EXEC or with another mask, ahead of that restore.

A b64 consumer of the same mask stays refused. The control script tests/native_cmp_mask_dest_check.py is extended for these shapes.

Dependencies

This branch is stacked. It is 18 commits ahead of main: the 17 below the top commit are the staged native path work that is not on main yet (diagnostics, fixed pixel entry layouts, pixel EXEC arms, vertex fetch before a scalar branch, and an earlier odd-SGPR compare mask commit). Only the top commit, "Lower the three remaining compare-mask consumers", is new in this PR, so review that commit alone. The branch does not merge cleanly into current main (conflict in src/direct_compute_cache.cpp from the stack) and will be rebased once the stack below it has landed.

Tests

None yet. This has not been built or run through ctest, DXC, WARP or hardware. Planned: native_cmp_mask_dest_*, then native_direct_container, native_execz_join_mask_*, native_graphics_vertex_vcc_join_*, native_pixel_exec_arms, native_pixel_entry_* and startup_ngg_slice, one GPU test at a time.

Not measured: whether any title shader reaches the newly accepted shapes in a real run.

AI-assisted (Cursor)

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:5616503557 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3895). Originally posted by [SimSalabimse](https://github.com/SimSalabimse) on 2026-12-02T23:21:09Z. --- Draft, do not merge. Experimental piece of the native graphics path work (getting the native shader path to draw real frames). Do not merge until it has been tested on the Windows test PC. ## What it changes Wave32 compare-mask consumers in the native lowering (`src/gfx1013_direct_graphics.inl`, `src/gfx1013_compute_native.cpp`). An odd SGPR compare mask is now accepted when every read of it is one of: - a `v_cndmask_b32` of that SGPR, - an `s_and_saveexec_b32` whose EXEC is restored by an `s_mov_b32` or `s_or_b32`, - an `s_and_b32` with EXEC or with another mask, ahead of that restore. A b64 consumer of the same mask stays refused. The control script `tests/native_cmp_mask_dest_check.py` is extended for these shapes. ## Dependencies This branch is stacked. It is 18 commits ahead of `main`: the 17 below the top commit are the staged native path work that is not on `main` yet (diagnostics, fixed pixel entry layouts, pixel EXEC arms, vertex fetch before a scalar branch, and an earlier odd-SGPR compare mask commit). Only the top commit, "Lower the three remaining compare-mask consumers", is new in this PR, so review that commit alone. The branch does not merge cleanly into current `main` (conflict in `src/direct_compute_cache.cpp` from the stack) and will be rebased once the stack below it has landed. ## Tests None yet. This has not been built or run through ctest, DXC, WARP or hardware. Planned: `native_cmp_mask_dest_*`, then `native_direct_container`, `native_execz_join_mask_*`, `native_graphics_vertex_vcc_join_*`, `native_pixel_exec_arms`, `native_pixel_entry_*` and `startup_ngg_slice`, one GPU test at a time. Not measured: whether any title shader reaches the newly accepted shapes in a real run. AI-assisted (Cursor)
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/3895:upstream-pr/3895'
git switch 'upstream-pr/3895'

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/3895'
git switch 'upstream-pr/3895'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/3895'
git switch 'upstream-pr/3895'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/3895'
git switch 'main'
git merge --squash 'upstream-pr/3895'
git switch 'main'
git merge --ff-only 'upstream-pr/3895'
git switch 'main'
git merge 'upstream-pr/3895'
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
R0Y00/Xbox2Windows!3895
No description provided.