shader: constant-buffer-dependent s_cbranch_scc1 always takes the target in bounded mesh lowering #2435

Closed
opened 2026-11-27 00:51:49 +00:00 by github-bot · 0 comments
Owner

@⁠RavenCurseBurg on GitHub · 2026-11-25 16:39 UTC · original

At b442b57f, the bounded mesh lowerer treats a constant-buffer-dependent SCC as always true for s_cbranch_scc1. Wave.exec_range joins the two possible descriptor arms only for s_cbranch_scc0. The SCC1 path evaluates the Python predicate object as a boolean at translation time.

I reproduced this with the source program in tests/mesh_join_descriptor_check.py. I reversed the two descriptor arms and changed the branch to s_cbranch_scc1, which should preserve its output. The two alternatives read vertex depth 0.5 (visible) or 1.625 (clipped), depending on a constant-buffer selector. All eight baseline SCC0 readbacks matched on a GeForce RTX 4060 and Windows WARP (traced/untraced, selectors 0 and 1). SCC1 matched with selector 0. With selector 1, both adapters rendered the triangle instead of clipping it: all 1,024 pixels differed and the traced run also reported a mesh export mismatch.

I’ll fix the branch direction in the existing bounded join and extend the source-built descriptor test for both predicates, including the resulting clipped image and vertex depth. This is separate from #2434, which handles a concrete SCC used as an explicit instruction operand.

AI-assisted with Codex + GPT-6.2 Astra (xhigh).

**@⁠RavenCurseBurg** on GitHub · 2026-11-25 16:39 UTC · [original](https://github.com/R0Y00/Xbox2Windows/issues/2435) At `b442b57f`, the bounded mesh lowerer treats a constant-buffer-dependent SCC as always true for `s_cbranch_scc1`. `Wave.exec_range` joins the two possible descriptor arms only for `s_cbranch_scc0`. The SCC1 path evaluates the Python predicate object as a boolean at translation time. I reproduced this with the source program in `tests/mesh_join_descriptor_check.py`. I reversed the two descriptor arms and changed the branch to `s_cbranch_scc1`, which should preserve its output. The two alternatives read vertex depth 0.5 (visible) or 1.625 (clipped), depending on a constant-buffer selector. All eight baseline SCC0 readbacks matched on a GeForce RTX 4060 and Windows WARP (traced/untraced, selectors 0 and 1). SCC1 matched with selector 0. With selector 1, both adapters rendered the triangle instead of clipping it: all 1,024 pixels differed and the traced run also reported a mesh export mismatch. I’ll fix the branch direction in the existing bounded join and extend the source-built descriptor test for both predicates, including the resulting clipped image and vertex depth. This is separate from #2434, which handles a concrete SCC used as an explicit instruction operand. AI-assisted with Codex + GPT-6.2 Astra (xhigh).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 00:51:49 +00:00
This discussion has been locked. Commenting is limited to contributors.
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.

Dependencies

No dependencies set

Reference
github/R0Y00--Xbox2Windows#2435
No description provided.