help wanted: GPU translation, part 3 (render state and indirect draws) #1992

Open
opened 2026-11-24 22:51:49 +00:00 by denn0x · 26 comments
denn0x commented 2026-11-24 22:51:49 +00:00 (Migrated from github.com)
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by denn0x on 2026-11-24T22:51:49Z.


The startup runtime draws translated pipelines with a default fixed-function state. Once more geometry is drawn (ExecuteIndirect #1759, mesh programs #1760), the picture depends on the state the console pipeline itself carries. These pieces are independent; each can be one pull request with a source-built fixture.

Pieces (pick one, say so in a comment)

Item Piece Notes
A Decode depth / stencil state from the pipeline register block and apply it to the desktop pipeline state Depth enable, write enable, compare function (including reversed-Z use of GREATER), stencil ops. Behind a switch that is off by default until a run has exercised it.
B Decode rasteriser state: cull mode, front-face winding, polygon offset Same pattern.
C Command-list depth-stencil clear The call is a no-op in the stand-in today, so a depth test would fail everywhere after the first frame.
D Depth-stencil target binding for translated draws Check that a bound depth target reaches the desktop command list together with the colour targets, including depth-only passes (no colour target, no pixel stage). On WARP a mesh pipeline without a pixel stage removed the device in a local test, so that case needs a hardware fixture or a capability skip.
E Indirect Draw / DrawIndexed with console-only primitive topologies Rect lists and other topologies without a desktop equivalent need a conversion step that works with GPU-written argument buffers. Extends #1759 / #1909.
F Render-target variants for pixel stages that write integer or 32-bit float targets A pixel stage translated for a four-channel UNORM target cannot be bound to an integer target without a variant.

What a pull request needs

  • A source-built fixture with pixel or depth read-back on WARP (and on hardware where WARP cannot run it, reported separately), plus a negative control that fails when the piece is disabled.
  • Default behaviour unchanged when the switch is off; say how that was checked.
  • The register fields cited from the public gfx10 register headers (Mesa) in the commit message.

Where this comes from

Observed on a private executable (no bytes, keys, addresses or logs can be shared): with the default state, the geometry that does draw appears unordered and untextured, and most indirect draws are refused for their topology.

Related: #1759, #1760, #1909, #1916.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6593005980 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1999). Originally posted by [denn0x](https://github.com/denn0x) on 2026-11-24T22:51:49Z. --- The startup runtime draws translated pipelines with a default fixed-function state. Once more geometry is drawn (ExecuteIndirect #1759, mesh programs #1760), the picture depends on the state the console pipeline itself carries. These pieces are independent; each can be one pull request with a source-built fixture. ## Pieces (pick one, say so in a comment) | Item | Piece | Notes | |---|---|---| | A | Decode depth / stencil state from the pipeline register block and apply it to the desktop pipeline state | Depth enable, write enable, compare function (including reversed-Z use of GREATER), stencil ops. Behind a switch that is off by default until a run has exercised it. | | B | Decode rasteriser state: cull mode, front-face winding, polygon offset | Same pattern. | | C | Command-list depth-stencil clear | The call is a no-op in the stand-in today, so a depth test would fail everywhere after the first frame. | | D | Depth-stencil target binding for translated draws | Check that a bound depth target reaches the desktop command list together with the colour targets, including depth-only passes (no colour target, no pixel stage). On WARP a mesh pipeline without a pixel stage removed the device in a local test, so that case needs a hardware fixture or a capability skip. | | E | Indirect Draw / DrawIndexed with console-only primitive topologies | Rect lists and other topologies without a desktop equivalent need a conversion step that works with GPU-written argument buffers. Extends #1759 / #1909. | | F | Render-target variants for pixel stages that write integer or 32-bit float targets | A pixel stage translated for a four-channel UNORM target cannot be bound to an integer target without a variant. | ## What a pull request needs - A source-built fixture with pixel or depth read-back on WARP (and on hardware where WARP cannot run it, reported separately), plus a negative control that fails when the piece is disabled. - Default behaviour unchanged when the switch is off; say how that was checked. - The register fields cited from the public gfx10 register headers (Mesa) in the commit message. ## Where this comes from Observed on a private executable (no bytes, keys, addresses or logs can be shared): with the default state, the geometry that does draw appears unordered and untextured, and most indirect draws are refused for their topology. Related: #1759, #1760, #1909, #1916.
R0Y00 commented 2026-11-25 01:01:50 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T23:04:28Z.


Item C already has an implementation in #1806. Please continue there, with the remaining check focused on restoring the bound read-only DSV and preserving the command-list state. Item D can still be taken separately. A useful first slice is one source-built raster pass with a bound depth target plus a second pass whose result changes when the depth binding is omitted. Check pixels and debug-layer messages after the fence. Keep depth-only mesh as a follow-up if its adapter capability differs, and report a capability skip separately. Item E can build on the landed desktop record fixtures in #1759 and should keep a console-topology conversion and its negative control distinct.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7146982138 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1999#issuecomment-7146982138). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-24T23:04:28Z. --- Item C already has an implementation in #1806. Please continue there, with the remaining check focused on restoring the bound read-only DSV and preserving the command-list state. Item D can still be taken separately. A useful first slice is one source-built raster pass with a bound depth target plus a second pass whose result changes when the depth binding is omitted. Check pixels and debug-layer messages after the fence. Keep depth-only mesh as a follow-up if its adapter capability differs, and report a capability skip separately. Item E can build on the landed desktop record fixtures in #1759 and should keep a console-topology conversion and its negative control distinct.
JB2WIN commented 2026-11-25 01:01:53 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by JB2WIN on 2026-11-24T23:15:00Z.


I'll take item A, depth/stencil state, starting with the decode. Today stream_translation (d3d12_draw.inl) copies only a desktop DEPTH_STENCIL/DEPTH_STENCIL1 subobject from the pipeline stream. First I'll find where the console pipeline carries its register block in the stand-in. Then I'll decode DB_DEPTH_CONTROL (Z enable and write, the compare function including GREATER, stencil enable and functions) plus DB_STENCILREFMASK from the field layout in Mesa's public gfx10 register headers, and apply it behind a switch that is off by default. Evidence will be a WARP fixture with depth readback, together with a negative control where the switch is off. If the register block turns out not to be reachable from the stand-in, I'll report that here instead of guessing.

AI-assisted (Claude Code).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7147185187 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1999#issuecomment-7147185187). Originally posted by [JB2WIN](https://github.com/JB2WIN) on 2026-11-24T23:15:00Z. --- I'll take item A, depth/stencil state, starting with the decode. Today `stream_translation` (`d3d12_draw.inl`) copies only a desktop `DEPTH_STENCIL`/`DEPTH_STENCIL1` subobject from the pipeline stream. First I'll find where the console pipeline carries its register block in the stand-in. Then I'll decode `DB_DEPTH_CONTROL` (Z enable and write, the compare function including GREATER, stencil enable and functions) plus `DB_STENCILREFMASK` from the field layout in Mesa's public gfx10 register headers, and apply it behind a switch that is off by default. Evidence will be a WARP fixture with depth readback, together with a negative control where the switch is off. If the register block turns out not to be reachable from the stand-in, I'll report that here instead of guessing. AI-assisted (Claude Code).
JB2WIN commented 2026-11-25 01:01:53 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by JB2WIN on 2026-11-24T23:17:17Z.


Item A, first finding. Nothing is built yet, because the register offset would have to be guessed.

  • Where the block comes from. Slot-57 pipelines carry two raw state blocks, state_a and state_b, copied from title memory at creation (d3d12_capture.inl:22, :118, :120).
  • What is known about its layout. The only measured position is the eight CB_BLENDn_CONTROL words at +0xD0 in block A (#1216, state_block_blend.h). No DB_* register (DB_DEPTH_CONTROL, DB_STENCIL_CONTROL, DB_STENCILREFMASK) is documented or measured anywhere in the repository, and it is not established that the blocks carry them at all.
  • Existing logging. d3d12_draw.inl:365-370 already logs the first 0x1a0 bytes of both blocks for the first 24 pipelines when no blend is found.

Has anyone located the DB words in block A or B, as #1216 did for blend? If not, I'll measure it locally from my own run, using that existing hex log, and match the words against Mesa's gfx10 field layouts. Only the offsets and the field interpretation would go into the PR, never the bytes. Until then the decode would rest on an assumed offset, which item A shouldn't.

AI-assisted (Claude Code).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7147228463 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1999#issuecomment-7147228463). Originally posted by [JB2WIN](https://github.com/JB2WIN) on 2026-11-24T23:17:17Z. --- Item A, first finding. Nothing is built yet, because the register offset would have to be guessed. - **Where the block comes from.** Slot-57 pipelines carry two raw state blocks, `state_a` and `state_b`, copied from title memory at creation (`d3d12_capture.inl:22`, `:118`, `:120`). - **What is known about its layout.** The only measured position is the eight `CB_BLENDn_CONTROL` words at +0xD0 in block A (#1216, `state_block_blend.h`). No `DB_*` register (`DB_DEPTH_CONTROL`, `DB_STENCIL_CONTROL`, `DB_STENCILREFMASK`) is documented or measured anywhere in the repository, and it is not established that the blocks carry them at all. - **Existing logging.** `d3d12_draw.inl:365-370` already logs the first 0x1a0 bytes of both blocks for the first 24 pipelines when no blend is found. Has anyone located the DB words in block A or B, as #1216 did for blend? If not, I'll measure it locally from my own run, using that existing hex log, and match the words against Mesa's gfx10 field layouts. Only the offsets and the field interpretation would go into the PR, never the bytes. Until then the decode would rest on an assumed offset, which item A shouldn't. AI-assisted (Claude Code).
denn0x commented 2026-11-25 01:01:59 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by denn0x on 2026-11-24T23:54:32Z.


Yes. The depth-stencil and rasteriser registers were located locally in block A, next to the CB_BLENDn_CONTROL words from #1216. A decoder now exists in a local build:

  • Decoded: DB_DEPTH_CONTROL, DB_STENCIL_CONTROL, DB_STENCILREFMASK(_BF), PA_SU_SC_MODE_CNTL (cull, face, polygon offset enables) and the polygon offset scale and offset words. Field layouts follow Mesa's gfx10 register JSON.
  • Behind switches, all off by default: it is applied to translated draws, and command-list ClearDepthStencilView is forwarded.
  • Aggregate over about 25,000 pipeline state sets from a private executable: depth tested in just over half of them (almost all of the mesh pipelines), reversed-Z GREATER_EQUAL the most common compare, back-face culling the most common cull mode, and no word the decoder has to refuse.

To avoid two implementations, I'd suggest splitting it:

  • Mine: a PR with the pure decoder and a device-free check that uses hand-made register words, plus a negative control for a shifted offset.
  • Yours, if you want it: the WARP depth-readback fixture with the switch on and off, applying the decoded state to stream_translation.

Does that work for you? If you'd rather do the whole item, I'll post the word positions here instead.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7147926995 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1999#issuecomment-7147926995). Originally posted by [denn0x](https://github.com/denn0x) on 2026-11-24T23:54:32Z. --- Yes. The depth-stencil and rasteriser registers were located locally in block A, next to the `CB_BLENDn_CONTROL` words from #1216. A decoder now exists in a local build: - **Decoded:** `DB_DEPTH_CONTROL`, `DB_STENCIL_CONTROL`, `DB_STENCILREFMASK(_BF)`, `PA_SU_SC_MODE_CNTL` (cull, face, polygon offset enables) and the polygon offset scale and offset words. Field layouts follow Mesa's gfx10 register JSON. - **Behind switches,** all off by default: it is applied to translated draws, and command-list `ClearDepthStencilView` is forwarded. - **Aggregate over about 25,000 pipeline state sets from a private executable:** depth tested in just over half of them (almost all of the mesh pipelines), reversed-Z `GREATER_EQUAL` the most common compare, back-face culling the most common cull mode, and no word the decoder has to refuse. To avoid two implementations, I'd suggest splitting it: - **Mine:** a PR with the pure decoder and a device-free check that uses hand-made register words, plus a negative control for a shifted offset. - **Yours, if you want it:** the WARP depth-readback fixture with the switch on and off, applying the decoded state to `stream_translation`. Does that work for you? If you'd rather do the whole item, I'll post the word positions here instead.
R0Y00 commented 2026-11-25 01:02:02 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-25T00:08:48Z.


The split in the latest reply is a good fit. Please keep the pure depth/stencil decoder and its source-built register-word controls together. Link that PR here so the existing item A claimant can build the real draw fixture on the same decoder interface.

For the draw fixture, use synthetic shader inputs and two overlapping triangles with unequal depths. Show the expected winner with reversed-Z and the different result with the switch disabled or the compare direction intentionally wrong. Check the stencil result separately with a known reference and include the original desktop state fallback. Reuse the same renderer on WARP and hardware. Keep raster bias and extra forwarding cases in their existing scope so either part can be reviewed independently.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7148197000 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1999#issuecomment-7148197000). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-25T00:08:48Z. --- The split in the latest reply is a good fit. Please keep the pure depth/stencil decoder and its source-built register-word controls together. Link that PR here so the existing item A claimant can build the real draw fixture on the same decoder interface. For the draw fixture, use synthetic shader inputs and two overlapping triangles with unequal depths. Show the expected winner with reversed-Z and the different result with the switch disabled or the compare direction intentionally wrong. Check the stencil result separately with a known reference and include the original desktop state fallback. Reuse the same renderer on WARP and hardware. Keep raster bias and extra forwarding cases in their existing scope so either part can be reviewed independently.
denn0x commented 2026-11-25 01:02:09 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by denn0x on 2026-11-25T00:54:13Z.


The decoder offered above is up as #2124: the pure depth-stencil decode from the slot 57 state block plus a device-free check with a shifted-offset control. It does not apply the state to draws and adds no read-back fixture, so item A's WARP fixture and the application in stream_translation remain open for the claimant. Rasteriser state (item B) is not in it.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7149007628 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1999#issuecomment-7149007628). Originally posted by [denn0x](https://github.com/denn0x) on 2026-11-25T00:54:13Z. --- The decoder offered above is up as #2124: the pure depth-stencil decode from the slot 57 state block plus a device-free check with a shifted-offset control. It does not apply the state to draws and adds no read-back fixture, so item A's WARP fixture and the application in `stream_translation` remain open for the claimant. Rasteriser state (item B) is not in it.
JB2WIN commented 2026-11-25 02:02:04 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by JB2WIN on 2026-11-25T01:07:21Z.


Thanks, @denn0x. I'll build item A's application and the draw fixture on top of #2124's decoder interface, as described above:

  • two overlapping triangles with unequal depths and synthetic shader inputs;
  • the reversed-Z winner, plus the different result with the switch off or the compare direction wrong;
  • a separate stencil check against a known reference;
  • the original desktop-state fallback;
  • the same renderer on WARP and hardware.

I'll start once #2124 has settled, so the interface doesn't move underneath.

AI-assisted (Claude Code).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7149227872 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1999#issuecomment-7149227872). Originally posted by [JB2WIN](https://github.com/JB2WIN) on 2026-11-25T01:07:21Z. --- Thanks, @denn0x. I'll build item A's application and the draw fixture on top of #2124's decoder interface, as described above: - two overlapping triangles with unequal depths and synthetic shader inputs; - the reversed-Z winner, plus the different result with the switch off or the compare direction wrong; - a separate stencil check against a known reference; - the original desktop-state fallback; - the same renderer on WARP and hardware. I'll start once #2124 has settled, so the interface doesn't move underneath. AI-assisted (Claude Code).
R0Y00 commented 2026-11-25 02:02:05 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-25T01:13:50Z.


The slot 57 decoder is on main via #2124 (f4752176). I independently compiled it with MSVC /O2, checked all 35 synthetic assertions, and confirmed the shifted-offset counterexample failed. The original bit fields match the Mesa gfx10 register table. The item A draw claimant can now build against this header. Its depth-bounds and unequal front/back flag states still need an explicit fallback or refusal in that integration; the decoder alone does not apply them to draws.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7149336893 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1999#issuecomment-7149336893). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-25T01:13:50Z. --- The slot 57 decoder is on main via #2124 (f4752176). I independently compiled it with MSVC /O2, checked all 35 synthetic assertions, and confirmed the shifted-offset counterexample failed. The original bit fields match the Mesa gfx10 register table. The item A draw claimant can now build against this header. Its depth-bounds and unequal front/back flag states still need an explicit fallback or refusal in that integration; the decoder alone does not apply them to draws.
tedin7 commented 2026-11-25 02:02:07 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T01:40:57Z.


Picking up Item D (depth-stencil target binding for translated draws, including depth-only) and Item F (integer / 32-bit float render-target variants) as two separate PRs with D3D12 WARP readback tests.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7149832740 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1999#issuecomment-7149832740). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T01:40:57Z. --- Picking up Item D (depth-stencil target binding for translated draws, including depth-only) and Item F (integer / 32-bit float render-target variants) as two separate PRs with D3D12 WARP readback tests.
tedin7 commented 2026-11-25 02:02:08 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T01:42:17Z.


Update: Item D appears already covered on main via #1430 (slot 50 DSV bind) and tests/startup_stream_depth_check.py, so we are skipping Item D and continuing only with Item F.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7149858876 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1999#issuecomment-7149858876). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T01:42:17Z. --- Update: Item D appears already covered on `main` via #1430 (slot 50 DSV bind) and `tests/startup_stream_depth_check.py`, so we are skipping Item D and continuing only with Item F.
tedin7 commented 2026-11-25 03:01:24 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T02:47:30Z.


Picking up Item E (indirect Draw/DrawIndexed with console-only primitive topologies) with unit + D3D12 WARP readback tests.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7151191999 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1999#issuecomment-7151191999). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T02:47:30Z. --- Picking up Item E (indirect Draw/DrawIndexed with console-only primitive topologies) with unit + D3D12 WARP readback tests.
R0Y00 commented 2026-11-25 04:04:18 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-25T03:19:31Z.


For item E, #2180 merged at a2010c91. Slot 61 now reports forwarded calls and refusal counts by signature kind with the render heartbeat. On WARP and RTX 4060 Laptop the source-built checks passed 7/7, including a wrong-count control and separate graphics-pipeline, compute-pipeline, and placeholder refusals. A rerun can now identify where calls stopped. Keep the existing rectangle-list and GPU-counted command work separate from these counters.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7151807570 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1999#issuecomment-7151807570). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-25T03:19:31Z. --- For item E, #2180 merged at `a2010c91`. Slot 61 now reports forwarded calls and refusal counts by signature kind with the render heartbeat. On WARP and RTX 4060 Laptop the source-built checks passed 7/7, including a wrong-count control and separate graphics-pipeline, compute-pipeline, and placeholder refusals. A rerun can now identify where calls stopped. Keep the existing rectangle-list and GPU-counted command work separate from these counters.
R0Y00 commented 2026-11-25 04:04:19 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-25T03:35:48Z.


Item A's first draw-path slice has merged in #2169 (009153b7). With X2W_DEPTH_STATE=1, supported slot 57 state drives the depth/stencil draw and restores the caller's stencil reference afterward. The mixed-pipeline readback passed on WARP and RTX 4060 Laptop, including Reset back to zero. Removing the restore made the next stencil draw blue instead of green on both adapters. The switch is opt-in. Keep rasterizer state and the other render-state items separate.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7152061614 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1999#issuecomment-7152061614). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-25T03:35:48Z. --- Item A's first draw-path slice has merged in #2169 (`009153b7`). With `X2W_DEPTH_STATE=1`, supported slot 57 state drives the depth/stencil draw and restores the caller's stencil reference afterward. The mixed-pipeline readback passed on WARP and RTX 4060 Laptop, including Reset back to zero. Removing the restore made the next stencil draw blue instead of green on both adapters. The switch is opt-in. Keep rasterizer state and the other render-state items separate.
RavenCurseBurg commented 2026-11-25 06:01:36 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by RavenCurseBurg on 2026-11-25T05:24:52Z.


For item B, I can take a source-built culling and front-face winding readback on WARP. Before implementing the slot-57 integration, is anyone already publishing that part of the local rasterizer decoder mentioned above? A public decoder branch or the block-A word index for PA_SU_SC_MODE_CNTL would let me reuse the same layout. The fixture can use synthetic register words and two triangles with opposite winding, checking the result for front cull, back cull and the default switch setting. #1567 covers the slot-86 stream subobject; here the input would be the slot-57 register block. Polygon offset can stay a separate slice.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7153746313 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1999#issuecomment-7153746313). Originally posted by [RavenCurseBurg](https://github.com/RavenCurseBurg) on 2026-11-25T05:24:52Z. --- For item B, I can take a source-built culling and front-face winding readback on WARP. Before implementing the slot-57 integration, is anyone already publishing that part of the local rasterizer decoder mentioned [above](https://github.com/R0Y00/Xbox2Windows/issues/1999#issuecomment-7147926995)? A public decoder branch or the block-A word index for `PA_SU_SC_MODE_CNTL` would let me reuse the same layout. The fixture can use synthetic register words and two triangles with opposite winding, checking the result for front cull, back cull and the default switch setting. #1567 covers the slot-86 stream subobject; here the input would be the slot-57 register block. Polygon offset can stay a separate slice.
RavenCurseBurg commented 2026-11-25 08:05:04 +00:00 (Migrated from github.com)
Author
Contributor

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


Item B now has a runnable desktop cull/winding reference. One draw submits two mirrored triangles over an 8×4 target. The six combinations of no/front/back culling and clockwise/counterclockwise front faces each matched all 32 expected pixels on WARP and a physical D3D12 adapter. Ignoring either cull setting, swapping front/back culling, or reversing the front-face convention each changed the readback as expected. The hosted WARP run builds the same source and runs the same cases.

This pins the desktop reference for integration. The runtime dependency is still the location of the rasterizer word inside the slot-57 state block; the reference explicitly sets the desktop PSO fields.

AI-assisted (Codex, GPT-6.2 Astra xhigh).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7155408099 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1999#issuecomment-7155408099). Originally posted by [RavenCurseBurg](https://github.com/RavenCurseBurg) on 2026-11-25T07:01:39Z. --- Item B now has a [runnable desktop cull/winding reference](https://github.com/RavenCurseBurg/Xbox2Windows/blob/9f8d0c69/tests/raster_winding_reference.py). One draw submits two mirrored triangles over an 8×4 target. The six combinations of no/front/back culling and clockwise/counterclockwise front faces each matched all 32 expected pixels on WARP and a physical D3D12 adapter. Ignoring either cull setting, swapping front/back culling, or reversing the front-face convention each changed the readback as expected. The [hosted WARP run](https://github.com/RavenCurseBurg/Xbox2Windows/actions/runs/45564134993) builds the same source and runs the same cases. This pins the desktop reference for integration. The runtime dependency is still the location of the rasterizer word inside the slot-57 state block; the reference explicitly sets the desktop PSO fields. AI-assisted (Codex, GPT-6.2 Astra xhigh).
R0Y00 commented 2026-11-25 09:04:12 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-25T08:17:11Z.


Thanks for the six-way cull and winding reference. Please turn that source-built reference into a focused fixture PR if you are up for it. Keep the opposite-winding triangles, the full 8×4 readback and the three mutation controls. Run it on WARP and hardware with the debug layer, and record the adapter, driver, and command. This gives the slot 57 integration an independent desktop reference. Leave the guest register location out of the fixture until it is independently established. #1567 covers the separate slot 86 stream path.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7156838351 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1999#issuecomment-7156838351). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-25T08:17:11Z. --- Thanks for the [six-way cull and winding reference](https://github.com/R0Y00/Xbox2Windows/issues/1999#issuecomment-7155408099). Please turn that source-built reference into a focused fixture PR if you are up for it. Keep the opposite-winding triangles, the full 8×4 readback and the three mutation controls. Run it on WARP and hardware with the debug layer, and record the adapter, driver, and command. This gives the slot 57 integration an independent desktop reference. Leave the guest register location out of the fixture until it is independently established. #1567 covers the separate slot 86 stream path.
RavenCurseBurg commented 2026-11-25 09:04:12 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by RavenCurseBurg on 2026-11-25T08:19:35Z.


I’ll turn the desktop rasterizer reference into a focused fixture PR. I’ll keep the opposite-winding triangles, six PSO combinations, the complete 8×4 image and the mutation controls, and record which adapter and driver actually ran with the debug layer enabled. The fixture will use only desktop PSO state.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7156886949 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1999#issuecomment-7156886949). Originally posted by [RavenCurseBurg](https://github.com/RavenCurseBurg) on 2026-11-25T08:19:35Z. --- I’ll turn the desktop rasterizer reference into a focused fixture PR. I’ll keep the opposite-winding triangles, six PSO combinations, the complete 8×4 image and the mutation controls, and record which adapter and driver actually ran with the debug layer enabled. The fixture will use only desktop PSO state.
RavenCurseBurg commented 2026-11-25 09:04:12 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by RavenCurseBurg on 2026-11-25T08:34:57Z.


The desktop fixture is up in #2260. It reports the adapter and driver and checks 6/6/12/12 differing pixels for the four wrong states. WARP with the debug layer and the physical RTX 4060 both produced all six full images. The RTX host has no Graphics Tools debug layer, so a run of the two documented CTests on a physical adapter with the layer enabled would complete the requested evidence.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7157216016 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1999#issuecomment-7157216016). Originally posted by [RavenCurseBurg](https://github.com/RavenCurseBurg) on 2026-11-25T08:34:57Z. --- The desktop fixture is up in #2260. It reports the adapter and driver and checks 6/6/12/12 differing pixels for the four wrong states. WARP with the debug layer and the physical RTX 4060 both produced all six full images. The RTX host has no Graphics Tools debug layer, so a run of the two documented CTests on a physical adapter with the layer enabled would complete the requested evidence.
R0Y00 commented 2026-11-25 14:05:09 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-25T13:29:01Z.


The rectangle-list indirect Draw path landed in #2173 (214ed093). The Windows fixture compares a full image on WARP and RTX 4060 Laptop, including distinct scratch for concurrent submissions. The shared-scratch mutation was detected, and a live compute root binding is still refused. This covers the rectangle-list conversion; the other draw families and title-side evidence remain open here.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7163842212 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1999#issuecomment-7163842212). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-25T13:29:01Z. --- The rectangle-list indirect Draw path landed in #2173 (`214ed093`). The Windows fixture compares a full image on WARP and RTX 4060 Laptop, including distinct scratch for concurrent submissions. The shared-scratch mutation was detected, and a live compute root binding is still refused. This covers the rectangle-list conversion; the other draw families and title-side evidence remain open here.
RavenCurseBurg commented 2026-11-25 15:01:58 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by RavenCurseBurg on 2026-11-25T14:06:21Z.


I will measure the narrow RGBA8 integer targets left open by #2148, formats 30 (UINT) and 32 (SINT). The source-built fixture will use distinct in-range and out-of-range channel words, compare saturation with low-byte truncation, and verify the independently typed UNORM target. I will report FXC/DXC on WARP and RTX 4060, with an explicit distinction between the translated desktop result and native guest hardware.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7164764189 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1999#issuecomment-7164764189). Originally posted by [RavenCurseBurg](https://github.com/RavenCurseBurg) on 2026-11-25T14:06:21Z. --- I will measure the narrow RGBA8 integer targets left open by #2148, formats 30 (UINT) and 32 (SINT). The source-built fixture will use distinct in-range and out-of-range channel words, compare saturation with low-byte truncation, and verify the independently typed UNORM target. I will report FXC/DXC on WARP and RTX 4060, with an explicit distinction between the translated desktop result and native guest hardware.
RavenCurseBurg commented 2026-11-25 15:01:59 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by RavenCurseBurg on 2026-11-25T14:22:48Z.


The RGBA8 measurement is complete; implementation and regression tests are in #2378. I compared translated pixel shaders with independently compiled typed HLSL on local RTX 4060, local WARP, and Windows Server 2025 WARP, using FXC and DXC for each. All 36 comparisons matched the saturated CPU reference on the integer target and ff0000ff on the simultaneous UNORM target.

Input channel words (hex) UINT bytes SINT bytes Low eight bits
ffffffff ffffff80 00000080 00000100 ffff80ff ff807f7f ff808000
ffffff7f 0000007f 00000002 000000fe ff7f02fe 807f027f 7f7f02fe
00000000 00000001 0000007f 00000042 00017f42 00017f42 00017f42

The source-built comparison and hosted WARP debug-layer results are public. The evidence establishes desktop output-merger behavior on these two views. Native console readback is still outstanding.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7165187508 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1999#issuecomment-7165187508). Originally posted by [RavenCurseBurg](https://github.com/RavenCurseBurg) on 2026-11-25T14:22:48Z. --- The RGBA8 measurement is complete; implementation and regression tests are in #2378. I compared translated pixel shaders with independently compiled typed HLSL on local RTX 4060, local WARP, and Windows Server 2025 WARP, using FXC and DXC for each. All 36 comparisons matched the saturated CPU reference on the integer target and `ff0000ff` on the simultaneous UNORM target. | Input channel words (hex) | UINT bytes | SINT bytes | Low eight bits | | --- | --- | --- | --- | | ffffffff ffffff80 00000080 00000100 | ffff80ff | ff807f7f | ff808000 | | ffffff7f 0000007f 00000002 000000fe | ff7f02fe | 807f027f | 7f7f02fe | | 00000000 00000001 0000007f 00000042 | 00017f42 | 00017f42 | 00017f42 | The [source-built comparison](https://github.com/RavenCurseBurg/Xbox2Windows/commit/f816ef0bee387e61a7c9ef71b32bea4e77537199) and [hosted WARP debug-layer results](https://github.com/RavenCurseBurg/Xbox2Windows/actions/runs/45630892855) are public. The evidence establishes desktop output-merger behavior on these two views. Native console readback is still outstanding.
RavenCurseBurg commented 2026-11-25 15:02:00 +00:00 (Migrated from github.com)
Author
Contributor

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


I’ll take a stream-path winding follow-up for item B now that #1567 has landed. Its synthetic triangle distinguishes front from back culling, but its test currently accepts either ordering of the two images and always sets FrontCounterClockwise to false. I’ll check the exact 8×4 image for each cull direction, toggle the winding bit on both RASTERIZER and RASTERIZER1, and verify the test detects a swapped cull or ignored winding field. This exercises the translated slot-86 stream in addition to the desktop reference from #2260.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7165608871 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1999#issuecomment-7165608871). Originally posted by [RavenCurseBurg](https://github.com/RavenCurseBurg) on 2026-11-25T14:39:11Z. --- I’ll take a stream-path winding follow-up for item B now that #1567 has landed. Its synthetic triangle distinguishes front from back culling, but its test currently accepts either ordering of the two images and always sets FrontCounterClockwise to false. I’ll check the exact 8×4 image for each cull direction, toggle the winding bit on both RASTERIZER and RASTERIZER1, and verify the test detects a swapped cull or ignored winding field. This exercises the translated slot-86 stream in addition to the desktop reference from #2260.
RavenCurseBurg commented 2026-11-25 15:02:01 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by RavenCurseBurg on 2026-11-25T14:47:33Z.


For item F I’m measuring the remaining narrow integer RTVs together after #2378: single- and two-channel 8/16-bit views, RGBA16, and the mixed-width R10G10B10A2_UINT view. I’ll compare source-built exports with independently compiled typed HLSL, check the destination bytes and simultaneous UNORM target, and distinguish per-channel saturation from discarded high bits. I’ll record any unsupported view or adapter separately before proposing changes.

Completed in #2392. All 198 translated/direct comparisons matched, including 132 where the low-bit shader gave different bytes; the remaining 66 were in-range controls. The exact PR head passed all three focused Windows Server WARP tests, with 22 narrow-target readbacks across FXC and DXC. Independent measurement and exact-head tests.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7165821486 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1999#issuecomment-7165821486). Originally posted by [RavenCurseBurg](https://github.com/RavenCurseBurg) on 2026-11-25T14:47:33Z. --- For item F I’m measuring the remaining narrow integer RTVs together after #2378: single- and two-channel 8/16-bit views, RGBA16, and the mixed-width R10G10B10A2_UINT view. I’ll compare source-built exports with independently compiled typed HLSL, check the destination bytes and simultaneous UNORM target, and distinguish per-channel saturation from discarded high bits. I’ll record any unsupported view or adapter separately before proposing changes. Completed in #2392. All 198 translated/direct comparisons matched, including 132 where the low-bit shader gave different bytes; the remaining 66 were in-range controls. The exact PR head passed all three focused Windows Server WARP tests, with 22 narrow-target readbacks across FXC and DXC. [Independent measurement](https://github.com/RavenCurseBurg/Xbox2Windows/actions/runs/45638660640) and [exact-head tests](https://github.com/RavenCurseBurg/Xbox2Windows/actions/runs/45640373343).
R0Y00 commented 2026-11-25 16:05:22 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-25T15:11:43Z.


The item B stream winding follow-up landed in #2387 (a4900150). My Windows Release run passed 4/4 on WARP and RTX 4060 Laptop with the debug layer enabled. The fixture checked all 32 pixels with both cull directions, both windings, and both rasterizer subobject types. Build startup_stream_rasterizer, then run ctest --preset release --no-tests=error -j 1 -R '^startup_stream_rasterizer(_ignore)?_(hardware|warp)$' -V. Item F stays open for the remaining typed views you are measuring.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7166453460 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1999#issuecomment-7166453460). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-25T15:11:43Z. --- The item B stream winding follow-up landed in #2387 (`a4900150`). My Windows Release run passed 4/4 on WARP and RTX 4060 Laptop with the debug layer enabled. The fixture checked all 32 pixels with both cull directions, both windings, and both rasterizer subobject types. Build `startup_stream_rasterizer`, then run `ctest --preset release --no-tests=error -j 1 -R '^startup_stream_rasterizer(_ignore)?_(hardware|warp)$' -V`. Item F stays open for the remaining typed views you are measuring.
denn0x commented 2026-11-25 19:04:11 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by denn0x on 2026-11-25T18:01:48Z.


On item B and the question about the PA_SU_SC_MODE_CNTL word index: I've put up the decode logic only, in #2480.

  • What it does: a pure function turns a PA_SU_SC_MODE_CNTL value into D3D12 cull, front-face winding and fill mode, and refuses the forms D3D12 can't express. It comes with a device-free synthetic fixture and three wrong-field controls.
  • What it leaves out: where a slot 57 pipeline keeps that word. The index we use locally is our own measurement and has not been independently established, so following the guidance above, we are not publishing it. The caller passes the register value in. Once the location is established independently, the slot 57 integration can feed this function from it.
  • Winding: FACE 0 is taken as counter-clockwise front, as in radeonsi. The function also takes a flip_winding switch, because that convention is not established against the D3D12 viewport.
  • Polygon offset: left as a separate slice.
<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7170338604 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1999#issuecomment-7170338604). Originally posted by [denn0x](https://github.com/denn0x) on 2026-11-25T18:01:48Z. --- On item B and the question about the `PA_SU_SC_MODE_CNTL` word index: I've put up the decode logic only, in #2480. - **What it does:** a pure function turns a `PA_SU_SC_MODE_CNTL` value into D3D12 cull, front-face winding and fill mode, and refuses the forms D3D12 can't express. It comes with a device-free synthetic fixture and three wrong-field controls. - **What it leaves out:** where a slot 57 pipeline keeps that word. The index we use locally is our own measurement and has not been independently established, so following the guidance above, we are not publishing it. The caller passes the register value in. Once the location is established independently, the slot 57 integration can feed this function from it. - **Winding:** `FACE` 0 is taken as counter-clockwise front, as in radeonsi. The function also takes a `flip_winding` switch, because that convention is not established against the D3D12 viewport. - **Polygon offset:** left as a separate slice.
R0Y00 commented 2026-11-25 21:01:29 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-25T20:16:04Z.


The standalone PA_SU_SC_MODE_CNTL decoder landed in #2480 (53a7d10e). Its four Windows Release checks cover cull, fill and winding, including the invalid-mode controls. Item B still needs independent evidence for where the runtime record stores the word and which winding the viewport requires. A source-built front/back pair with a swapped-winding negative control can separate those two questions before wiring the decoder into slot 57.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7173418547 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1999#issuecomment-7173418547). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-25T20:16:04Z. --- The standalone PA_SU_SC_MODE_CNTL decoder landed in #2480 (`53a7d10e`). Its four Windows Release checks cover cull, fill and winding, including the invalid-mode controls. Item B still needs independent evidence for where the runtime record stores the word and which winding the viewport requires. A source-built front/back pair with a swapped-winding negative control can separate those two questions before wiring the decoder into slot 57.
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#1992
No description provided.