startup_stubs: stand in for B5G6R5 and array packed render targets #1452

Merged
tedin7 merged 1 commit from upstream-pr/1459 into main 2026-11-24 12:30:03 +00:00
tedin7 commented 2026-11-24 11:53:23 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T11:53:23Z.


AI-assisted; commands listed were executed locally.

Change

The 16-bit packed render-target stand-in (src/startup_stubs/packed_target_format.h) now also covers B5G6R5_UNORM and 2D arrays of 2 to 2048 slices (a cube map is an array of six). When the adapter lacks render-target (or typed UAV) support for the packed format and has it for R8G8B8A8_UNORM, the texture is created as R8G8B8A8_UNORM; only the format changes, so slice count, mip count and view dimensions are kept. Zero slices, more than 2048, 3D, buffers and multisampled textures keep their format. The B5G6R5 view verdicts follow the existing ones. Choice: R8G8B8A8_UNORM is the stand-in for B5G6R5 too, the same as the other two packed formats.

Verification

Linux, MinGW (x86_64-w64-mingw32-g++ -std=c++17 -Wall -Wextra) run under wine64:

  • startup_packed_target_check: PASS (61 rows).
  • The same test against the helper from origin/main: 15 FAILED (arrays, B5G6R5 stand-in and view rows).
  • --mutate stand-in: 16 FAILED; --mutate array: 9 FAILED; --mutate b565: 6 FAILED; --mutate view: 3 FAILED. Each is registered as a WILL_FAIL control.
  • git diff --check, py_compile of the draw check, tests/docs_links_check.py and tests/bidi_controls_check.py: pass.

Not run here (needs a Windows node): the CMake build and ctest, and the WARP/hardware draw check, whose B5G6R5 case moved from a "never substituted" control to a stand-in-or-as-described case.
Windows: ctest --preset dev --no-tests=error -R '^startup_packed_target' -V (also --preset release). The unit tests are in --preset pr; the startup_packed_target_draw_* tests are outside it.

Evidence and follow-up

  • No fixture or data was added. The test describes adapters by their support bits.
  • Not covered: an array target drawn through the wrapper (the draw consumer creates one slice), unordered-access writes, and texels the executable writes in the 16-bit layout. The B5G6R5 stand-in has an alpha channel the packed format lacks.
  • Zero stores or atomics are touched; the rule only chooses a format.

Checklist

  • This pull request covers one reviewable behavior.
  • I included the exact command and result for every check I ran.
  • I considered a negative control or failure case for a new fixture.
  • I updated README/docs when a capability or build requirement changed.
  • I did not include game files, dumps, distribution links or secrets.
