runtime: list R8_TYPELESS, not R16_SINT, as typeless in the default-view check #2799

Merged
RenzoWit35 merged 1 commit from upstream-pr/2807 into main 2026-11-26 11:11:59 +00:00
RenzoWit35 commented 2026-11-26 11:01:12 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by RenzoWit35 on 2026-11-26T11:01:12Z.


Change

typeless() in src/startup_stubs/view_dimension.h decides which formats are refused a default view
(a null view description, used for a view with ViewDimension UNKNOWN). Its list held 59 where 60
belongs. In dxgiformat.h (Windows SDK 10.0.26100.0) 59 is DXGI_FORMAT_R16_SINT (typed) and 60 is
DXGI_FORMAT_R8_TYPELESS. The effect was that an R8_TYPELESS resource was allowed a default view and an
R16_SINT resource was refused one. This changes 59 to 60 in that list (one token), and adds two cases to
tests/startup_view_dimension_check.cpp: no default view for format 60, and a default SRV for format 59.

Only caller: default_view_allowed(), used in src/startup_stubs/d3d12_xs_device.cpp (around line 4545)
for slots 18 to 21 when the requested view dimension is 0. With the default mode (srv) the observable
change is for slot 18 (SRV) only: a 2D/3D/array texture with format 59 now gets the default view instead of
being skipped, and one with format 60 is now skipped instead of getting a default view. Slots 19 to 21 only
change with X2W_D3D12_VIEW_DEFAULTS=all. That the console gives UNKNOWN this meaning at all is a
hypothesis already stated in the header comment; this change only makes the list match the stated rule.

Verification

All numbers in the lists checked against dxgiformat.h:

  • typeless(): 1 R32G32B32A32_TYPELESS, 5 R32G32B32_TYPELESS, 9 R16G16B16A16_TYPELESS, 15 R32G32_TYPELESS,
    19 R32G8X24_TYPELESS, 23 R10G10B10A2_TYPELESS, 27 R8G8B8A8_TYPELESS, 33 R16G16_TYPELESS, 39 R32_TYPELESS,
    44 R24G8_TYPELESS, 48 R8G8_TYPELESS, 53 R16_TYPELESS, 70 BC1, 73 BC2, 76 BC3, 79 BC4, 82 BC5,
    90 B8G8R8A8, 92 B8G8R8X8, 94 BC6H, 97 BC7 (all _TYPELESS): correct. Only 59 was wrong.
  • depth_format(): 20 D32_FLOAT_S8X24_UINT, 40 D32_FLOAT, 45 D24_UNORM_S8_UINT, 55 D16_UNORM: correct.
  • Not changed, only noted: 21 R32_FLOAT_X8X24_TYPELESS, 22 X32_TYPELESS_G8X24_UINT, 46 R24_UNORM_X8_TYPELESS and
    47 X24_TYPELESS_G8_UINT are depth-stencil plane views (partially typed) and are absent from typeless();
    they would get a default view on a non-depth resource. Left alone as out of scope.

Build and run (Windows, dev preset):
cmake --build out/build/dev --target startup_view_dimension
ctest --test-dir out/build/dev --no-tests=error -R 'startup_view_dimension(_control)?$' --timeout 180
Result with the fix: both tests passed (2/2).

Negative control: the new test compiled with /std:c++17 against the header from origin/main printed
FAIL: default SRV of an R16_SINT 2D texture, FAIL: no default view of a typeless R8 texture,
startup_view_dimension: FAIL (2), exit 1. The existing startup_view_dimension_control test still
passes (it still prints its FAIL lines; the new R8 case goes through the same no_default mutation, the
R16_SINT case is a plain positive check).

Evidence and follow-up

