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

Closed
opened 2026-11-25 16:39:28 +00:00 by RavenCurseBurg · 0 comments
RavenCurseBurg commented 2026-11-25 16:39:28 +00:00 (Migrated from github.com)
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by RavenCurseBurg on 2026-11-25T16:39:28Z.


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).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6609129233 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/2435). Originally posted by [RavenCurseBurg](https://github.com/RavenCurseBurg) on 2026-11-25T16:39:28Z. --- 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).
Sign in to join this conversation.
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#2427
No description provided.