tests: bind resource description before GetCopyableFootprints so clang-cl builds the fixture #3938

Manually merged
github merged 1 commit from github-bot/gh-3936 into gh-pr/3936/base 2026-12-03 14:01:50 +00:00 AGit
Owner

@⁠triggered02 on GitHub · 2026-12-03 13:44 UTC · original
triggered02:fix/indirect-fixture-temporary-address → main · +2 −1 · 1 files · 1 commits · merged 2026-12-03 13:59 UTC

ID3D12Resource::GetDesc returns D3D12_RESOURCE_DESC by value, so

device->GetCopyableFootprints(&texture->GetDesc(), 0, 1, 0, &footprint, nullptr, nullptr, &bytes);

took the address of a temporary. That is a Microsoft extension, and clang-cl rejects it outright:

error: taking the address of a temporary object of type 'D3D12_RESOURCE_DESC' [-Waddress-of-temporary]

Which means the documented clang-cl + xwin cross-compile in docs/non-windows-hosts.md could not build the startup_indirect_draw_indexed test executable at all. MSVC accepts it, so Windows CI never saw it.

Change: bind the description to a named local and pass &desc — the minimal fix, and the pattern this file already uses elsewhere.

Tree-wide check. A scan of tests/ and src/ for any call taken by address (&…Get*() and other getters, regex (?<!&)&(?!&)\s*[A-Za-z_][\w.->:]*\s*\([^;\n]*\)) found this as the only genuine temporary-address site; every other hit returns a reference (own(), fence(), back(), front(), __uuidof) or is a bitwise &.

Verified — Debian, clang-cl 19.1.7, xwin SDK 10.0.26100 splat, main 4567a71a:

before: cmake --build out/build/clang --target startup_indirect_draw_indexed
        -> FAILED: error: taking the address of a temporary object ...
after:  -> [6/6] Linking CXX executable startup_indirect_draw_indexed.exe

No /W4 /WX workaround was needed; the four remaining diagnostics are pre-existing -Wdeprecated-declarations warnings.

Not established: no MSVC host here, so the MSVC side is unchanged-by-inspection (it accepted the old form, and a named local is not a behaviour change). Windows CI is the check.

**@⁠triggered02** on GitHub · 2026-12-03 13:44 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3936) `triggered02:fix/indirect-fixture-temporary-address` → `main` · +2 −1 · 1 files · 1 commits · merged 2026-12-03 13:59 UTC `ID3D12Resource::GetDesc` returns `D3D12_RESOURCE_DESC` **by value**, so ```cpp device->GetCopyableFootprints(&texture->GetDesc(), 0, 1, 0, &footprint, nullptr, nullptr, &bytes); ``` took the address of a temporary. That is a Microsoft extension, and clang-cl rejects it outright: ``` error: taking the address of a temporary object of type 'D3D12_RESOURCE_DESC' [-Waddress-of-temporary] ``` Which means the documented clang-cl + xwin cross-compile in `docs/non-windows-hosts.md` could not build the `startup_indirect_draw_indexed` test executable at all. MSVC accepts it, so Windows CI never saw it. **Change:** bind the description to a named local and pass `&desc` — the minimal fix, and the pattern this file already uses elsewhere. **Tree-wide check.** A scan of `tests/` and `src/` for any call taken by address (`&…Get*()` and other getters, regex `(?<!&)&(?!&)\s*[A-Za-z_][\w.->:]*\s*\([^;\n]*\)`) found **this as the only genuine temporary-address site**; every other hit returns a reference (`own()`, `fence()`, `back()`, `front()`, `__uuidof`) or is a bitwise `&`. **Verified** — Debian, clang-cl 19.1.7, xwin SDK 10.0.26100 splat, `main` 4567a71a: ``` before: cmake --build out/build/clang --target startup_indirect_draw_indexed -> FAILED: error: taking the address of a temporary object ... after: -> [6/6] Linking CXX executable startup_indirect_draw_indexed.exe ``` No `/W4 /WX` workaround was needed; the four remaining diagnostics are pre-existing `-Wdeprecated-declarations` warnings. **Not established:** no MSVC host here, so the MSVC side is unchanged-by-inspection (it accepted the old form, and a named local is not a behaviour change). Windows CI is the check.
ID3D12Resource::GetDesc returns D3D12_RESOURCE_DESC by value, so
`&texture->GetDesc()` takes the address of a temporary. That is a
Microsoft extension; clang-cl rejects it with
"error: taking the address of a temporary object of type
'D3D12_RESOURCE_DESC' [-Waddress-of-temporary]" and the documented
clang-cl/xwin cross-compile in docs/non-windows-hosts.md cannot build
the startup_indirect_draw_indexed test executable.