Not run: the startup_view_dimension_* device tests (WARP/hardware), which need a D3D12 device and do not
use formats 59 or 60. Nothing here measures how a title's modules use these formats. Follow-up candidate,
not done: decide whether 21, 22, 46, 47 should be treated as not-typed for the default view.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6625201673 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2807). Originally posted by [RenzoWit35](https://github.com/RenzoWit35) on 2026-11-26T11:01:12Z. --- ## Change `typeless()` in `src/startup_stubs/view_dimension.h` decides which formats are refused a default view (a null view description, used for a view with ViewDimension UNKNOWN). Its list held 59 where 60 belongs. In `dxgiformat.h` (Windows SDK 10.0.26100.0) 59 is `DXGI_FORMAT_R16_SINT` (typed) and 60 is `DXGI_FORMAT_R8_TYPELESS`. The effect was that an R8_TYPELESS resource was allowed a default view and an R16_SINT resource was refused one. This changes `59` to `60` in that list (one token), and adds two cases to `tests/startup_view_dimension_check.cpp`: no default view for format 60, and a default SRV for format 59. Only caller: `default_view_allowed()`, used in `src/startup_stubs/d3d12_xs_device.cpp` (around line 4545) for slots 18 to 21 when the requested view dimension is 0. With the default mode (`srv`) the observable change is for slot 18 (SRV) only: a 2D/3D/array texture with format 59 now gets the default view instead of being skipped, and one with format 60 is now skipped instead of getting a default view. Slots 19 to 21 only change with `X2W_D3D12_VIEW_DEFAULTS=all`. That the console gives UNKNOWN this meaning at all is a hypothesis already stated in the header comment; this change only makes the list match the stated rule. ## Verification All numbers in the lists checked against `dxgiformat.h`: - `typeless()`: 1 R32G32B32A32_TYPELESS, 5 R32G32B32_TYPELESS, 9 R16G16B16A16_TYPELESS, 15 R32G32_TYPELESS, 19 R32G8X24_TYPELESS, 23 R10G10B10A2_TYPELESS, 27 R8G8B8A8_TYPELESS, 33 R16G16_TYPELESS, 39 R32_TYPELESS, 44 R24G8_TYPELESS, 48 R8G8_TYPELESS, 53 R16_TYPELESS, 70 BC1, 73 BC2, 76 BC3, 79 BC4, 82 BC5, 90 B8G8R8A8, 92 B8G8R8X8, 94 BC6H, 97 BC7 (all `_TYPELESS`): correct. Only 59 was wrong. - `depth_format()`: 20 D32_FLOAT_S8X24_UINT, 40 D32_FLOAT, 45 D24_UNORM_S8_UINT, 55 D16_UNORM: correct. - Not changed, only noted: 21 R32_FLOAT_X8X24_TYPELESS, 22 X32_TYPELESS_G8X24_UINT, 46 R24_UNORM_X8_TYPELESS and 47 X24_TYPELESS_G8_UINT are depth-stencil plane views (partially typed) and are absent from `typeless()`; they would get a default view on a non-depth resource. Left alone as out of scope. Build and run (Windows, dev preset): `cmake --build out/build/dev --target startup_view_dimension` `ctest --test-dir out/build/dev --no-tests=error -R 'startup_view_dimension(_control)?$' --timeout 180` Result with the fix: both tests passed (2/2). Negative control: the new test compiled with `/std:c++17` against the header from `origin/main` printed `FAIL: default SRV of an R16_SINT 2D texture`, `FAIL: no default view of a typeless R8 texture`, `startup_view_dimension: FAIL (2)`, exit 1. The existing `startup_view_dimension_control` test still passes (it still prints its FAIL lines; the new R8 case goes through the same `no_default` mutation, the R16_SINT case is a plain positive check). ## Evidence and follow-up Not run: the `startup_view_dimension_*` device tests (WARP/hardware), which need a D3D12 device and do not use formats 59 or 60. Nothing here measures how a title's modules use these formats. Follow-up candidate, not done: decide whether 21, 22, 46, 47 should be treated as not-typed for the default view. AI-assisted.
upstream-sync closed this pull request 2026-11-26 12:04:46 +00:00
tedin7 commented 2026-11-26 12:04:46 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T11:09:22Z.

Review: COMMENTED


Review of head 08e87085.

Checked:

  • src/startup_stubs/view_dimension.h:61: 59 is DXGI R16_SINT (typed) and 60 is R8_TYPELESS. Changing 59 to 60 in typeless() is right. The other numbers in that list match their _TYPELESS names.
  • Only caller is default_view_allowed(), so the effect is limited to default views of format 59 and 60.
  • The two new cases in tests/startup_view_dimension_check.cpp guard both directions (R16_SINT gets a default SRV, R8_TYPELESS gets none).
  • No other open or merged PR covers this (search "R8_TYPELESS typeless").
  • The PR does not claim to advance game startup; the UNKNOWN-view meaning stays a stated hypothesis.

Commands run locally:

  • git diff --check origin/main...HEAD clean
  • python3 tests/docs_links_check.py OK
  • python3 tests/bidi_controls_check.py OK
  • g++ build of tests/startup_view_dimension_check.cpp: startup_view_dimension: ok
  • Mutation: putting 59 back makes both new cases FAIL (startup_view_dimension: FAIL (2)).

A Windows WARP run follows.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6073082566 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2807#pullrequestreview-6073082566). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T11:09:22Z. **Review:** COMMENTED --- Review of head 08e87085. Checked: - `src/startup_stubs/view_dimension.h:61`: 59 is DXGI R16_SINT (typed) and 60 is R8_TYPELESS. Changing 59 to 60 in `typeless()` is right. The other numbers in that list match their `_TYPELESS` names. - Only caller is `default_view_allowed()`, so the effect is limited to default views of format 59 and 60. - The two new cases in `tests/startup_view_dimension_check.cpp` guard both directions (R16_SINT gets a default SRV, R8_TYPELESS gets none). - No other open or merged PR covers this (search "R8_TYPELESS typeless"). - The PR does not claim to advance game startup; the UNKNOWN-view meaning stays a stated hypothesis. Commands run locally: - `git diff --check origin/main...HEAD` clean - `python3 tests/docs_links_check.py` OK - `python3 tests/bidi_controls_check.py` OK - g++ build of `tests/startup_view_dimension_check.cpp`: `startup_view_dimension: ok` - Mutation: putting 59 back makes both new cases FAIL (`startup_view_dimension: FAIL (2)`). A Windows WARP run follows. AI-assisted; commands listed were executed locally.
tedin7 commented 2026-11-26 12:04:55 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T11:10:50Z.


Win2025 WARP receipt for head 08e87085. Tests: startup_view_dimension, startup_view_dimension_control and the _warp variants.
Real-GPU run not available (RunPod stopped).

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

  • Debug (--preset dev):
    • Build (cmake --build --preset dev --target d3d12_xs_device_obj d3d12_xs_shim startup_view_dimension -- -j 2): 23.95s (configure 0.00s)
    • Test (ctest --preset dev -R 'view_dimension' --parallel 6 --no-tests=error --output-on-failure): 5/5 passed (0.35s: startup_view_dimension 0.03s, startup_view_dimension_control 0.03s, startup_view_dimension_warp 0.12s, startup_view_dimension_hardware 0.20s, startup_view_dimension_off_control_warp 0.20s)
  • Release /O2 (--preset release):
    • Build (cmake --build --preset release --target d3d12_xs_device_obj d3d12_xs_shim startup_view_dimension -- -j 2): 48.21s (configure 0.00s)
    • Test (ctest --preset release -R 'view_dimension' --parallel 6 --no-tests=error --output-on-failure): 5/5 passed (0.33s: startup_view_dimension 0.03s, startup_view_dimension_control 0.02s, startup_view_dimension_off_control_warp 0.10s, startup_view_dimension_hardware 0.16s, startup_view_dimension_warp 0.20s)
  • sccache: 0/8 hits; wall 77.5s

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7190381867 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2807#issuecomment-7190381867). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T11:10:50Z. --- Win2025 WARP receipt for head 08e87085. Tests: startup_view_dimension, startup_view_dimension_control and the _warp variants. Real-GPU run not available (RunPod stopped). Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit `08e870858c6a3d2b63c9a7766d25c152de062fd5`: - **Debug (`--preset dev`)**: - Build (`cmake --build --preset dev --target d3d12_xs_device_obj d3d12_xs_shim startup_view_dimension -- -j 2`): `23.95s` (configure `0.00s`) - Test (`ctest --preset dev -R 'view_dimension' --parallel 6 --no-tests=error --output-on-failure`): **5/5 passed** (`0.35s`: `startup_view_dimension` `0.03s`, `startup_view_dimension_control` `0.03s`, `startup_view_dimension_warp` `0.12s`, `startup_view_dimension_hardware` `0.20s`, `startup_view_dimension_off_control_warp` `0.20s`) - **Release `/O2` (`--preset release`)**: - Build (`cmake --build --preset release --target d3d12_xs_device_obj d3d12_xs_shim startup_view_dimension -- -j 2`): `48.21s` (configure `0.00s`) - Test (`ctest --preset release -R 'view_dimension' --parallel 6 --no-tests=error --output-on-failure`): **5/5 passed** (`0.33s`: `startup_view_dimension` `0.03s`, `startup_view_dimension_control` `0.02s`, `startup_view_dimension_off_control_warp` `0.10s`, `startup_view_dimension_hardware` `0.16s`, `startup_view_dimension_warp` `0.20s`) - `sccache`: 0/8 hits; wall `77.5s` AI-assisted; commands listed were executed locally.
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!2799
No description provided.