Repository navigation
d3d12_mesh: compare the mixed query's GS/HS/DS/CS counters with the vertex-only query's (RADV counts GS for vertex draws) - #7256
Conversation
…ertex-only query's On RADV (RX 6700 XT, Mesa 26.3.1) a vertex draw with no geometry shader bound reports one GS invocation per primitive, so the mixed query's GSInvocations is 2 and `mixed.GSInvocations == 0` fails although the mesh draws add nothing (the mesh-only query is all zeros). The check now asks for what it means: the mesh draws add no GS/HS/DS/CS work, so the mixed query matches the vertex-only query, which has the same two vertex draws. The mesh-only checks are unchanged, and the statistics line also prints the GS counts.
Independent Windows + NVIDIA GeForce RTX 3090 Verification (
|
| Check | Result |
|---|---|
git diff --check main...HEAD |
PASS |
python -I scripts/check_no_game_data.py runtime/test/d3d12_mesh_test.cpp |
PASS |
python -m compileall -q make_game.py tools tests |
PASS |
python -I make_game.py --help |
PASS |
cmake --build runtime/build --config RelWithDebInfo --target d3d12_mesh_test --parallel 8 |
PASS (0 new warnings) |
ctest --test-dir runtime/build -C RelWithDebInfo -j 8 --output-on-failure -V -R "^d3d12_mesh$" |
PASS (0.46 s) |
ctest --test-dir runtime/build -C RelWithDebInfo -j 8 --output-on-failure -R "query|mesh|statistic|occlusion|predicat" |
13/13 PASS (1.21 s) |
Merge & validation check with #7112 (LEONIDA_VK_VALIDATION=1) |
Clean auto-merge on runtime/test/d3d12_mesh_test.cpp; PASS with 0 validation errors |
Output on NVIDIA GeForce RTX 3090 (driver 617.42)
- Default run (
d3d12_mesh):device: NVIDIA GeForce RTX 3090 subgroup sizes: 32..32 (default 32), requirable in stages 0x3fff, subgroupSizeControl on, computeFullSubgroups on statistics, mixed: IA 6/2 VS 6 GS 0 C 12/12 PS 3328 CS 0; mesh only: C 8/8 PS 1024; vertex only: GS 0 C 2 PS 2048 D3D-29: mesh tier 1; mesh and VS PSOs from pipeline state streams (9 refused as invalid, 2 as not implemented); DispatchMesh over X, Y and Z and a stream VS draw matched all 4096 pixels; wrong-kind draws fail at execution, oversized grids at Close; statistics queries around mesh draws resolve - With
LEONIDA_VK_VALIDATION=1:- Standalone on
e83aa4e6c: as noted in the PR description, hits the pre-existing 3 Ă—VUID-vkCmdDrawMeshTasksEXT-pipelineStatistics-07076from the clipping bits in the mesh query pool. - Combined with Runtime: mesh-draw statistics segments count no clipping (VUID-07076); clipping from mesh-primitives queries #7112 (which moves mesh clipping counts to
VK_QUERY_TYPE_MESH_PRIMITIVES_GENERATED_EXT): merges cleanly without conflict and exits0with0validation errors and identical counter output (statistics, mixed: IA 6/2 VS 6 GS 0 C 12/12 PS 3328 CS 0; mesh only: C 8/8 PS 1024; vertex only: GS 0 C 2 PS 2048).
- Standalone on
AI-assisted.
|
Tested
|
|
Tested |
|
Tested
Build: MSVC (VS 2022 Build Tools) RelWithDebInfo via |
|
Tested e83aa4e under Wine 11.21 on Linux, on RADV (AMD Raphael iGPU, RDNA2 gfx1036, Mesa 26.2.6) and NVIDIA RTX 3070 Ti (615.78.08): pass.
That is the Mesa driver itself under Wine, the setup the port is aimed at on Linux, and it behaves like the AMD Windows driver in the comment above. AI-assisted: yes. Claude Code ran these tests on my machine and wrote this summary. |
Claimed in the coordination issue as: #7231 (comment) (new D3D item, follow-up of D3D-291 / #2359)
What and why
d3d12_meshfails on RADV atruntime/test/d3d12_mesh_test.cpp:474:On RADV a vertex draw with no geometry shader bound reports one GS invocation per primitive. The vertex-only query (two vertex draws, one triangle each) gives
GSInvocations2, and the mixed query, with the same two vertex draws plus the mesh draws, also gives 2. The mesh draws add nothing: the mesh-only query is all zeros, as the test expects. Every other counter in all three queries matches what the test asks for. NVIDIA reports 0 there and passes (thehollowedone's run on #2359).So the check was really about the driver's count for vertex draws, not about mesh draws. It now asks for what it means: the mesh draws add no GS/HS/DS/CS work, so the mixed query's counters equal the vertex-only query's. On a driver that reports 0 for both, this is as strict as before. The mesh-only checks are unchanged. The statistics line also prints the GS counts, so a failure on another driver shows the numbers.
Test only; the layer is unchanged. It doesn't overlap #7112, which changes the clipping bits of the mesh pool.
Tested
AMD Radeon RX 6700 XT (gfx1031), RADV Mesa 26.3.1, CachyOS, Linux 7.3.5. The Windows build was cross-compiled with clang-cl 23.1.5 + xwin (SDK 10.0.26100) and run under Wine 11.22. RADV's
VK_EXT_mesh_shaderreaches the test through winevulkan.main87c6c2b2e83aa4e6onmain8575d36e)d3d12_meshctest -R d3d12_mesh, and 3 direct runs)mixed: … GS 2 …; mesh only: C 8/8 PS 288; vertex only: GS 2 …LEONIDA_VK_VALIDATION=1wasn't run: this Wine prefix has no Windows validation layer. Under validation the test also hits #7112's VUID-07076, which this PR doesn't touch.AI-assisted: yes (Claude Code)
Checklist
docs/design.md, with how it was confirmed. (No translator change.)