Repository navigation
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
Conversation
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>
2 tasks done
This was referenced Nov 22, 2026
Contributor
|
Tested ad1150a on RTX 4090 (driver 621.14), Windows 11 26200, MSVC 19.44: pass
No game files used. AI-assisted run (Claude Code). |
Contributor
|
Tested
Also passes with 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). |
2 tasks done
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Depends on: #610, whose
LEONIDA_HOST_ADAPTERhost 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_testexits 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_INFOand 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:
Tile shapes agree everywhere. The layer is right; the test compared a value the API leaves to the driver.
The test now checks:
A differing split is printed, not failed.
resource_tiling.handdocs/d3d12_vulkan.mdnow 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:
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
ad1150aon 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.LEONIDA_VK_VALIDATION=1there 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.AI-assisted (Claude Code).
Checklist
docs/design.md, with how it was confirmed. (No translator change.)🤖 Generated with Claude Code