Repository navigation
vk_pipeline_check: create --mesh-compute mesh entries as compute pipelines - #2124
sovljanskii wants to merge 4 commits into
Conversation
|
Independent Linux/Vulkan check of |
|
Tested The PR creates compute pipelines for the real mesh entries. I also found a push-constant layout error that the checker's success counters miss. I translated all 9,282 mesh entries from my 1.0.2.1 copy with
Both binaries created all 100 shader modules in the default-mode comparison. With Validation finding. With Khronos validation 1.4.369 and duplicate-message suppression disabled, the PR reported 100 successful pipelines and exited 0, but validation emitted Reproduced without game data using a hand-written GLCompute module indexed as Pipeline creation only. Only aggregate results from my own copy are included. AI-assisted verification. |
3c11f6e to
74b93d2
Compare
|
Rebased onto
AI-assisted. |
|
@exhawk thanks, that's a real one, and it was in this PR. The translator records
AI-assisted. |
…ush constants A --mesh-compute module declares a 152-byte push-constant block (its vertex/primitive buffer address follows the 144 bytes of user SGPRs, and index.json records push_constant_bytes = 152). The checker gave every compute pipeline the runtime's 144-byte range, so the validation layer reported VUID-VkComputePipelineCreateInfo-layout-10069 for each one while the driver still created it (found by exhawk on ItsNotRexed#2124). Compute entries whose index asks for more than 144 bytes now get a layout of that size, a line says how many, and an entry over the device's maxPushConstantsSize is skipped with that reason. AI-assisted.
|
Tested 3c11f6e on an RTX 5090 (driver 616.92), Windows 11, MSVC 19.44, Vulkan SDK 1.4.363, fresh RelWithDebInfo build. It conflicts with current
AI-assisted (Claude Code). |
|
Confirmed on On The seven synthetic mesh-compute tests also passed. Pipeline creation only. AI-assisted verification. |
|
Tested
These are the synthetic modules only. I didn't run AI-assisted (Claude Code). No game files. |
…ush constants A --mesh-compute module declares a 152-byte push-constant block (its vertex/primitive buffer address follows the 144 bytes of user SGPRs, and index.json records push_constant_bytes = 152). The checker gave every compute pipeline the runtime's 144-byte range, so the validation layer reported VUID-VkComputePipelineCreateInfo-layout-10069 for each one while the driver still created it (found by exhawk on ItsNotRexed#2124). Compute entries whose index asks for more than 144 bytes now get a layout of that size, a line says how many, and an entry over the device's maxPushConstantsSize is skipped with that reason. AI-assisted.
9f69c49 to
f20ad75
Compare
|
Rebased on Retested on Apple M4 (MoltenVK 1.4.2):
AI-assisted. |
…lines rdna2spirv.py --mesh-compute emits a mesh shader as a GLCompute module and records its buffer layout under "mesh_compute" in index.json. vk_pipeline_check ignored that field and skipped every such entry as "no VK_EXT_mesh_shader", which is the case on exactly the GPUs the flag exists for (MoltenVK). On a full translation from an Apple M4 that left 9,282 of 26,118 modules unchecked by the pipelines stage. An "ms" entry with a mesh_compute object (or true) is now created as a compute pipeline and counted as "ms-compute", apart from "cs" and from real mesh pipelines. --compute-only includes it, --graphics-only leaves it out, and it no longer asks for VK_EXT_mesh_shader. tests/test_vk_pipeline_check_mesh_compute.py runs the tool on a hand-built empty compute module (skips without the binary or a Vulkan device). On an Apple M4 it passes 4/4; with main's binary all 4 fail. Two 100-entry slices of the M4 corpus give 200 of 200 ms-compute pipelines, where main skipped all 200. AI-assisted.
…emory limit BUILD-546 checks a compute entry's lds_bytes against maxComputeSharedMemorySize before the driver sees it. A --mesh-compute mesh entry is created as a compute pipeline too, and the translator records its workgroup bytes (LDS plus %ms_counts), so it gets the same check. A real mesh entry still doesn't. AI-assisted.
…tant layout Main now gives every entry a pipeline layout of its push_constant_bytes (required_push_bytes), so the ms-compute-only wide layouts this commit used to add are dropped. What stays checks that main's rule reaches the entries built as compute: a 152-byte --mesh-compute entry next to a 144-byte cs both create, and one over maxPushConstantsSize is skipped with main's message. AI-assisted.
f20ad75 to
04e2145
Compare
|
Rebased onto Workgroup memory. Main now checks Push constants. Main now gives every entry a pipeline layout of its Re-tested on Apple M4 / MoltenVK 1.4.2:
No game data. AI-assisted. |
|
Tested Runtime and test programs built from this head (MSVC 14.51, Ninja, RelWithDebInfo), Vulkan SDK 1.4.363.0. No game files.
1. The tests skip on Windows with a Ninja (single-config) build. 2. On a device with The other six pass on this driver: the bool/null forms, the compute pipeline, counting apart from AI-assisted (Claude Code); I checked the results. |
…uilds; a real ms meets the mesh limit Two problems found by a test on an RX 9070 XT (Windows, Ninja and Visual Studio builds, VK_EXT_mesh_shader): - find_binary() missed runtime/build/vk_pipeline_check.exe (Ninja on Windows) and every configuration folder but Release/, so all the tests skipped there. It now takes the newest vk_pipeline_check(.exe) in runtime/build or one folder below it, and BinaryLookup checks that on hand-made folders without Vulkan. - Since the rebase onto main, a real ms entry is held to maxMeshSharedMemorySize where the device has mesh shaders, so 1 GiB of lds_bytes fails there, as it should. The test asserted no workgroup-memory message at all, which only held without mesh shaders. It now checks that the real ms entry never meets the compute limit: with mesh shaders it names maxMeshSharedMemorySize, without them it is skipped for the extension. AI-assisted.
|
@zneel thanks, both were real. Fixed in
On Apple M4 / MoltenVK 1.4.2, with no AI-assisted. |
|
Tested
No game files. AI-assisted (Claude Code). |
|
@crastinator thank you. RADV is the run this PR was missing. MoltenVK has no |
ligmaSec
left a comment
There was a problem hiding this comment.
Tested dc3578ab on Debian 13. All nine tests in tests/test_vk_pipeline_check_mesh_compute.py passed against the built checker on Mesa llvmpipe 25.0.7 (LLVM 19.1.7, subgroup 8).
I also checked a real translator output in addition to the test's minimal SPIR-V. runtime/test/shaders/ms_m5.asm from #4408 is a hand-written 128-thread mesh fixture. I translated it with --mesh-compute --wave64-emulate --no-float-controls, validated the module and ran this checker with --compute-only --jobs 1. It compiled one ms-compute pipeline with zero failures or skips on both llvmpipe and the Mesa 26.1.6 ANV Battlemage profile via Intel's DRM shim. The ANV run is compile-only. Synthetic fixture, no game data. AI-assisted with Codex.
|
Tested on an AMD Radeon RX 5700: RDNA1, gfx1010, PCI
Counts only; no shader names. |
Item: new TEST item, claim in #1902. It has no ID yet.
What was wrong
rdna2spirv.py --mesh-computeemits each mesh shader as a GLCompute module and records its vertex/primitive buffer layout under"mesh_compute"inindex.json(an object:slot_bytes,vertex_stride, …).vk_pipeline_checkignored that field and treated the entry as a real mesh shader, so it skipped every one of them asno VK_EXT_mesh_shader(vk_pipeline_check.cpp:862). That happens on exactly the GPUs--mesh-computeexists for. On MoltenVK the pipelines stage never created a single mesh shader of the corpus.On my own 1.0.2.1 copy, translated on an Apple M4 with
make_game.py --stages shaders,pipelines --mesh-compute, that is 9,282 of 26,118 modules (35%): everymsentry has amesh_computeobject, and none of them was checked.The change
msentry whosemesh_computeis an object (ortrue) is created as a compute pipeline. Afalse,nullor missing value leaves it a real mesh entry, as before.ms-compute, apart fromcsand from realmspipelines (ms-compute: N modules ok …,ms-compute pipelines: …, and the same in the isolate child'sISO-RESULTlines).VK_EXT_mesh_shaderordynamicRendering.--compute-onlyincludes them and--graphics-onlyleaves them out.docs/pipeline_check.md.Tests
tests/test_vk_pipeline_check_mesh_compute.py(standard library). It writes a hand-built empty GLCompute module (spirv-valclean) under an index entry shaped like the translator's, and runs the real binary. It skips without the binary or a Vulkan device, liketest_vk_pipeline_check_index.py. It covers:ms-computepipeline ok;csentry and anms-computeentry counted on separate lines;--compute-onlyand--graphics-only;true,falseandnullforms.main's binary all 4 fail; the entry is skipped asno VK_EXT_mesh_shader.test_vk_pipeline_check_index.py,test_vk_pipeline_check_isolate.py,test_make_game_pipelines.py,test_make_game_pipeline_preflight.py,test_shader_meta.pyand the docs tests pass with the new binary. The exception istest_docs_design_rows.py, which fails onmaintoo and is fixed by docs: one row per topic again in design.md, README.md and testing.md (PROC-106) #2063. The binary builds without warnings (AppleClang, Ninja, RelWithDebInfo).--jobs 4), two 100-entry slices that are all mesh shaders (--start 5222and--start 7833):main:ms pipelines: 0 ok, 0 failed, 100 skipped(no VK_EXT_mesh_shader) for each.ms-compute pipelines: 100 ok, 0 failed, 0 skippedfor each, so 200 of 200.I did not run the full 9,282, because MoltenVK adds about 0.7 MB of Metal cache per pipeline and this machine is short on disk. The slices are spread over the name-sorted index.
No game data. AI-assisted.