Skip to content

[upstream #1786] Tests: verify CheckFeatureSupport, reserved resource, and tiling parity - #348

Open
ufoptg wants to merge 1 commit into
mainfrom
upstream-pr/1786
Open

ufoptg wants to merge 1 commit into
mainfrom
upstream-pr/1786

Conversation

@ufoptg

@ufoptg ufoptg commented Nov 25, 2026

Copy link
Copy Markdown
Owner

Adds host-driver parity and contract tests for ID3D12Device::CheckFeatureSupport (#13), CreateReservedResource (#30), CreateReservedResource1 (#55), and GetResourceTiling (#42) without requiring console game files. Part of xcl-dev#480.

What is in it

  • crates/xcl/tests/d3d12_reserved_tiling_and_features.rs:
    • check_feature_support_matches_host_driver_and_console_extensions: checks payload/HRESULT parity across standard D3D12_FEATURE_* queries (D3D12_OPTIONS..OPTIONS7, ARCHITECTURE/1, GPU_VIRTUAL_ADDRESS_SUPPORT, SHADER_MODEL, ROOT_SIGNATURE, FEATURE_LEVELS, FORMAT_SUPPORT, FORMAT_INFO, MULTISAMPLE_QUALITY_LEVELS, PLACED_RESOURCE_SUPPORT_INFO), XCL_RAYTRACING handling in OPTIONS5, console oversized (+4 bytes) and undersized (-4 bytes) buffer fallbacks, console-only formats (116..=120) mapping + input format restoration, and null-pointer error parity.
    • create_reserved_resource_and_v1_match_host_driver: checks CreateReservedResource and ID3D12Device5::CreateReservedResource1 parity with real::orig_fn across buffers and reserved textures (GetDesc(), HRESULTs on valid and invalid descriptors, null ppv), verifies note_reserved keeps Map returning E_INVALIDARG, and exercises the unknown-IID E_NOINTERFACE fallback (creator!) when the D3D12 debug layer is inactive.
    • get_resource_tiling_matches_host_driver_and_d3d12_contract: checks GetResourceTiling parity with real::orig_fn across reserved buffers, non-reserved committed textures, multi-mip/array/BC1/depth/3D reserved textures, omitted optional out-pointers, partial FirstSubresourceTilingToGet slices, vendor-independent 64 KiB packed/standard tile accounting, and vram::place reserved textures.

Tested

  • Hardware / OS / toolchain: AMD Radeon RX 9070 XT (driver 32.0.32029.2010), AMD Radeon(TM) Graphics (driver 32.0.21045.29003), Microsoft Basic Render Driver (XCL_ADAPTER=warp), AMD Ryzen 7 9800X3D, Windows 11 Pro (10.0.26300), rustc 1.100.0 (0ef1bc386 2026-11-09)
  • .\scripts\test.ps1 (cargo build --workspace && cargo test --workspace -- --test-threads=4, debug, default GPU RX 9070 XT): 892 passed, 0 failed, 42 ignored (SKIPPED GPU tests: heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows; tests\d3d12_reserved_tiling_and_features.rs: 3 passed, 0 failed, 0 ignored)
  • cargo test -p xcl --test d3d12_reserved_tiling_and_features (--nocapture, debug):
    • Default GPU (RX 9070 XT): 3 passed, 0 failed, 0 ignored
    • XCL_ADAPTER="Radeon(TM)" (iGPU): 3 passed, 0 failed, 0 ignored
    • XCL_ADAPTER=warp: 3 passed, 0 failed, 0 ignored
    • XCL_D3D12_DEBUG=1 -- --test-threads=1: 3 passed, 0 failed, 0 ignored
  • cargo test -p xcl --release --test d3d12_reserved_tiling_and_features -- --nocapture: 3 passed, 0 failed, 0 ignored
  • python -B -m unittest discover -s scripts -p "test_*.py" -v: 16 passed, 0 failed
  • python scripts/pr_check.py --local: passed (description ok)

Regression run
Not needed: test-only change outside crates/xcl/src.

Not tested

  • XCL_SAMPLE_* sample tests (XCL_SAMPLE_RPF, XCL_SAMPLE_DLLS, XCL_SAMPLE_TTPF, XCL_SAMPLE_BCPACK, XCL_SAMPLE_BK2, XCL_SAMPLE_BVH4, XCL_SAMPLE_AWC, XCL_SAMPLE_XG, XCL_SAMPLE_DXC are not set on this machine)
  • NVIDIA and Intel GPU drivers
  • scripts/smoke.ps1 (no retail game folder available)
  • Unknown-IID E_NOINTERFACE fallback block while XCL_D3D12_DEBUG=1 is active (skipped when ID3D12DebugDevice is present because D3D12SDKLayers.dll fast-fails with 0xc0000409 on unsupported riid inside CreateReservedResource; verified in all non-debug-layer runs)
  • cargo clippy -p xcl --test d3d12_reserved_tiling_and_features --no-deps (did not complete test target due to 2 pre-existing clippy errors in xcl library)

AI use


Mirror of xcl-dev#1786 (auto-synced, do not edit).

Adds host-driver parity and contract tests (without console game files)
covering ID3D12Device::CheckFeatureSupport (#13), CreateReservedResource
(#30), CreateReservedResource1 (#55), and GetResourceTiling (#42).

Verifies D3D12 feature queries, oversized/undersized buffer fallbacks,
console-only formats (116..=120), reserved resource creation and unknown
IID fallback, note_reserved Map(E_INVALIDARG), vram::place tiling parity,
and vendor-independent 64 KiB tiling invariants.

Part of xcl-dev#480

Assisted-by: Antigravity (model name not provided to agent)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants