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

Manually merged
github merged 1 commit from gh-pr/2706/head into gh-pr/2706/base 2026-11-27 01:16:52 +00:00
Owner

@⁠RavenCurseBurg on GitHub · 2026-11-26 02:56 UTC · original
RavenCurseBurg:fix/shared-bound-render-target-members → main · +0 −4 · 1 files · 1 commits · merged 2026-11-26 02:59 UTC

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).

**@⁠RavenCurseBurg** on GitHub · 2026-11-26 02:56 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2706) `RavenCurseBurg:fix/shared-bound-render-target-members` → `main` · +0 −4 · 1 files · 1 commits · merged 2026-11-26 02:59 UTC 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](https://github.com/R0Y00/Xbox2Windows/actions/runs/45745104983/job/139659120059) 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).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 01:16:50 +00:00
github manually merged commit ce4f081e0b into gh-pr/2706/base 2026-11-27 01:16:52 +00:00
Author
Owner

@⁠tedin7 on GitHub · 2026-11-26 02:59 UTC · original · reviewed

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** on GitHub · 2026-11-26 02:59 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2706#pullrequestreview-6067959750) · **reviewed** 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.
Author
Owner

@⁠tedin7 on GitHub · 2026-11-26 03:03 UTC · original

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.

**@⁠tedin7** on GitHub · 2026-11-26 03:03 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2706#issuecomment-7181362852) 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.
This discussion has been locked. Commenting is limited to contributors.
No description provided.