Repository navigation
Runtime: reserved resources report AMD's packed tile count (D3D-65 follow-up) - #2728
Conversation
…llow-up) The layer gave the packed tail its tight linear size in whole tiles. AMD's PC runtime gives it one tile per tile-depth slice it spans: ceil(depth of the first packed mip / tile depth), so 1 for every 2D layout and a step at each tile depth for volumes (8x8x32 R8: 1 tile, 8x8x33: 2, 8x8x256: 8), even where the bytes would fit in fewer (16x16x128 RGBA8: 8 tiles for 3 tiles of data). 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: the rule fits all 83 layouts, the 47 from ItsNotRexed#868 (where it explains the two deep volumes AMD gave 2 tiles) and 36 new volumes whose tail is deeper than a tile, including tails that start after standard mips. It matters once sparse textures (D3D-285) reach mip tails. - src/resource_tiling.h: packed tiles = max(1, tight size, tail depth slices). - resource_tiling_test: the two deep volumes expect 2, plus the 36 new volumes with AMD's values. - docs/d3d12_vulkan.md 4.2: the rule and the measurement. AI-assisted (Claude Code).
|
Code read of Nit: four layouts are now in the table twice, with the same expectations: AI-assisted review (Claude Code). |
|
Reviewed Built and ran the test (not a code read, unlike the earlier review): The new expectations are load-bearing: the same test file compiled against Defect (one line of documentation left behind): lines 1-5 of Minor: I could not run Verdict: one concrete defect (stale file header); the code change and the rest of its test are consistent. AI-assisted review. |
…ad (review of ItsNotRexed#2728) 8x8x64 R8, 16x16x16 RGBA8, 16x16x17 RGBA8 and 8x8x8 RGBA32F were in the table twice with the same expectations. The deep-volume set is 32 new layouts, 79 distinct in all; the header comment and docs/d3d12_vulkan.md section 4.2 now say so. AI-assisted (Claude Code).
…he AMD rule (review of ItsNotRexed#2728) The test file header still called the packed-tile count this layer's own tight rule; it now says the split and the packed count follow AMD's PC runtime, with AMD's values in the AmdCase table. resource_tiling.h names the 47 layouts of ItsNotRexed#868 for the split and those 47 plus 32 deeper volumes for the packed count. AI-assisted (Claude Code).
|
Thanks both. @tupacfan04: you're right about the four repeats; they were already in #868's table. 310b2eb removes them and corrects the counts to 32 new and 79 in all, in the header comment, the test and §4.2. The description is updated too. @ricarmandoagent: thanks for building it and checking it fails against main. 980807b rewrites the test file's header: the split and the packed-tile count now follow AMD's runtime, with AMD's values in the AmdCase table. It also makes resource_tiling.h say which layouts each part was measured on (the 47 of #868 for the split, those 47 plus 32 deeper volumes for the packed count), so the two numbers no longer read as a contradiction. resource_tiling_test still passes. |
|
Independent native D3D12 comparison (AI-assisted, Codex). I tested the CPU tiling helper at On Windows with MSVC 19.38 / SDK 26100, the stock CPU tiling test passed on both tested revisions. A separate capability-gated native
The adapters agreed on 13 mip splits and differed on packed tile count in 9 of those. For R8 8x8x32 to 8x8x33, AMD went from 1 to 2 packed tiles and NVIDIA stayed at 1. For R8 64x64x64 to 64x64x66, both began the tail after one standard mip, with AMD going from 1 to 2 and NVIDIA from 2 to 3. This corroborates the AMD-specific count on an older driver. The native harness performed resource creation and metadata queries only, with no submissions or tile mappings. |
|
@whattheflop thanks, that's a useful check: a third AMD measurement on an older driver, matching on all 16. The lower NVIDIA match is expected. The layer follows AMD's count because the console is AMD, and NVIDIA reports one tile more on some tails (64x64x66 R8: 3 vs AMD's 2). d3d12_vulkan_device_test still accepts the NVIDIA numbers when it runs on an NVIDIA host. |
|
Tested 980807b on Windows with the AMD driver: pass. Windows 11 Pro 10.0.26300, MSVC 19.44.35228, Ninja RelWithDebInfo, Windows SDK 10.0.26100. AMD Radeon RX 9070 XT (RDNA4) on driver 32.0.32029.2010, newer than the 32.0.31041 in the description.
AI-assisted (Claude Code); no game files. |
|
@towade thanks, good to have it confirmed on a newer RDNA4 driver too. |
|
Tested on Windows 11 with two GPUs on one machine (runtime built from this PR's head, MSVC 14.51): pass. |
Claimed in the coordination issue as: D3D-65 follow-up, #2516 (comment)
What and why
Follows @traeb0n's review note on #868: for the two deep volumes that pack from mip 0, AMD reported 2 packed tiles where the layer's tight count gave 1. Measuring more volumes shows AMD's rule: the packed tail takes one tile per tile-depth slice it spans,
ceil(depth of the first packed mip / tile depth). That gives 1 for every 2D layout, and for volumes it steps at each tile depth (8×8×32 R8: 1 tile, 8×8×33: 2, 8×8×256: 8), even where the bytes would fit in fewer (16×16×128 RGBA8: 8 tiles for 3 tiles of data).The rule fits all 83 layouts 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: #868's 47 plus 36 volumes whose packed tail is deeper than a tile, including tails that start after standard mips. The old tight count was wrong for 25 of those 36.
runtime/src/resource_tiling.h: packed tiles = max(1, tight size, tail depth slices).runtime/test/resource_tiling_test.cpp: the two deep volumes expect 2; the 36 new volumes are added with AMD's values.docs/d3d12_vulkan.md§4.2: the rule and the measurement.This doesn't change anything while reserved textures are fully backed. It matters once sparse textures reach mip tails (D3D-285, #2382, @gabrielsteglich), since this is the number of tiles a game maps for the tail.
Tested
Windows 11, VS 2026, Vulkan SDK 1.4.363.1, on
main49475796:resource_tiling_test: pass (83 AMD layouts).d3d12_vulkan_device_testwithLEONIDA_VK_VALIDATION=1, withLEONIDA_HOST_ADAPTERset to RX 9070 XT, 9800X3D iGPU and WARP: pass on all three.ctest: 116/116.Checklist
docs/design.md, with how it was confirmed. (N/A: no translator change; the runtime rule is indocs/d3d12_vulkan.md§4.2 with its measurement.)AI-assisted (Claude Code).