Skip to content

startup: remove duplicate Pass render target bindings breaking Windows builds - #2706

Merged
tedin7 merged 1 commit into
R0Y00:mainfrom
RavenCurseBurg:fix/shared-bound-render-target-members
Nov 26, 2026
Merged

tedin7 merged 1 commit into
R0Y00:mainfrom
RavenCurseBurg:fix/shared-bound-render-target-members

Conversation

@RavenCurseBurg

Copy link
Copy Markdown
Contributor

Windows CI stopped building both d3d12_xs_device_obj and d3d12_xs_shim after #2417 merged on top of #2448. MSVC reports C2086 for Pass::bound_targets and Pass::bound_depth in both compilations. The four duplicate declarations are present on clean main at ed53c1fe. Compiler output

Keep 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 --check passed. 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).

@tedin7 tedin7 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@tedin7
tedin7 merged commit c452959 into R0Y00:main Nov 26, 2026
5 checks passed
@tedin7

tedin7 commented Nov 26, 2026

Copy link
Copy Markdown
Collaborator

Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit ce4f081e0b031fbbebbaf940e338532a72369abc:

  • Debug (--preset dev):
    • Build (cmake --build --preset dev --target d3d12_xs_device_obj d3d12_xs_shim offscreen_check -- -j 2): 53.08s (configure 3.11s)
    • Test (ctest --preset dev -R '^(d3d12x_.*_warp|cpu_shim_.*_warp|cpu_native_shim_startup)$' --parallel 2 --no-tests=error --output-on-failure): 18/18 passed (13.49s: cpu_shim_upload_texture_warp 4.82s, cpu_shim_shadow_warp 5.79s, cpu_shim_chain_warp 3.71s, cpu_shim_draw_warp 4.79s, cpu_shim_compute_warp 2.87s, cpu_native_shim_startup 1.93s, d3d12x_descriptor_heap_warp 0.07s, d3d12x_descriptor_table_warp 0.06s, d3d12x_compute_list_warp 0.08s, d3d12x_graphics_list_warp 0.09s, d3d12x_device_create_warp 0.09s, d3d12x_descriptor_negative_warp 0.07s, d3d12x_pso_reject_warp 0.06s, d3d12x_device_struct_return_neither_control_warp 0.07s, d3d12x_pso_static_sampler_warp 0.06s, d3d12x_device_struct_return_warp 0.06s, cpu_shim_texture_reuse_warp 1.85s, d3d12x_device_negative_warp 0.04s)
  • Release /O2 (--preset release):
    • Build (cmake --build --preset release --target d3d12_xs_device_obj d3d12_xs_shim offscreen_check -- -j 2): 146.73s (configure 2.77s)
    • Test (ctest --preset release -R '^(d3d12x_.*_warp|cpu_shim_.*_warp|cpu_native_shim_startup)$' --parallel 2 --no-tests=error --output-on-failure): 18/18 passed (14.16s: cpu_shim_upload_texture_warp 4.71s, cpu_shim_shadow_warp 6.70s, cpu_shim_chain_warp 3.78s, cpu_shim_draw_warp 4.58s, cpu_shim_compute_warp 2.93s, cpu_shim_texture_reuse_warp 2.03s, cpu_native_shim_startup 2.20s, d3d12x_compute_list_warp 0.08s, d3d12x_graphics_list_warp 0.09s, d3d12x_descriptor_heap_warp 0.05s, d3d12x_descriptor_table_warp 0.10s, d3d12x_descriptor_negative_warp 0.07s, d3d12x_device_struct_return_neither_control_warp 0.07s, d3d12x_pso_static_sampler_warp 0.07s, d3d12x_device_create_warp 0.11s, d3d12x_device_struct_return_warp 0.06s, d3d12x_pso_reject_warp 0.06s, d3d12x_device_negative_warp 0.03s)
  • sccache: 764/905 hits; wall 235.9s

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants