runtime: list R8_TYPELESS, not R16_SINT, as typeless in the default-view check #2799
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2807"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from R0Y00/Xbox2Windows. Originally posted by RenzoWit35 on 2026-11-26T11:01:12Z.
Change
typeless()insrc/startup_stubs/view_dimension.hdecides 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 isDXGI_FORMAT_R16_SINT(typed) and 60 isDXGI_FORMAT_R8_TYPELESS. The effect was that an R8_TYPELESS resource was allowed a default view and anR16_SINT resource was refused one. This changes
59to60in that list (one token), and adds two cases totests/startup_view_dimension_check.cpp: no default view for format 60, and a default SRV for format 59.Only caller:
default_view_allowed(), used insrc/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 observablechange 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 ahypothesis 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.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_dimensionctest --test-dir out/build/dev --no-tests=error -R 'startup_view_dimension(_control)?$' --timeout 180Result with the fix: both tests passed (2/2).
Negative control: the new test compiled with
/std:c++17against the header fromorigin/mainprintedFAIL: 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 existingstartup_view_dimension_controltest stillpasses (it still prints its FAIL lines; the new R8 case goes through the same
no_defaultmutation, theR16_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 notuse 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.
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 intypeless()is right. The other numbers in that list match their_TYPELESSnames.default_view_allowed(), so the effect is limited to default views of format 59 and 60.tests/startup_view_dimension_check.cppguard both directions (R16_SINT gets a default SRV, R8_TYPELESS gets none).Commands run locally:
git diff --check origin/main...HEADcleanpython3 tests/docs_links_check.pyOKpython3 tests/bidi_controls_check.pyOKtests/startup_view_dimension_check.cpp:startup_view_dimension: okstartup_view_dimension: FAIL (2)).A Windows WARP run follows.
AI-assisted; commands listed were executed locally.
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:--preset dev):cmake --build --preset dev --target d3d12_xs_device_obj d3d12_xs_shim startup_view_dimension -- -j 2):23.95s(configure0.00s)ctest --preset dev -R 'view_dimension' --parallel 6 --no-tests=error --output-on-failure): 5/5 passed (0.35s:startup_view_dimension0.03s,startup_view_dimension_control0.03s,startup_view_dimension_warp0.12s,startup_view_dimension_hardware0.20s,startup_view_dimension_off_control_warp0.20s)/O2(--preset release):cmake --build --preset release --target d3d12_xs_device_obj d3d12_xs_shim startup_view_dimension -- -j 2):48.21s(configure0.00s)ctest --preset release -R 'view_dimension' --parallel 6 --no-tests=error --output-on-failure): 5/5 passed (0.33s:startup_view_dimension0.03s,startup_view_dimension_control0.02s,startup_view_dimension_off_control_warp0.10s,startup_view_dimension_hardware0.16s,startup_view_dimension_warp0.20s)sccache: 0/8 hits; wall77.5sAI-assisted; commands listed were executed locally.