Bind the description to a named local first. MSVC output is unchanged.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-03 13:48:41 +00:00
Author
Owner

@⁠chatgpt-codex-connector[bot] on GitHub · 2026-12-03 13:44 UTC · original · edited 2026-12-03 13:46 UTC

Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-03T13:46:04.786628Z fb53bcc PR opened
ℹ️ 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" or "@⁠codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

**@⁠chatgpt-codex-connector[bot]** on GitHub · 2026-12-03 13:44 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3936#issuecomment-7380325052) · edited 2026-12-03 13:46 UTC <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"fb53bcc13702168ba8e3e0a8101ec1b6b2ca4f3c","has_any_findings":false,"has_unresolved_findings":false,"status":"completed"},"security_review":{"commit_sha":null,"has_any_findings":null,"has_unresolved_findings":null,"status":null}} --> <details> <summary><strong>Codex Review Summary</strong>: ✅ Completed</summary> This comment shows the latest Codex review activity on this pull request. | Review | Status | Commit | Review trigger | | --- | --- | --- | --- | | 📝 **Code Review** | ✅ **Completed** <relative-time datetime="2026-12-03T13:46:04.786628Z">2026-12-03T13:46:04.786628Z</relative-time> | `fb53bcc` | PR opened | <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@⁠codex review" or "@⁠codex security review". Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. </details> </details>
github-bot changed target branch from main to gh-pr/3936/base 2026-12-03 14:01:45 +00:00
github manually merged commit fb53bcc137 into gh-pr/3936/base 2026-12-03 14:01:50 +00:00
Author
Owner

@⁠R0Y00 on GitHub · 2026-12-03 13:59 UTC · original · approved these changes

Independently reviewed fb53bcc1. The named D3D12_RESOURCE_DESC stays alive through GetCopyableFootprints. In a minimal harness using the actual SDK types and exact call, the Clang 20.1.8 frontend rejected the original expression with address-of-temporary (exit 1) and accepted the revision (exit 0). I also built the full startup_indirect_draw_indexed target in MSVC Debug and ran ctest --preset dev --no-tests=error -j 1 -V -R '^startup_mesh86_present_(warp|hardware)$': 2/2 passed, including draw, skip and refusal. Windows 11 build 26300, debug layer enabled, WARP 10.0.26100.9818 and RTX 4060 Laptop 32.0.16.1656.

**@⁠R0Y00** on GitHub · 2026-12-03 13:59 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3936#pullrequestreview-6171223351) · **approved these changes** Independently reviewed fb53bcc1. The named D3D12_RESOURCE_DESC stays alive through GetCopyableFootprints. In a minimal harness using the actual SDK types and exact call, the Clang 20.1.8 frontend rejected the original expression with address-of-temporary (exit 1) and accepted the revision (exit 0). I also built the full startup_indirect_draw_indexed target in MSVC Debug and ran `ctest --preset dev --no-tests=error -j 1 -V -R '^startup_mesh86_present_(warp|hardware)$'`: 2/2 passed, including draw, skip and refusal. Windows 11 build 26300, debug layer enabled, WARP 10.0.26100.9818 and RTX 4060 Laptop 32.0.16.1656.
This discussion has been locked. Commenting is limited to contributors.
No description provided.