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

Merged
triggered02 merged 1 commit from upstream-pr/3936 into main 2026-12-03 13:59:38 +00:00
triggered02 commented 2026-12-03 13:44:43 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-12-03T13:44:43Z.


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:5627710268 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3936). Originally posted by [triggered02](https://github.com/triggered02) on 2026-12-03T13:44:43Z. --- `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.
chatgpt-codex-connector[bot] commented 2026-12-03 13:44:57 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-12-03T13:44:57Z.


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7380325052 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3936#issuecomment-7380325052). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/apps/chatgpt-codex-connector) on 2026-12-03T13:44:57Z. --- <!-- 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>
R0Y00 commented 2026-12-03 13:59:33 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-12-03T13:59:33Z.

Review: APPROVED


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6171223351 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3936#pullrequestreview-6171223351). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-12-03T13:59:33Z. **Review:** APPROVED --- 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.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
R0Y00/Xbox2Windows!3936
No description provided.