d3d12_xs: wire slot 50 DSV binding, view_slot<21> tracking, and stream PSO depth-stencil #1423
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1430"
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 tedin7 on 2026-11-24T11:22:38Z.
Implements GPU-1A from proven console ABI facts:
AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T11:38:55Z.
Review: COMMENTED
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:
7dbe516170ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T11:40:13Z.
Review: CHANGES_REQUESTED
The DSV registry needs to preserve view kind and flags. Slot 50 resolves the depth handle in the same untyped registry as RTV handles, then always requests DEPTH_WRITE, including for a read-only DSV. Validate DSV versus RTV on lookup and either model read-only planes or explicitly refuse them. Also check the trailing DepthBoundsTestEnable on DEPTH_STENCIL1: copying the base fields alone silently drops the bounds test. Please add source-built controls for those cases.
Independent Windows Release at
7dbe516: the six stream/MRT regressions passed. Both new depth tests failed on RTX 4060 Laptop and WARP with D3D12 diagnostic 679 in the count-zero pass: the pixel shader declares RTV 0 even though the pass binds no color target. Please use a depth-only shader for that control and retain the debug-layer assertion.Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T11:47:25Z.
Review: COMMENTED
No description provided.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T11:47:27Z.
Review: COMMENTED
No description provided.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T11:47:29Z.
Review: COMMENTED
No description provided.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T11:58:07Z.
Review: CHANGES_REQUESTED
At
1a36111the previous wrong-kind and depth-bounds controls are present. Windows Release still reports D3D12 warning 679 for the zero-RTV pass on both WARP and RTX 4060 Laptop, so both new depth CTests fail and the six older stream/MRT draws pass. Please make the depth-only PSO stop declaring SV_Target0 and retain the assertion on warning severity.Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T11:29:07Z.
Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit
7dbe5161:--preset dev):ctest --preset dev -R '^(startup_stream_depth_warp|startup_stream_draw_warp|startup_cb_blend_warp|startup_mrt_fxc_warp|startup_mrt_dxc_warp)$' --no-tests=error --output-on-failure— 5/5 passed (4.89s)/O2(--preset release):ctest --preset release -R '^(startup_stream_depth_warp|startup_stream_draw_warp|startup_cb_blend_warp|startup_mrt_fxc_warp|startup_mrt_dxc_warp)$' --no-tests=error --output-on-failure— 5/5 passed (4.96s)Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T11:29:17Z.
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
7dbe516ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T11:47:33Z.
@R0Y00 Addressed in
1a361114(Win2025 WARP Debug and Release /O2: startup_stream_depth, startup_stream_draw, startup_cb_blend, startup_mrt_fxc, startup_mrt_dxc 5/5 pass each).Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T11:38:55Z.
Code review location:
src/startup_stubs/d3d12_xs_device.cpp; line 1756When a depth texture is bound through a
D3D12_DSV_FLAG_READ_ONLY_DEPTHDSV with depth writes disabled and is also sampled by the pixel shader, this unconditionally requestsDEPTH_WRITE. The SRV handling indraw_translated()then replaces that state with onlyPIXEL_SHADER_RESOURCE, while the DSV remains bound. The resulting draw lacks the requiredDEPTH_READstate and violates D3D12 resource-state requirements. Track the DSV flags and preserveDEPTH_READ | PIXEL_SHADER_RESOURCEfor this valid simultaneous-use case.Useful? React with 👍 / 👎.
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T11:38:55Z.
Code review location:
src/startup_stubs/d3d12_xs_device.cpp; line 1743When a guest copies DSV A over a descriptor previously created for resource B using device slots 23 or 24,
copy_descriptor_run()updates the desktop descriptor andnote_copy()updates its shadow ID, but neither updatesview_targets(). This lookup therefore still returns B: the code transitions B toDEPTH_WRITEwhile binding the copied descriptor for A, leaving the actual depth resource untransitioned. Copying into a fresh destination instead produces no target and skips depth-only passes. Resolve the resource through the current shadow record or propagate target tracking during descriptor copies.Useful? React with 👍 / 👎.
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T11:38:55Z.
Code review location:
tests/startup_stream_depth.cpp; line 186For
startup_stream_depth_hardware, the fixture selects an adapter but never reports its identity or driver; the Python wrapper ultimately prints only debug messages and the backend/result summary. Unlike the existingprepare_stream_pipeline()helper, this path therefore produces GPU evidence that cannot be attributed to the selected adapter, especially on multi-GPU systems.AGENTS.mdrequires GPU reports to identify the adapter, driver, Windows build, commit, and debug-layer status, so emit and preserve that metadata with these results.AGENTS.md reference: AGENTS.md:L95-L96
Useful? React with 👍 / 👎.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T11:47:25Z.
Code review location:
src/startup_stubs/d3d12_xs_device.cpp; line 1756Fixed in
1a361114: DSV flags are read from the view record; a read-only depth view binds as DEPTH_READ, and a draw that samples the same texture keeps DEPTH_READ|PIXEL_SHADER_RESOURCE (sampled_state).Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T11:47:27Z.
Code review location:
src/startup_stubs/d3d12_xs_device.cpp; line 1743Fixed in
1a361114: the DSV (and RTV) is resolved from the descriptor's current shadow record, which note_copy carries across CopyDescriptors/CopyDescriptorsSimple, instead of the creation-time handle map.Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T11:47:29Z.
Code review location:
tests/startup_stream_depth.cpp; line 186Fixed in
1a361114: startup_stream_depth prints adapter, vendor/device ids and driver version, which the check script preserves in its output.Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T12:30:22Z.
Review: APPROVED
Re-reviewed this exact revision. Windows Release stream depth and adjacent stream/MRT checks passed 8/8 on RTX and WARP. The depth-only shader no longer emits an RTV output, and the read-only depth, invalid view-role, and bounds controls remain covered.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T12:18:27Z.
@R0Y00 Fixed in
addc99c2: the depth-only PSO now uses a pixel shader that exports nothing, so it no longer declares SV_Target0 for the zero-RTV pass. The translator (tools/startup/gfx2hlsl.py) emits a void main for an export-less pixel shader. The warning-severity assertion in startup_stream_depth_check.py is unchanged. Win2025 (MSVC, D3D12 WARP): Debug (--preset dev) and Release /O2 (--preset release) both pass startup_stream_depth_warp and startup_stream_depth_hardware, 2/2 each. The VM has only WARP, so the _hardware test also ran on WARP there and the RTX 4060 Laptop result still needs your run. AI-assisted; commands listed were executed locally.Imported from R0Y00/Xbox2Windows. Originally posted by thepatrickworld on 2026-11-24T12:20:09Z.
Measured
addc99c2merged onto03d4c69d(my mergedfb441a1, treee67ec184, working tree clean), Windows 11 25H2 (26200.9974), DXC 1.9.2602.17.startup_stream_depth_hardwareandstartup_stream_depth_warpboth passed, three runs out of three:adapter=AMD Radeon RX 9070 XT vendor=1002 device=7550 driver=32.0.32029.2010adapter=Microsoft Basic Render Driver vendor=1414 device=008c driver=10.0.26100.9818With all three readbacks reported on the hardware backend:
So the depth path holds on real hardware (AMD RX 9070 XT), not just WARP, including the
DepthEnable=FALSEnegative control and thecount == 0depth-only pass.For context on the intermediate step:
883bc706(the PS-less depth-only PSO) failed three runs out of three on both backends — the depth-only readback came back red on the left half (ff0000ff× 16) instead of all clear, so the far quad was no longer occluded. WARP failing too is what made it a fixture/shim question rather than an adapter one. The export-less pixel shader in the current head passes on both.Your own verification and the CI both stay on WARP (
_hardware$is excluded), so as far as I can see in this thread this is the first real-adapter run of the entry.One limitation, so the result is not read as more than it is: the D3D12 debug layer is not installed on this machine (
0x887a002d, SDK component missing; the Graphics Tools optional feature is absent and its install is refused from my remote session with0x80070005). Thex2w-d3d12-debug sev=[012]assertion therefore had nothing to inspect. What passed is the pixel path — exact bytes on all three readbacks — not API validation.Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T12:23:04Z.
Thanks @thepatrickworld for testing
addc99c2on physical AMD Radeon RX 9070 XT hardware (3/3 pass across all three depth readbacks, including theDepthEnable=FALSEcontrol andcount=0depth-only pass). Together with the Win2025 WARP runs (where the D3D12 debug layer is active and checked for zerosev=[012]messages), both the real-adapter pixel path and API validation are now covered.Imported from R0Y00/Xbox2Windows. Originally posted by ChazY11 on 2026-11-24T12:53:28Z.
The depth negative control is genuinely sensitive — verified by forcing
DepthEnable = TRUEIndependent reviewer, not the author. Reviewed
addc99c2; nothing pushed to the branch. The mutation below was madelocally, rebuilt, reverted; working tree is clean.
Environment: Windows 11 build 26300.9974, MSVC 14.44.35207, SDK 10.0.26100, DXC 1.8.2502.11, RTX 5080 Laptop
(32.0.15.8142) for the
hardwarevariant, in-box WARP 10.0.26100.9818 forwarp.Unmodified branch — 4 of 4 pass, with the intended line on both backends:
and
startup_stream_draw_{warp,hardware}still reports the same 32-pixel and swapped-shader numbers, so the PSO cachekey change did not disturb the existing draws.
Mutation —
DepthEnableforced on after the DEPTH_STENCIL copyBoth fail. That is the property I wanted to check: the
DepthEnable=FALSEcase is not passing by accident, it reallydepends on the decoded subobject reaching
pso_for. A negative control that stayed green here would have meant thecase was testing something else.
One practical note from doing this: the recompile of
d3d12_xs_device.cpp(which pulls in the.inl) is what makes themutation take effect, and the
x2w-draw desktop pipeline ... (dsv %d, depth %d)line you added is exactly what made itpossible to confirm the fault reached the pipeline. Please keep that line.
Limits of my run
The
hardwarevariant selects the first non-software adapter throughX2W_SHIM_DRAW_ADAPTER, so on this machine it isthe NVIDIA RTX, not an Intel adapter — no Intel datapoint from me here.
Verdict
Reviewed
addc99c2. Build clean, both new cases pass on WARP and on a physical adapter, the existing stream draws areunchanged, and the depth negative control fails when the decoded state is forced. No objection from me.