Repository navigation
d3d12: query sweep against the host, and two answers it found the layer got wrong - #4533
Etoile-Bleu wants to merge 1 commit into
Conversation
…er got wrong d3d12_query_sweep_test asks the Vulkan-backed device and Windows D3D12 (the layer's adapter and WARP) the same questions over all 192 DXGI formats and grids of texture descriptions: FORMAT_SUPPORT, FORMAT_INFO, MULTISAMPLE_QUALITY_LEVELS, GetResourceAllocationInfo and GetCopyableFootprints. An answer counts only where the hardware adapter and WARP agree. The layer may know less than the host (a gap); it must not claim more or answer differently (a failure). First run, 17,069 answers, found two such cases, fixed here: - GetResourceAllocationInfo sized 3D textures in D16, D32, D24S8 and D32S8 without ALLOW_DEPTH_STENCIL; the host refuses them by format as well as by flag. - MULTISAMPLE_QUALITY_LEVELS with the tiled flag answered one level for the stencil-bearing depth formats and their plane views, the packed 4:2:2 formats, the video formats and the sampler-feedback formats; the host answers none, at any sample count. Footprints never differ in value: every GetCopyableFootprints answer is the host's or a refusal.
Kam471
left a comment
There was a problem hiding this comment.
Built and ran d3d12_query_sweep_test at 9eb0b6a9 on Windows 11, RTX 5070 Ti: exit 0.
query sweep: layer against NVIDIA GeForce RTX 5070 Ti and WARP -> 17069 answers compared, 1659 skipped where the hosts disagree; 0 wrong, 216 gaps (the layer knows less than the host). The two corrected answers are covered by the sweep. No blocking issue.
Thanks bro 😄 |
RELMYMathieu
left a comment
There was a problem hiding this comment.
Built and ran d3d12_query_sweep_test at 9eb0b6a9 on Windows 11, RTX 3060 Ti 8GB (Ampere), driver 616.92: exit 0.
query sweep: layer against NVIDIA GeForce RTX 3060 Ti and WARP -> 17743 answers compared, 985 skipped where the hosts disagree; 0 wrong, 226 gaps. Both fixes work on Ampere, too. Good work.
Flyander
left a comment
There was a problem hiding this comment.
[P2] Fail when the reported allocation alignment is too small
allocation() records both SizeInBytes and Alignment, but allocation_rule and engine_allocation_rule inspect only ours[0]. A layer result with a valid size but Alignment smaller than the host/WARP result is therefore classified as a gap and does not fail the sweep. That can let the test pass while reporting an alignment too weak for CreatePlacedResource; Microsoft says callers must use GetResourceAllocationInfo for texture size and alignment characteristics: https://learn.microsoft.com/en-us/windows/win32/api/d3d12/nf-d3d12-id3d12device-getresourceallocationinfo%28uint_uint_constd3d12_resource_desc%29. Please classify an undersized alignment as an error whenever the agreed host result is valid, while a larger alignment can remain a gap.
|
Tested 9eb0b6a on NVIDIA GeForce RTX 4090 (driver 32.0.16.2101), Windows 11, MSVC 14.51: pass. Also pass on the integrated AMD Radeon adapter (driver 32.0.21043.5001). The build has no validation layers.
Negative control: with I found no defect. AI-assisted. |
Claimed in the coordination issue as: a new D3D item, claim
What and why
d3d12_query_sweep_testasks the Vulkan-backed device and Windows D3D12 (the layer's adapter and WARP) the same questions over all 192 DXGI formats and over grids of texture descriptions:FORMAT_SUPPORT,FORMAT_INFO,MULTISAMPLE_QUALITY_LEVELS,GetResourceAllocationInfoandGetCopyableFootprints. An answer counts only where the hardware adapter and WARP agree with each other, since where they differ there is nothing to match. The description grids are every format x 1D/2D/3D x seven extents x mips x array sizes, plus 26 render-target, depth and block-compressed kinds at 256..4096 with the flags an engine gives them, 1x and 4x.The layer may know less than the host (it refuses a video format, reports no tiled support): those are gaps, printed with
LEONIDA_SWEEP_GAPS=1. It must not claim more or answer differently, and those fail the run:Support1/Support2bit, or a quality level, that the host lacks;First run (RTX 5070 Ti,
main03b09a0): 17,069 answers compared, 1,659 skipped because the hosts disagree, 31 wrong. They are two causes, both fixed here:GetResourceAllocationInfosized 3D textures inD16_UNORM,D32_FLOAT,D24_UNORM_S8_UINTandD32_FLOAT_S8X24_UINTwithoutALLOW_DEPTH_STENCIL(4 groups, 14 descriptions each). The host refuses them by format as well as by flag; the layer only had the flag check.MULTISAMPLE_QUALITY_LEVELSwith the tiled flag answered one level for 27 formats where the host answers none: the stencil-bearing depth formats and their plane views (19-22, 44-47),R8G8_B8G8/G8R8_G8B8(68, 69), the video formats (100-114) and the two sampler-feedback formats (189, 190), at 1x and, for the stencil ones, 4x as well. The same formats keep their plain answer without the flag, which is unchanged.GetCopyableFootprintsnever differs in value: every footprint the layer answers is the host's, the rest are refusals.Gaps the sweep sees and this PR leaves alone (listed so nobody has to find them again;
LEONIDA_SWEEP_GAPS=1prints all 216 groups): 4x render targets that also carryALLOW_UNORDERED_ACCESS(8 formats; the layer refuses them, the host sizes them at 4 MiB),A8_UNORMas 1D/3D, the video and packed 4:2:2 formats,R32G8X24_TYPELESSwithout the depth flag, noTILED/OUTPUT_MERGER_LOGIC_OP/MULTISAMPLE_LOADbits where the host has them, and one case where the layer's size is smaller than the host's: aD32_FLOAT_S8X24_UINTarray with no depth flag (64x64x3, 0x10000 against 0x20000; the host sizes each plane on its own).Overlaps: #4508 (D3D-467) changes the flag and quality checks of
allocation()a few lines away; #3037 touches thergb96term of the tiled quality line. Either rebases onto the other in a line or two.Tested
RTX 5070 Ti (621.24), Windows 11 Pro 10.0.26200, MSVC 2022 Build Tools RelWithDebInfo/Ninja, Vulkan SDK 1.4.363.0, on
main03b09a0 with this branch.d3d12_query_sweeponmainwith the test only: exit 1, 31 wrong (27 quality-level groups, 4 allocation groups). With the two fixes: exit 0, 0 wrong, 216 gaps.ctest(-j 2), 155 tests: 145 pass, 9 skipped (no game data or hardware), 1 failed. The one failure,d3d12_present, failed once in that parallel run (it reads a screen pixel from its window); it passes alone and throughctest -R d3d12_present, and nothing here touches presentation.d3d12_vulkan_device,d3d12_resource_desc,d3d12_com,d3d12_typeless_*,d3d12_clear,d3d12_descriptor,d3d12_depth_resolve,d3d12_copy_xfmt,d3d12_msaa_drawall pass.No game data or shaders anywhere. AI-assisted.
Checklist
docs/design.md, with how it was confirmed. (Not a translator change; the runtime README documents the new test.)