shader: lower masked pixel resource-selection loops in the direct DXIL frontend #3212

Closed
opened 2026-11-27 21:49:48 +00:00 by github-bot · 4 comments
Owner

@⁠R0Y00 on GitHub · 2026-11-27 21:47 UTC · original

Refs #2413 and #3074. The fixed mesh pixel path needs safe control flow when EXEC-partitioned resource selection introduces backward SCC edges. Existing projections cover forward arms. Keep explicit refusals for loops whose resource identity, forward progress, active lanes, or scalar values at exit cannot be established.

Use a source-built gfx1013 fixture with lanes selecting distinct descriptors, repeated indices, an empty arm, and an implicit-LOD sample whose helper lane matters. Validate generated DXIL, read back color against independent expected values, and add a negative control for an unproven backedge or side effect. Report exception cases and any hardware-only validation. PR target: main.

**@⁠R0Y00** on GitHub · 2026-11-27 21:47 UTC · [original](https://github.com/R0Y00/Xbox2Windows/issues/3210) Refs #2413 and #3074. The fixed mesh pixel path needs safe control flow when EXEC-partitioned resource selection introduces backward SCC edges. Existing projections cover forward arms. Keep explicit refusals for loops whose resource identity, forward progress, active lanes, or scalar values at exit cannot be established. Use a source-built gfx1013 fixture with lanes selecting distinct descriptors, repeated indices, an empty arm, and an implicit-LOD sample whose helper lane matters. Validate generated DXIL, read back color against independent expected values, and add a negative control for an unproven backedge or side effect. Report exception cases and any hardware-only validation. PR target: `main`.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 21:49:48 +00:00
Author
Owner

@⁠RonLogic on GitHub · 2026-11-27 23:23 UTC · original

I’ll take this on main. I’ll start from a source-built bounded resource-selection loop with repeated indices and an empty selection, then verify its direct DXIL and fenced colors on the RTX 4070 and WARP. The helper-lane witness will use an implicit gradient, and the refusal control will exercise a backedge without a proven decrease in the pending mask.

**@⁠RonLogic** on GitHub · 2026-11-27 23:23 UTC · [original](https://github.com/R0Y00/Xbox2Windows/issues/3210#issuecomment-7230098147) I’ll take this on `main`. I’ll start from a source-built bounded resource-selection loop with repeated indices and an empty selection, then verify its direct DXIL and fenced colors on the RTX 4070 and WARP. The helper-lane witness will use an implicit gradient, and the refusal control will exercise a backedge without a proven decrease in the pending mask.
Author
Owner

@⁠RonLogic on GitHub · 2026-11-27 23:46 UTC · original

The fixed-mesh heap path is already implemented in #3091. I verified its a48d39dc compiler with a separate source-built shader. Mixed and empty selections passed for both guest widths on RTX 4070 and WARP, and the helper-only coordinate control selected the wrong mip at (6,0) on both, as intended. The no-progress backedge was refused.

I reported one additional edge case and a tested guard in the #3091 review. The guard rejects implicit samples whose outputs can overwrite a later iteration's gradient inputs. I also have a verified bound-table variant on main for ordinary pixel shaders with a small finite SRV key. I’m keeping that change local while #3091 is open since both touch the same lowering.

**@⁠RonLogic** on GitHub · 2026-11-27 23:46 UTC · [original](https://github.com/R0Y00/Xbox2Windows/issues/3210#issuecomment-7230395381) The fixed-mesh heap path is already implemented in #3091. I verified its `a48d39dc` compiler with a separate source-built shader. Mixed and empty selections passed for both guest widths on RTX 4070 and WARP, and the helper-only coordinate control selected the wrong mip at (6,0) on both, as intended. The no-progress backedge was refused. I reported one additional edge case and a tested guard in [the #3091 review](https://git.gtahub.st/github/R0Y00--Xbox2Windows/pulls/3091). The guard rejects implicit samples whose outputs can overwrite a later iteration's gradient inputs. I also have a verified bound-table variant on `main` for ordinary pixel shaders with a small finite SRV key. I’m keeping that change local while #3091 is open since both touch the same lowering.
Author
Owner

@⁠Leyukaka on GitHub · 2026-11-28 21:39 UTC · original

@⁠RonLogic, #3091 merged at 13:48 UTC. Is the bound-table variant for ordinary pixel shaders that you kept local still coming? If you have dropped it, I can take it.

**@⁠Leyukaka** on GitHub · 2026-11-28 21:39 UTC · [original](https://github.com/R0Y00/Xbox2Windows/issues/3210#issuecomment-7246178529) @⁠RonLogic, #3091 merged at 13:48 UTC. Is the bound-table variant for ordinary pixel shaders that you kept local still coming? If you have dropped it, I can take it.
github-bot 2026-11-30 03:52:15 +00:00
Author
Owner

@⁠Leyukaka on GitHub · 2026-12-02 05:33 UTC · original

@⁠RonLogic, there has been no reply to my 11-28 question, so I took the remaining bound-table variant for ordinary pixel shaders: #3825

It reuses the #3091 waterfall detector and accepts a descriptor load from a bound root table. The fixed-mesh heap path is unchanged. The PR includes the DXIL checks, the refusals and a color readback on WARP and hardware with repeated and empty selections and an implicit-LOD sample.

If you still have your local version, I'm happy to compare the two or to add any case yours covers and mine does not.

**@⁠Leyukaka** on GitHub · 2026-12-02 05:33 UTC · [original](https://github.com/R0Y00/Xbox2Windows/issues/3210#issuecomment-7336056338) @⁠RonLogic, there has been no reply to my 11-28 question, so I took the remaining bound-table variant for ordinary pixel shaders: #3825 It reuses the #3091 waterfall detector and accepts a descriptor load from a bound root table. The fixed-mesh heap path is unchanged. The PR includes the DXIL checks, the refusals and a color readback on WARP and hardware with repeated and empty selections and an implicit-LOD sample. If you still have your local version, I'm happy to compare the two or to add any case yours covers and mine does not.
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#3212
No description provided.