Repository navigation
startup: remove duplicate Pass render target bindings breaking Windows builds - #2706
Conversation
tedin7
left a comment
There was a problem hiding this comment.
Review of head ce4f081e: sound. This fixes the Windows build of main.
On main, struct Pass declares bound_targets[8] and bound_depth twice (lines 2504-2505 and 2508-2509), so the MSVC build of d3d12_xs_device.cpp fails. The PR removes the first, uncommented pair and keeps the documented one.
It also removes the first of two identical std::copy_n(targets, 8, pass.bound_targets); pass.bound_depth = dsv_target; pairs in list_targets (lines 3587-3588 and 3600-3601). Nothing in between reads pass.bound_targets or pass.bound_depth: only the trace copy, use_as_target, target_formats/target0, require_state and target_count run there. So keeping the later assignment does not change behavior. return before both copies still skips the update when nothing is bound.
Commands: git show origin/main:src/startup_stubs/d3d12_xs_device.cpp | grep -n -E 'bound_targets|bound_depth' (shows the duplicate pair and the duplicate assignment), gh pr diff 2706.
Win2025 dev + release on this head is running (--targets d3d12_xs_device_obj,d3d12_xs_shim,offscreen_check, the d3d12x/cpu_shim WARP tests). A receipt will follow.
AI-assisted; commands listed were executed locally.
|
Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit
Run after the merge as a check: the fixed device file builds in dev and release and the d3d12x/cpu_shim WARP tests pass. AI-assisted; commands listed were executed locally. |
Windows CI stopped building both
d3d12_xs_device_objandd3d12_xs_shimafter #2417 merged on top of #2448. MSVC reports C2086 forPass::bound_targetsandPass::bound_depthin both compilations. The four duplicate declarations are present on clean main ated53c1fe. Compiler outputKeep one copy of the eight slots and depth resource, with the comment documenting the last accepted bind. Both the pixel UAV overlap check and translated indirect draws read those same fields. The common bind path clears them on entry and populates them once when it accepts the binding. The optional trace array retains its own capture.
I compiled the two extracted field declarations from each revision and the actual clear/copy statements using Zig/Clang. The original fails for both duplicate members. The corrected program compiled and checked all eight distinct resources, depth, clearing the whole binding and rebinding depth only.
git diff --checkpassed. The upstream Windows check builds the complete D3D12 translation units with MSVC.Refs #2417, #2448 and #2704. AI-assisted using Codex (GPT-6.2 Astra, xhigh).