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
No Branch/Tag specified
main
codex/indirect-large-backed-views
codex/word3-preflight-check
codex/vertex-table-two-records
codex/live-index-alias
codex/copied-vertex-buffer-srv
codex/windows-stage-test-output
codex/preserve-live-srv-retirement
codex/share-render-target-tracking
codex/sgd5-negative-offset-fixture
coverage-dashboard
codex/mesh-loose-root
codex/mesh86-cache-padding
codex/xmem-scatter-preflight
codex/mesh-depth-ps
codex/indirect-dispatch-refresh
codex/compute-container-index
codex/startup-compute-formatted-load
codex/compute-indirect-producer
codex/compute-atomic-soffset
codex/mesh-dual-handoff
codex/startup-run-sh-watcher-control
codex/queue31-page-alias
codex/indexed-indirect-compute-root
codex/typed-buffer-view-metadata
codex/translated-indexed-address-alias
codex/fixed-mesh-create-result
codex/xmem-section-lease
codex/startup-slot86-mesh-cache
codex/restore-mesh-barrier-iteration
codex/translated-indirect-upload-index
codex/xapu-completion-opt-in
codex/translated-indexed-rect
codex/translated-indexed-indirect
codex/startup-mesh-lds-integration
codex/startup-console-ms24
codex/startup-slot57-mesh-request
codex/indirect-copy-provenance
codex/present-color-producer-trace
codex/compute-dispatch-binding-trace
codex/translated-indirect-table-buffers
codex/indirect-copy-provenance-base
codex/mix-half-literal-source
codex/translated-indirect-draw
codex/xmem-scatter-diagnostics
codex/slot148-recording-upload
codex/slot70-loading-art-verified
codex/command-list-upload-arena
codex/recover-failed-command-list
codex/startup-heap-timing-notes
codex/align-audio-input-timeline
codex/synthetic-depth-export-control
codex/startup-texture1d-on-windows
codex/1629-packed-position-fixture
codex/cpu-srv-refresh
codex/stream-root-srv-draw
codex/audio-mixer-timer
codex/startup-reload-published-shader
codex/priority-integrate-1284
codex/guest-sixteen-page-record
codex/aot-placed-dxr-batch
codex/guest-directory-selection
codex/gamesave-enumerate-read
codex/readme-archive-to-pixels
codex/pe-placed-view-draw
codex/archive-directory-gpu
codex/slot133-dxr-build
codex/materialize-placed-vertex-view
codex/dstorage-directory-offsets
codex/xg-nine-bc-copy
codex/xg-slot10-bc64-arrays
codex/dxr-guest-address-readback
codex/gpu-va-high-bits
codex/clarify-diagnostic-startup-scope
codex/xg-six-levels
codex/typed-derived-blend
codex/english-legal-text-progress
codex/address-bc-4ks
codex/dstorage-bounded-file-read
codex/wide-srv-offsets-menu
codex/startup-memory-srv
codex/bound-view-tail
codex/language-selector-readback
codex/setup-menu-progress
codex/cpu-plane-refresh
codex/startup-ubyte-vertex
codex/presenter-window-selection
codex/startup-uniform-buffer-lane
codex/intro-loop-timing
codex/static-clzero-loops
codex/document-rtx-intro
codex/startup-insertq
codex/nv12-startup-texture
codex/stream-stage-draw
codex/startup-null-uav-format
codex/startup-draw-capture
codex/shorten-windows-checks
codex/dstorage-rfc1950
codex/startup-dump-fence
codex/pr1135-review-base
codex/startup-stream-requests
codex/startup-chroma-view
codex/readme-graphics-pipeline-streams
codex/static-crt-free-tls
codex/arc-140t-rtx-5080-laptop-gpu-reports
codex/main-startup-progress-entry
codex/signed-dxil-catalogue
codex/reloc-free-preferred-base
codex/quad-dpp-bit-mask
codex/raw-srv-bounds
codex/rx9070-31044-hardware-report
codex/gpu-page-source-provenance
codex/runtime-placeholder-interior
codex/gpu-copy-queue-tile-order
codex/pe-pin-external-providers
codex/xmem-placeholder-reservations
codex/xmem-shared-physical-pages
codex/pe-package-startup
codex/xmem-tools-memory-query
codex/cpu-stack-output-import
codex/pe-load-security-cookie
codex/record-three-bvh-retests
codex/cpu-rbp-frame-anchor
codex/xmem-default-startup
codex/record-rtx-3050-ti-9597
codex/docs-readme-start-here
codex/check-compute-mad24-truncation
codex/docs-discord-community
codex/bound-rcx-branch-mutants
codex/rtx5060ti-bvh-62114
codex/837-neutral-readme-disclaimer
codex/record-rtx-3070-ti
codex/title-neutral-public-wording
codex/exe-shadow-frame-submissions
codex/exe-shadow-runtime-chain
codex/readme-polish
codex/gpu-coverage-nov23
codex/spirv-minlod
codex/shadow-shim-device
codex/exe-two-shadow-frames
codex/shim-dispatch-cleanup
codex/fix-spirv-cache-probe
codex/sampler-use
codex/ballot-bit-extract
codex/packed-fma-release
codex/cpu-packed-fma-o2
codex/publish-coverage-dashboard
codex/mesh-cbv-binding-order
codex/spirv-window-fixture
codex/ps-e32-float-uint
codex/ps-cbuffer-reads
codex/fixed-profile-rescan
codex/shim-compute-integration
codex/readme-visible-coverage
codex/readme-research-navigation
codex/integrate-pr-256
codex/indexed-mesh
codex/sampled-coverage
codex/first-ms
codex/dual-ps
codex/ps-attribute
codex/compute-first
codex/ps-export
codex/readme-research-status
codex/ps-layout
codex/blast-window
codex/chart-caption
codex/reviewer-roles
codex/blast-aot
codex/archive-program
codex/crc-stream-program
codex/exe-image-data-chain
codex/local-cpu-fixture-coverage
codex/exe-bound-frame-chain
codex/exe-mapped-comparison
codex/contribution-dependencies
codex/exe-entry-aot
codex/bink-frame-heap-integration
docs/hardware-seven-reports
codex/bink-custom-heap
codex/bink-heap-callers
codex/discussions-entry-points
codex/gpu-community-batch-64
codex/ffx-scratch-writers
codex/generic-project-documentation
codex/ffx-dispatch-rcas
codex/four-windows-gpu-reports
codex/title-neutral-project-wording
codex/community-coverage-provenance
codex/rcas-packed-texels
codex/community-gpu-retests
codex/community-build-and-gpu-reports
codex/ffx-provider-loop
codex/ffx-recurrent-views
codex/ffx-recurrent-resource
codex/amd-wave64-reports
codex/ffx-backend-slots
codex/upscaler-device-init
codex/ffx-context-lifecycle
codex/ffx-version-query
codex/ffx-provider-contract
codex/typed-object-callback
codex/cpu-ordinal-import
codex/chained-cpu-ranges
codex/cpu-import-call
codex/cpu-direct-call
codex/cpu-leaf-aot
codex/community-project-status
codex/script-state-path-replay
codex/script-state-evidence
codex/bc7-resident-tail
codex/bcpack-mip-tail
codex/bc7-texture-draw
codex/asset-ranges
codex/pixel-constants
codex/pixel-aot
codex/pre-exe-workloads
codex/root-signature-device-coverage
engineering/packed-bvh-leaves
engineering/bvh-build-and-update
engineering/intake-root-roundtrip
community/gpu-check-release
community/english-contributor-entry
gpu-check-v0.1.0
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Assignees
Clear assignees
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
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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)
What a pull request needs
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.
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.
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 desktopDEPTH_STENCIL/DEPTH_STENCIL1subobject from the pipeline stream. First I'll find where the console pipeline carries its register block in the stand-in. Then I'll decodeDB_DEPTH_CONTROL(Z enable and write, the compare function including GREATER, stencil enable and functions) plusDB_STENCILREFMASKfrom 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).
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.
state_aandstate_b, copied from title memory at creation (d3d12_capture.inl:22,:118,:120).CB_BLENDn_CONTROLwords at +0xD0 in block A (#1216,state_block_blend.h). NoDB_*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.d3d12_draw.inl:365-370already 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).
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_CONTROLwords from #1216. A decoder now exists in a local build: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.ClearDepthStencilViewis forwarded.GREATER_EQUALthe 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:
stream_translation.Does that work for you? If you'd rather do the whole item, I'll post the word positions here instead.
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.
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_translationremain open for the claimant. Rasteriser state (item B) is not in it.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:
I'll start once #2124 has settled, so the interface doesn't move underneath.
AI-assisted (Claude Code).
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.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.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T01:42:17Z.
Update: Item D appears already covered on
mainvia #1430 (slot 50 DSV bind) andtests/startup_stream_depth_check.py, so we are skipping Item D and continuing only with Item F.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.
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.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). WithX2W_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.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_CNTLwould 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.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).
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.
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.
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.
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.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.
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
ff0000ffon the simultaneous UNORM target.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.
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.
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.
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. Buildstartup_stream_rasterizer, then runctest --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.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_CNTLword index: I've put up the decode logic only, in #2480.PA_SU_SC_MODE_CNTLvalue 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.FACE0 is taken as counter-clockwise front, as in radeonsi. The function also takes aflip_windingswitch, because that convention is not established against the D3D12 viewport.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.