Repository navigation
startup: bind single-range RTVs, clear copied views, count unresolved - #1701
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour 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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d23d8a6e1c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
…, count unresolved handles
OMSetRenderTargets with RTsSingleHandleToDescriptorRange true is expanded at the title descriptor stride (one handle or several) instead of being dropped silently. ClearRenderTargetView reads the view through its shadow record, so a copied descriptor clears its resource. Render target and depth handles that hold no view are logged and counted in the x2w-render totals line. Adds startup_rtv_bind_{warp,hardware}; syntax-checked with MinGW only, not run on a desktop device.
e56f2ea to
9f20c57
Compare
|
Independently verified 9f20c57 in Windows Release. The RTV binder, packed-target draw and heap-indexed root checks passed 6/6 across WARP and RTX 4060 Laptop, no skips. Refused original and copied RTVs remain unbound; valid copied RTVs clear and read back as expected. This covers the shadow-view materialization finding. |
What
OMSetRenderTargets(command-list slot 50):RTsSingleHandleToDescriptorRange=TRUEis no longer dropped silently. The first handle is expanded at the title's descriptor stride (title_descriptor_stride), for a count of one and for several, with explicit 64-bit handle-overflow protection. Before,targets_boundstayed false and every later draw on the list was skipped.x2w-render totalsnow reportstarget binds N (unresolved M).ClearRenderTargetView(slot 52) resolves the view withresolve_view(desktop, 20)(which already falls back toview_target(desktop, 20)when no shadow record exists), so a descriptor copied withCopyDescriptors*clears the resource it now holds while a slot overwritten with a null RTV cannot resurrect a staleview_targetsentry.list_clear_targetmoved belowresolve_viewfor that, otherwise unchanged.startup_rtv_bind_{warp,hardware}(tests/startup_rtv_bind.cpp, no draw): bind forms (array, single range with 1 and 2 handles, count 0 with null handles, count above 8, range reaching an empty view, empty view alone, clear on an empty view) checked through the newx2w_d3d12_render_target_statsexport, then a view copied withCopyDescriptorsSimple, cleared red and read back.docs/startup-runtime.mdanddocs/experiments.md.Verification
Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit
d23d8a6e1c356809517783de87a9d447143f0631:--preset dev):cmake --build --preset dev --target d3d12_xs_shim startup_rtv_bind startup_stream_consumer startup_stub_consumer startup_stub_acphal startup_stub_chad startup_stub_gameinput startup_stub_xapu startup_stub_xcrdapi startup_stub_xg_xs d3d12x_graphics_list_check -- -j 6(3.66s)ctest --preset dev -R '^(startup_rtv_bind_warp|startup_stream_draw_warp|startup_stream_viewport_warp|startup_stubs|d3d12x_graphics_list_warp)$' --parallel 4 --no-tests=error --output-on-failure: 5/5 passed (3.25s:d3d12x_graphics_list_warp0.06s,startup_rtv_bind_warp0.07s,startup_stubs0.47s,startup_stream_viewport_warp1.07s,startup_stream_draw_warp3.17s)/O2(--preset release):cmake --build --preset release --target d3d12_xs_shim startup_rtv_bind startup_stream_consumer startup_stub_consumer startup_stub_acphal startup_stub_chad startup_stub_gameinput startup_stub_xapu startup_stub_xcrdapi startup_stub_xg_xs d3d12x_graphics_list_check -- -j 6(1.16s)ctest --preset release -R '^(startup_rtv_bind_warp|startup_stream_draw_warp|startup_stream_viewport_warp|startup_stubs|d3d12x_graphics_list_warp)$' --parallel 4 --no-tests=error --output-on-failure: 5/5 passed (3.10s:startup_rtv_bind_warp0.07s,d3d12x_graphics_list_warp0.06s,startup_stubs0.59s,startup_stream_viewport_warp1.13s,startup_stream_draw_warp3.02s)if (!list || single_range) return;inlist_targetscausedstartup_rtv_bind_warpto fail at step 2 (2 single range, count 1: binds +0 (expected +1)).git diff --check origin/main...HEAD,tests/docs_links_check.py(17 files / 365 links),tests/bidi_controls_check.py(1288 files): clean.Behavior changes to review: a depth pointer whose handle maps to no descriptor still binds no depth, now with a count and a log line; a count above 8 is now counted and logged (still refused). The
single_rangestride comes from the RTV increment of the device; if no device is known the bind is refused and counted.Not covered: physical hardware adapters (
*_hardware), and the draw-level effect of a single-range bind (a pixel check after a draw).AI-assisted; commands listed were executed locally.