<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6581153134 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1459). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T11:53:23Z. --- AI-assisted; commands listed were executed locally. ## Change The 16-bit packed render-target stand-in (`src/startup_stubs/packed_target_format.h`) now also covers B5G6R5_UNORM and 2D arrays of 2 to 2048 slices (a cube map is an array of six). When the adapter lacks render-target (or typed UAV) support for the packed format and has it for R8G8B8A8_UNORM, the texture is created as R8G8B8A8_UNORM; only the format changes, so slice count, mip count and view dimensions are kept. Zero slices, more than 2048, 3D, buffers and multisampled textures keep their format. The B5G6R5 view verdicts follow the existing ones. Choice: R8G8B8A8_UNORM is the stand-in for B5G6R5 too, the same as the other two packed formats. ## Verification Linux, MinGW (x86_64-w64-mingw32-g++ -std=c++17 -Wall -Wextra) run under wine64: - `startup_packed_target_check`: PASS (61 rows). - The same test against the helper from origin/main: 15 FAILED (arrays, B5G6R5 stand-in and view rows). - `--mutate stand-in`: 16 FAILED; `--mutate array`: 9 FAILED; `--mutate b565`: 6 FAILED; `--mutate view`: 3 FAILED. Each is registered as a WILL_FAIL control. - `git diff --check`, `py_compile` of the draw check, `tests/docs_links_check.py` and `tests/bidi_controls_check.py`: pass. Not run here (needs a Windows node): the CMake build and `ctest`, and the WARP/hardware draw check, whose B5G6R5 case moved from a "never substituted" control to a stand-in-or-as-described case. Windows: `ctest --preset dev --no-tests=error -R '^startup_packed_target' -V` (also `--preset release`). The unit tests are in `--preset pr`; the `startup_packed_target_draw_*` tests are outside it. ## Evidence and follow-up - No fixture or data was added. The test describes adapters by their support bits. - Not covered: an array target drawn through the wrapper (the draw consumer creates one slice), unordered-access writes, and texels the executable writes in the 16-bit layout. The B5G6R5 stand-in has an alpha channel the packed format lacks. - Zero stores or atomics are touched; the rule only chooses a format. ## Checklist - [x] This pull request covers one reviewable behavior. - [x] I included the exact command and result for every check I ran. - [x] I considered a negative control or failure case for a new fixture. - [x] I updated README/docs when a capability or build requirement changed. - [x] I did not include game files, dumps, distribution links or secrets.
upstream-sync closed this pull request 2026-11-24 13:00:35 +00:00
tedin7 commented 2026-11-24 13:00:52 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T12:08:21Z.


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

  • Debug (--preset dev):
    • Build (cmake --build --preset dev --target startup_packed_target_check startup_stream_consumer -- -j 6): 24.61s (configure 1.68s)
    • Test (ctest --preset dev -R '^startup_packed_target($|_.+_control$|_draw_warp$)' --parallel 4 --no-tests=error --output-on-failure): 6/6 passed (0.66s: startup_packed_target_stand-in_control 0.02s, startup_packed_target_array_control 0.02s, startup_packed_target 0.02s, startup_packed_target_b565_control 0.01s, startup_packed_target_view_control 0.01s, startup_packed_target_draw_warp 0.59s)
  • Release /O2 (--preset release):
    • Build (cmake --build --preset release --target startup_packed_target_check startup_stream_consumer -- -j 6): 36.96s (configure 1.72s)
    • Test (ctest --preset release -R '^startup_packed_target($|_.+_control$|_draw_warp$)' --parallel 4 --no-tests=error --output-on-failure): 6/6 passed (0.77s: startup_packed_target_array_control 0.02s, startup_packed_target 0.02s, startup_packed_target_stand-in_control 0.02s, startup_packed_target_b565_control 0.01s, startup_packed_target_view_control 0.01s, startup_packed_target_draw_warp 0.71s)
  • sccache: 4/8 hits; wall 71.8s
<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7131018977 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1459#issuecomment-7131018977). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T12:08:21Z. --- Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit `c4e6f4e6bcff477e91def6c715cf419e06c98044`: - **Debug (`--preset dev`)**: - Build (`cmake --build --preset dev --target startup_packed_target_check startup_stream_consumer -- -j 6`): `24.61s` (configure `1.68s`) - Test (`ctest --preset dev -R '^startup_packed_target($|_.+_control$|_draw_warp$)' --parallel 4 --no-tests=error --output-on-failure`): **6/6 passed** (`0.66s`: `startup_packed_target_stand-in_control` `0.02s`, `startup_packed_target_array_control` `0.02s`, `startup_packed_target` `0.02s`, `startup_packed_target_b565_control` `0.01s`, `startup_packed_target_view_control` `0.01s`, `startup_packed_target_draw_warp` `0.59s`) - **Release `/O2` (`--preset release`)**: - Build (`cmake --build --preset release --target startup_packed_target_check startup_stream_consumer -- -j 6`): `36.96s` (configure `1.72s`) - Test (`ctest --preset release -R '^startup_packed_target($|_.+_control$|_draw_warp$)' --parallel 4 --no-tests=error --output-on-failure`): **6/6 passed** (`0.77s`: `startup_packed_target_array_control` `0.02s`, `startup_packed_target` `0.02s`, `startup_packed_target_stand-in_control` `0.02s`, `startup_packed_target_b565_control` `0.01s`, `startup_packed_target_view_control` `0.01s`, `startup_packed_target_draw_warp` `0.71s`) - `sccache`: 4/8 hits; wall `71.8s`
chatgpt-codex-connector[bot commented 2026-11-24 13:00:52 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T12:08:33Z.


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-11-24T12:13:04.056803Z c4e6f4e Draft marked ready
ℹ️ 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:7131023976 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1459#issuecomment-7131023976). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-24T12:08:33Z. --- <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"c4e6f4e6bcff477e91def6c715cf419e06c98044","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-11-24T12:13:04.056803Z">2026-11-24T12:13:04.056803Z</relative-time> | `c4e6f4e` | Draft marked ready | <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>
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!1452
No description provided.