Adapt unsupported null Texture2D UAV and RTV formats on desktop #1187

Merged
R0Y00 merged 1 commit from upstream-pr/1194 into main 2026-11-24 03:55:08 +00:00
R0Y00 commented 2026-11-24 03:25:54 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T03:25:54Z.


Refs #1137. Depends on the experimental wrapper in #1135. The review base isolates this change until the upstream PR lands.

Slots 19 and 20 query adapter format support for two null Texture2D descriptions. When the original usage is unsupported and RGBA8_UNORM supports it, forward an adapted null descriptor to the desktop device. Keep the guest descriptor for recording. The format fallback excludes resource-backed views, UAV counters, other dimensions and other formats.

Local Windows validation

Commit 2ad099c, MSVC Release, Windows build 26200, debug layer off. Built the shim and source-built consumer with cmake --build out/bin --target startup_null_views_check. Ran ctest --test-dir out/bin --no-tests=error -R "^startup_null_views_" -V.

Adapter Null UAV Null RTV GetDeviceRemovedReason after each
RTX 4060 Laptop GPU, driver 32.0.16.1656 86 → 28 115 → 28 S_OK
Microsoft WARP 86 → 86 115 → 115 S_OK

Two passes, zero skips. The fixture creates two descriptor heaps through D3D12XboxCreateDevice and invokes both wrapper slots. Negative controls cover backed views, a non-null UAV counter, array dimensions and another UAV format. The fixture exercises descriptor creation only.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6573922916 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1194). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-24T03:25:54Z. --- Refs #1137. Depends on the experimental wrapper in #1135. The review base isolates this change until the upstream PR lands. Slots 19 and 20 query adapter format support for two null Texture2D descriptions. When the original usage is unsupported and RGBA8_UNORM supports it, forward an adapted null descriptor to the desktop device. Keep the guest descriptor for recording. The format fallback excludes resource-backed views, UAV counters, other dimensions and other formats. ## Local Windows validation Commit 2ad099c, MSVC Release, Windows build 26200, debug layer off. Built the shim and source-built consumer with `cmake --build out/bin --target startup_null_views_check`. Ran `ctest --test-dir out/bin --no-tests=error -R "^startup_null_views_" -V`. | Adapter | Null UAV | Null RTV | GetDeviceRemovedReason after each | | --- | --- | --- | --- | | RTX 4060 Laptop GPU, driver 32.0.16.1656 | 86 → 28 | 115 → 28 | S_OK | | Microsoft WARP | 86 → 86 | 115 → 115 | S_OK | Two passes, zero skips. The fixture creates two descriptor heaps through D3D12XboxCreateDevice and invokes both wrapper slots. Negative controls cover backed views, a non-null UAV counter, array dimensions and another UAV format. The fixture exercises descriptor creation only.
tedin7 commented 2026-11-24 03:40:57 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T03:40:57Z.

Review: COMMENTED


Technical review on Linux (Windows build/tests were not executed locally).

Checks run (Linux, commit 2ad099c3)

  • /root/.local/share/x2w-rev-venv/bin/python -B tests/docs_links_check.py: passed (16 Markdown files, 253 links).
  • /root/.local/share/x2w-rev-venv/bin/python -B tests/bidi_controls_check.py: passed (967 files).
  • /root/.local/share/x2w-rev-venv/bin/python -B tests/gpu_report_format_check.py: Ran 10 tests — OK.
  • /root/.local/share/x2w-rev-venv/bin/python -B tests/hardware_reports_check.py: Ran 11 tests — OK.

Findings

No issues found in the diff:

  • null_texture_view.h and d3d12_xs_device.cpp (view_slot slots 19 and 20) keep null_uav / null_rtv alive across the forwarded method_of(...) call, guard the guest descriptor pointer with x2w_local::readable, and restrict adaptation to null Texture2D descriptors (a == 0, b == 0 for slot 19) for B5G5R5A1_UNORM UAV / B4G4R4A4_UNORM RTV when R8G8B8A8_UNORM supports the requested usage.
  • desktop_format does not remap either format, and guest descriptor recording in note_view happens before adaptation.
  • tests/startup_null_views_check.cpp covers positive and negative controls (non-null resource/counter, non-Texture2D dimension, other formats) on hardware and WARP, and docs/startup-runtime.md documents the ctest command.
<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6033310483 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1194#pullrequestreview-6033310483). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T03:40:57Z. **Review:** COMMENTED --- Technical review on Linux (Windows build/tests were **not** executed locally). ### Checks run (Linux, commit `2ad099c3`) - `/root/.local/share/x2w-rev-venv/bin/python -B tests/docs_links_check.py`: passed (`16` Markdown files, `253` links). - `/root/.local/share/x2w-rev-venv/bin/python -B tests/bidi_controls_check.py`: passed (`967` files). - `/root/.local/share/x2w-rev-venv/bin/python -B tests/gpu_report_format_check.py`: `Ran 10 tests — OK`. - `/root/.local/share/x2w-rev-venv/bin/python -B tests/hardware_reports_check.py`: `Ran 11 tests — OK`. ### Findings No issues found in the diff: - `null_texture_view.h` and `d3d12_xs_device.cpp` (`view_slot` slots 19 and 20) keep `null_uav` / `null_rtv` alive across the forwarded `method_of(...)` call, guard the guest descriptor pointer with `x2w_local::readable`, and restrict adaptation to null Texture2D descriptors (`a == 0`, `b == 0` for slot 19) for `B5G5R5A1_UNORM` UAV / `B4G4R4A4_UNORM` RTV when `R8G8B8A8_UNORM` supports the requested usage. - `desktop_format` does not remap either format, and guest descriptor recording in `note_view` happens before adaptation. - `tests/startup_null_views_check.cpp` covers positive and negative controls (non-null resource/counter, non-Texture2D dimension, other formats) on hardware and WARP, and `docs/startup-runtime.md` documents the `ctest` command.
upstream-sync closed this pull request 2026-11-24 06:46:50 +00:00
denn0x commented 2026-11-24 06:50:14 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by denn0x on 2026-11-24T03:30:36Z.


Test report for 2ad099c3: Windows 11 Pro 26300, MSVC 14.50 (VS 18 Build Tools), Ninja, Release, debug layer off.

  • cmake --build out/build/release: built with no errors or failures.
  • ctest --no-tests=error -R startup: 7/7 passed, 0 failed, no skips.

Not tested yet: a run with the console executable. Runs on this machine currently run out of system commit before the menus (#1199). I will add the executable result here once that is resolved.

AI-assisted (Claude Code).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7121165054 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1194#issuecomment-7121165054). Originally posted by [denn0x](https://github.com/denn0x) on 2026-11-24T03:30:36Z. --- Test report for `2ad099c3`: Windows 11 Pro 26300, MSVC 14.50 (VS 18 Build Tools), Ninja, Release, debug layer off. - `cmake --build out/build/release`: built with no errors or failures. - `ctest --no-tests=error -R startup`: 7/7 passed, 0 failed, no skips. Not tested yet: a run with the console executable. Runs on this machine currently run out of system commit before the menus (#1199). I will add the executable result here once that is resolved. AI-assisted (Claude Code).
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!1187
No description provided.