Skip to content

Test: d3d12_vulkan_device_test passes against Radeon and WARP hosts — the packed-mip split is the driver's choice (Depends on #610) - #654

Merged
ItsNotRexed merged 5 commits into
ItsNotRexed:mainfrom
AlxcBTW:tiling-host-split
Nov 22, 2026
Merged

ItsNotRexed merged 5 commits into
ItsNotRexed:mainfrom
AlxcBTW:tiling-host-split

Conversation

@AlxcBTW

@AlxcBTW AlxcBTW commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Depends on: #610, whose LEONIDA_HOST_ADAPTER host selection (d3d12_copy_compare.h) this uses. Until #610 lands, the diff shows its commits too. The change here is the last commit, ad1150a.

What and why

This is a test fix on main; no item exists for it yet. d3d12_vulkan_device_test exits 1 on both Vulkan GPUs whenever the host side is a Radeon or WARP: 24 "tiling case" mismatches. With an NVIDIA host it passes.

Cause: the test required the host's split between standard and packed mips to equal the layer's. D3D12 doesn't fix that split. D3D12_PACKED_MIP_INFO and D3D11.3 functional spec §5.9.2.8.5 (D3D11_PACKED_MIP_DESC) only require that a mip filling at least one standard tile in every dimension is standard. "Mipmaps with at least one dimension less than the standard tile shape may or may not be packed, depending on the IHV."

The three hosts on one laptop really do differ. The failing cases are 1000×300×3 sRGB, BC7 2048×1024×2, BC3 1000×600 and 100×100 RGBA8:

Host Where the packed tail starts
RTX 5070 (617.42) at the first mip below a tile, the same as the layer
Radeon 880M (26.11.2) keeps one or two more mips standard
WARP packs nothing, down to 1×1

Tile shapes agree everywhere. The layer is right; the test compared a value the API leaves to the driver.

The test now checks:

  • the tile shape;
  • that no mip filling a tile is packed, on the layer and on the host;
  • the tile counts of every mip both sides keep standard;
  • packed totals, only when both sides split at the same mip.

A differing split is printed, not failed. resource_tiling.h and docs/d3d12_vulkan.md now say the split is the driver's choice and cite the spec.

Two more host-dependent failures, which the early exit had hidden, are also fixed:

  • 16x MSAA on WARP. WARP offers 16x colour and depth sample counts. The Vulkan GPUs' limits lack them, so the layer correctly reports 0 quality levels. Counts outside the Vulkan device's limits are now skipped.
  • A null source rectangle in ResolveSubresourceRegion. It means the whole source. The RTX 5070 follows that, and so does the layer. The Radeon 880M and WARP instead resolve to the destination origin and leave the rest unwritten. The test adds an explicit whole-source-rectangle scenario. Where a host disagrees with its own whole-source result, the layer is held to that result and the case is logged as a host quirk.

Tested

Tested ad1150a on an AMD Radeon 880M (AMD 26.11.2) and an NVIDIA RTX 5070 Laptop (617.42), Windows 11, MSVC 17.14, Vulkan SDK 1.4.363.0: pass.

  • d3d12_vulkan_device_test: exits 0 for each Vulkan GPU against each host (AMD 880M, NVIDIA 5070, WARP), six of six. Before, every AMD or WARP host failed.
  • ctest: 27/27 on both GPUs.
  • Validation: with LEONIDA_VK_VALIDATION=1 there are 0 VUID lines. The test machine's loader still reports one error for a stale Nsight layer manifest, which is not a layer error.
  • Not tested: Intel and other drivers.

AI-assisted (Claude Code).

Checklist

  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (No translator change.)

🤖 Generated with Claude Code

AlxcBTW and others added 5 commits November 22, 2026 01:47
CopyResource, CopyTextureRegion (texture to texture, footprint to texture and back, boxes, offsets, array slices,
mips, 3D) and CopyBufferRegion run on the layer and on a host D3D12 device (LEONIDA_HOST_ADAPTER picks it) and the
bytes read back are compared, for 39 format/shape cases including BC1-7 and depth-stencil.

Layer fixes it found: texture formats R8G8_SNORM, R16_UNORM, R32G32_UINT, R9G9B9E5, B5G6R5 and B5G5R5A1 were
refused; a block-compressed texture-to-texture box reaching the padded mip edge was refused as invalid_copy.
Known differences (TEXTURE1D, D24 on GPUs without it, D24 X8 byte) are documented.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Block-compressed texture-to-texture copies: the box is rounded to whole blocks, must fit the destination's padded mip
(a 16-wide box into a 4-wide mip is invalid_copy again), and the extent is cut only where it reaches an edge and
must satisfy both images (block multiple or at that image's edge), else invalid_copy.

Test: copies between different mips (RGBA8, BC1, BC7) and boxes that do not fit, with the host's refusal compared;
a LEONIDA_HOST_ADAPTER that matches nothing fails the run; D24 without a native format still checks the
bit-preserving copies; the partial copies are ordered after the uploads by a COPY_SOURCE round trip; <cctype>.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts:
#	runtime/test/d3d12_vulkan_device_test.cpp
# Conflicts:
#	docs/d3d12_vulkan.md
#	runtime/shims/d3d12_vulkan_device.cpp
#	runtime/src/vulkan_replay.h
…etResourceTiling, sample counts and null-rect resolves

The tiling comparison required the same standard/packed mip split as the host. D3D11.3 functional spec 5.9.2.8.5
(D3D12_PACKED_MIP_INFO) only requires that a mip filling a tile in every dimension stays standard; a smaller mip
"may or may not be packed, depending on the IHV". Measured on one laptop: an RTX 5070 packs from the first mip
below the tile (as the layer does), a Radeon 880M keeps one or two more standard, WARP packs nothing. The test
failed with 24 mismatches on an AMD or WARP host. It now checks the tile shape, that no mip filling a tile is
packed (layer and host), and the tile counts of the mips both sides keep standard; the split itself is printed.

With that fixed, the same test failed further down on those hosts for host-specific answers:
- depth/colour sample counts a software host (WARP, 16x) offers but the Vulkan GPU's limits lack are skipped;
- a null source rectangle in ResolveSubresourceRegion is the whole source; the Radeon 880M and WARP do not resolve
  it that way, so where a host disagrees with its own whole-source rectangle the layer is held to that result.

The host is picked with LEONIDA_HOST_ADAPTER through d3d12_copy_compare.h (D3D-46).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kotorvr

kotorvr commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Tested ad1150a on RTX 4090 (driver 621.14), Windows 11 26200, MSVC 19.44: pass

d3d12_vulkan_device_test passes against the NVIDIA host runtime.

No game files used. AI-assisted run (Claude Code).

@AC-Storm-YT

Copy link
Copy Markdown
Contributor

Tested ad1150a on Windows 11, VS 2026, Vulkan SDK 1.4.363.1: pass on all three hosts, picked with LEONIDA_HOST_ADAPTER.

Host d3d12_vulkan_device_test split notes ("driver's choice, not compared")
RX 9070 XT (RDNA4), driver 32.0.31041.1004 pass 6 (cases 2, 8, 9, 11, 12, 14)
Ryzen 7 9800X3D iGPU (RDNA2), driver 32.0.21045.5002 pass the same 6
WARP pass 12; refuses cases 2, 6, 8

Also passes with LEONIDA_VK_VALIDATION=1; ctest 27/27.

For D3D-65: with the AMD split applied on top (my local branch, as proposed on #313), both AMD hosts show 0 split notes and everything above still passes.

AI-assisted (Claude Code).

@ItsNotRexed
ItsNotRexed merged commit 460d23c into ItsNotRexed:main Nov 22, 2026
9 checks passed
ItsNotRexed pushed a commit that referenced this pull request Nov 22, 2026
…3D-65)

D3D12 leaves where the packed tail starts to the driver (#654 made the test
accept any host's split). The layer used NVIDIA's: packed from the first mip
smaller than a tile on any axis. The console is RDNA2, so it now follows AMD's
PC runtime, as @traeb0n (D3D-20) recommended on #634.

AMD's rule, measured on an RX 9070 XT (RDNA4, 32.0.31041.1004) and a Ryzen 7
9800X3D iGPU (RDNA2, 32.0.21045.5002), identical on both: a mip stays standard
while it is wider than half the tile or taller than the tile; depth does not
count. It fits all 47 measured layouts: compare_tiling's 17 and 30 edge cases
(a mip exactly at or just past half a tile, thin and tall textures, non-square
2D and volume tiles). The rule first proposed on #374 ("every axis at most half
the tile's largest side") fitted the 17 but missed four tall or deep ones.

- src/resource_tiling.h: the new split; a standard mip smaller than a tile
  takes one tile on that axis.
- resource_tiling_test: the five layouts that change expect the AMD values,
  plus a table of all 47 AMD layouts checking standard and packed mips, the
  packed start and NumTilesForPackedMips (AMD's in 45; for the two deep
  volumes that pack from mip 0, AMD reserves 2 tiles and the layer's tight
  count gives 1).
- docs/d3d12_vulkan.md 4.2: the rule and the measurement.

AI-assisted (Claude Code).
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.

4 participants