Repository navigation
Runtime: mesh-shader PSOs from pipeline state streams and DispatchMesh (D3D-29) - #1712
LloydNicholson wants to merge 2 commits into
Conversation
d3cf504 to
75ef6e1
Compare
|
AI-assisted verification of D3D-29 on native Windows 11 Pro (build 26200). I checked the open PR head The stock
Both physical adapters exposed The two headless runs were serial, each with a single process-local ICD, an empty implicit-layer search path and Khronos synchronization validation 1.4.363. Both exited 0 with zero validation warnings or errors through cleanup. The GPU scope was the two legal mesh grids and one ordinary VS draw through Leonida's D3D12-to-Vulkan path via the Xbox ABI proxy. The stock executable, refusal and wrong-kind cases, empty and oversized dispatches, amplification, the standalone device path and Microsoft's D3D12 GPU backend were outside the execution scope. Both physical adapters supported the feature, so the capability-only unsupported-adapter skip did not trigger. The fixtures used synthetic shaders and the detached review worktree has no tracked changes. |
Flyander
left a comment
There was a problem hiding this comment.
Revu le head 75ef6e1 : le parseur de stream aligne et borne les sous-objets, les PSO MS omettent bien vertex-input/input-assembly et DispatchMesh conserve les comptes x/y/z; le test synthétique couvre sorties pixel, limites et mauvais type de draw. Les rapports RX 9060 XT et validation sont positifs, CI encore en attente. Limite à garder visible : D3D12_MESH_SHADER_TIER_1 déclare supportés les mesh shaders et les amplification shaders, tandis que ce code refuse AS; Microsoft le définit ainsi : https://learn.microsoft.com/en-us/windows/win32/api/d3d12/ne-d3d12-d3d12_mesh_shader_tier. La portée est donc la compatibilité de la charge actuelle, dont le rapport indique qu’elle n’a pas d’AS.
evilclanker9000
left a comment
There was a problem hiding this comment.
The stream parser's duplicate check uses the raw enum. In a CPU fixture built from the exact parser at 75ef6e1, one depth-stencil object was accepted and two identical depth-stencil objects returned E_INVALIDARG. A stream containing DEPTH_STENCIL and DEPTH_STENCIL1 returned S_OK in both orders.
Microsoft's pipeline-state-stream contract explicitly lists those versions as duplicates. Could the seen check use the base subobject type for versioned depth-stencil and rasterizer objects while payload parsing still uses the original type? A mixed-version negative case would cover this.
MSVC 19.44 on Windows, parser only, synthetic data, no GPU. AI-assisted.
|
Independent verification of Setup: NVIDIA GeForce RTX 5060 Ti, driver 621.14 (Vulkan 1.4.357), Windows 11; MSVC 19.44, Ninja 1.13.2, CMake 4.4.4, Vulkan SDK 1.4.363.0, llvm-mc 21.1.8. Results
A reproducible validation error: A pipeline-statistics query open around a mesh draw trips Synthetic repro, a local scratch edit of
The PR's own test doesn't open a statistics query, so it doesn't reach this. Would you rather handle it in this PR, or track it as a follow-up? Possible approaches: end and restart the statistics query around mesh draws with a mesh-compatible pool, reporting 0 for the IA/VS/GS fields; or refuse it with a log, as for amplification shaders. Not from this PR: AI-assisted (Claude Code). |
|
rebased this onto current main for you ^^ branch:
tested, Windows 10 22H2, NVIDIA RTX 6000 Ada (582.70), MSVC 2022, llvm-mc 23.1.5, glslang + SPIRV-Tools built from main:
with #1865 (also rebased, see there) this would be M5's whole synthetic part \o/ TL;DR: rebased onto main, fixed one silent break (a renamed feature-chain variable), and mesh shaders pass on Win10 + RTX 6000 Ada with the full suite green. AI-assisted (Claude Code). |
75ef6e1 to
6895f1b
Compare
|
Thanks for the reviews and the Windows runs. I've rebased onto
Tested after the rebase: RX 9060 XT, RADV (Mesa 27.0.0-devel), Wine 11.22, clang-cl 22 cross-build.
AI-assisted (Claude Code). |
|
Tested 6895f1b on RTX 5060 Ti (Blackwell), NVIDIA 621.01, Windows 11 Pro (build 26300), MSVC 19.44 + Ninja, on top of main 4eb6155: pass.
No game files. AI-assisted. |
6895f1b to
47e8b42
Compare
|
Tested head RTX 3060, driver 621.14 (wave32, 256 B push constants): The PR is based on AMD Radeon iGPU (Raphael, gfx1036, 23.40.02, wave64, So the refusal comes from the push-constant limit, but the message blames the extension. Suggestion: return 77 (skip) when the device is under 144 B, as the other pipeline tests do on such devices, and make the log line name the actual reason. On |
|
Tested 47e8b42 on AMD Radeon RX 7600 (RDNA3), AMD 26.11.2 (LLPC), Windows 11, MSVC 19.44, Vulkan SDK 1.4.363.0, llvm-mc 21.1.8: pass.
AI-assisted (Claude Code, reviewed with Codex). No game files. |
|
Retest of the rebased head Hardware / environment. Windows 10 build 19045, VS 2026 Community (
Full
RTX 3060: AMD iGPU: One correction to my earlier report: So the requested 128-byte skip still needs to be added after the tier check (query |
|
Windows + GPU check: AMD Radeon RX 9070 (RDNA4), Windows 11, MSVC Release, Vulkan SDK 1.4.363. Tested head 47e8b42 merged onto AI-assisted (Claude Code); runs on my machine. |
47e8b42 to
56e57fb
Compare
…ates; mesh test skips without Vulkan The stream parser keyed its duplicate check on the raw subobject type, so DEPTH_STENCIL with DEPTH_STENCIL1 (either order) or RASTERIZER with RASTERIZER2 was accepted; D3D12_PIPELINE_STATE_STREAM_DESC counts versions of one subobject as the same one. The check now uses the base type, while the payload still follows the original type. d3d12_mesh_test covers both mixed orders, RASTERIZER + RASTERIZER2, and each description alone. Reported by Vonsek in review. d3d12_mesh_test failed on a machine without a Vulkan device (the Windows CI runner) instead of exiting 77; it now skips there like d3d12_draw_test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
9c4bff4 to
c237639
Compare
Kam471
left a comment
There was a problem hiding this comment.
Retest at c237639 (OPEN, MERGEABLE): confirms it contains current main 561b65a83.
Delta 9c4bff4..c237639: 868 files, but that is main moving 3faa→561b under the rebase. PR-only content is unchanged: both patches are 13 files, +929/−34; the second commit is identical (range-diff shows =), the first differs only in surrounding context, and d3d12_mesh_test.cpp/ms_draw.mesh are byte-identical. Tier code is still D3D12_FEATURE_D3D12_OPTIONS7 → D3D12_MESH_SHADER_TIER_1 (line 7139); DispatchMesh/draw_mesh_tasks/invalid_draw are intact.
Commands: rebuilt d3d12_mesh_test d3d12_draw_test d3d12_vulkan_device_test d3d12_compute_test — exit 0. LEONIDA_VK_DEVICE='RTX 5070 Ti' ctest -R "^(d3d12_mesh|d3d12_draw|d3d12_compute|d3d12_vulkan_device)$" — 4/4 passed, exit 0. d3d12_mesh_test direct — exit 0, 4096/4096 pixels, "mesh tier 1". Validation-on rerun — exit 0, no messages. git diff --check — exit 0.
Standalone/game path probe against the rebuilt library: OPTIONS7 hr=0 MeshShaderTier=10 (D3D12_MESH_SHADER_TIER_1), unchanged.
Verdict: earlier verdict still holds — no blocker for the direct mesh path; #3777 (indirect mesh) and #4408 (no-extension fallback) still need coordination. No new issues from the rebase.
|
Tested Each seed draws 1-5 batches through PSOs with random state:
In
So the stream parser gives exactly what the desc path gives, over every combination the fuzzer reaches, including the omitted-subobject defaults and AI-assisted (Claude Code). |
…State; exact clears --stream creates each PSO from a pipeline-state stream (d3dx12.h layout) on both the layer and the reference: subobjects in a random order, one equal to its default left out half the time, and DEPTH_STENCIL or DEPTH_STENCIL1 alternately. The stream layout comes from its own generator, so the programs are the same as without --stream. On main every PSO is refused (no CreatePipelineState yet). On ItsNotRexed#1712 (D3D-29), 1,000 seeds give 0 differences, and the results match the desc path seed for seed. UNORM targets are now cleared to 0 or 1 per channel. A clear value between two codes rounds by the clear's rules, which d3d12_clear_fuzz_test checks and where NVIDIA's D3D12 and D3D12's ties-to-even part (a 2-bit alpha of 0.5); this test checks the draws. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Verified The same test executable passed under Wine 11.22 and GE-Proton10-34 (umu-launcher 1.4.3). For both runs, the X/Y/Z mesh dispatches and the vertex-shader draw matched the reference on all 4,096 pixels, with host exit 0. The test also exercised its nine invalid and two unimplemented pipeline-stream cases and its wrong-pipeline and oversized-grid checks. Synthetic fixtures only. AI-assisted. |
|
Thanks for rebasing onto One point from my earlier note isn't in this head:
Please take it if you agree; if you do, I'll drop it from #3777. On an RX 9070 XT (AMD 26.11.2, Windows 11, Ryzen 7 9800X3D / 64 GB), with it applied: AI-assisted (Claude Code). |
|
Tested c237639 (it already contains main |
|
I checked whether the bundle fix from #3777 can move into this PR on its own. On #1712 at The test-only commit c44f6e3b is based directly on this PR and can be cherry-picked with the fix. It records I also ran the fixture on the parent of the fix ( |
ID3D12Device::CreateQueryHeap refused D3D12_QUERY_HEAP_TYPE_PIPELINE_STATISTICS1. It now creates one on a device with VK_EXT_mesh_shader's meshShaderQueries (enabled with meshShader where the GPU has it, and reported through OPTIONS9.MeshShaderPipelineStatsSupported); without it the heap is still refused with E_NOTIMPL. Built on D3D-291 (ItsNotRexed#2359), which splits a statistics query around mesh draws into full and mesh-pool segments. - The heap's pool counts the 11 classic statistics plus TASK_SHADER_INVOCATIONS (0x800) and MESH_SHADER_INVOCATIONS (0x1000); Vulkan writes them in bit order after CSInvocations, the order of ASInvocations and MSInvocations. Neither bit is forbidden around vertex draws (only around vkCmdDrawClusterHUAWEI, VUID-07819). - A query that holds a mesh draw is always split (VUID-vkCmdDrawMeshTasksEXT-pipelineStatistics-07076, D3D-291), so an unsplit query ran no mesh draw: the resolve copies its 13 statistics 112 bytes apart and writes MSPrimitives as 0. - With a split PIPELINE_STATISTICS1 query in the submission, the mesh pool also counts task and mesh invocations (6 counters), and each mesh segment runs a VK_QUERY_TYPE_MESH_PRIMITIVES_GENERATED_EXT query of its index beside it; full segments run none. No VUID ties those queries to the draw kind (07068, 07070, 07071), but NVIDIA's Vulkan driver counts a VS draw's triangles in them and D3D12 does not, so MSPrimitives is counted only around mesh draws. - A split PIPELINE_STATISTICS1 query always resolves through the sum. statistics_sum.comp takes the result width (11 or 14) as a push constant and maps a mesh segment's task and mesh invocations and primitives to fields 11-13. statistics_sum_spirv.h is regenerated with glslang 16.6.0 (-V --target-env vulkan1.0 -Os -g0; spirv-val clean). Tested on Windows 11, NVIDIA GeForce RTX 3070 Ti, driver 610.88, without Vulkan validation layers (not installed): ctest 125/125 passed, 8 skipped (game data, the validation layer, an RGB9E5 RTV); ItsNotRexed#2359's head alone: 124/124 passed, the same 8 skipped. New: d3d12_mesh_statistics runs one list on the layer and on host D3D12 (DXIL from HLSL equivalents compiled at run time by the Windows SDK's dxcompiler.dll): a VS draw in PIPELINE_STATISTICS1 and PIPELINE_STATISTICS queries, DispatchMesh(2,2,1) and (1,1,2), a query never ended, and a query split by a resolve inside it, resolved at an offset. Every one of the 14 fields matches the host. replay_query_predication cases 10-12 cover the unsplit resolve, the primitives queries beside mesh segments only, the refusals and the 14-counter sum; d3d12_query_rules compares PIPELINE_STATISTICS1 heap creation by count and node mask with WARP and the GPU. The host's refusal HRESULT is unmeasured: every host adapter here (WARP, RTX 3070 Ti) supports these heaps. Depends on: ItsNotRexed#1712, ItsNotRexed#2359 AI-assisted (Claude Code).
|
@LloydNicholson this PR's code is already on #2359 (D3D-291) was stacked on this branch and was squash-merged at 15:34 today, which brought both of this PR's commits in under a new commit. Checked against
AI-assisted (Claude Code). Git analysis only, no build or GPU run. |
Use both submitted FSSM tables and translated interface declarations to connect dense fragment inputs to native mesh exports. Keep the fragment module local to its pipeline and cover shared-fragment draws and unsupported layouts. Refs: ItsNotRexed#1712, ItsNotRexed#4816
A PerVertexKHR triangle array consumes the location of one vec4. Recognize this shape alongside ordinary inputs and keep plain arrays outside the supported mapping. Refs: ItsNotRexed#1712, ItsNotRexed#4816
Claimed in the coordination issue as: D3D-29 (claim)
What and why
9,282 of the 26,503 translated shaders are mesh shaders, but the layer reported
D3D12_MESH_SHADER_TIER_NOT_SUPPORTEDand had no way to create or draw a mesh PSO. This adds both, onVK_EXT_mesh_shader, on top of #291's graphics pipelines.VK_EXT_mesh_shaderwithmeshShaderwhere the GPU has it (VulkanDeviceInfo::mesh_shader).taskShader: the corpus has no amplification shaders.OPTIONS7.MeshShaderTieris 1 only then.ID3D12Device2::CreatePipelineState:CreateGraphicsPipelineStateandCreateComputePipelineStatealready take. Missing subobjects take the runtime's defaults.E_INVALIDARG, as on the PC runtime: a duplicate, unknown or truncated subobject, MS with VS, CS with graphics stages, or no stage at all.E_NOTIMPLwith a log: AS, depth-bounds tests, separate front and back stencil masks, view instancing.max_vertices/max_primitives(now read byShaderLibrary) and the workgroup size are checked againstVkPhysicalDeviceMeshShaderPropertiesEXT.DispatchMesh:Drawwithmeshset, with the same state snapshot asDrawInstanced, and replays asvkCmdDrawMeshTasksEXT.Close. An empty grid records nothing.ReplayResult::invalid_draw.docs/d3d12_vulkan.md§3.6 has the details. The Xbox-ABI proxy already forwards device slots in PC order, so nothing changed there.Tested
AMD Radeon RX 9060 XT (RDNA4), RADV on Mesa 27.0.0-devel, Fedora 44 (Linux 7.3). The Windows build is clang-cl 22.1.8 with xwin SDK 10.0.26100, run under Wine 11.22.
d3d12_mesh_test: passes, matching all 4096 pixels.E_INVALIDARG, AS and depth bounds →E_NOTIMPL, wrong-kind draws →invalid_draw, oversized grids →Closefails.NOT_SUPPORTEDand a mesh PSO isE_NOTIMPL.VK_INSTANCE_LAYERS), the mesh path is clean. The only messages arevkCreateDeviceones aboutVK_KHR_shader_fma, which this older layer doesn't know;d3d12_draw_testonmaingives the same ones.maina0acd33:mainat the same commit, built the same way, fails the same ones:device_proxy;d3d12_present;d3d12_indirect_zero;d3d12_translated_draw,d3d12_m2_texturedandd3d12_m3_frame. Their generated shaders failspirv-valon this machine: an old SPIRV-Tools in/usr/local/binwins on the PATH, which the;-joinedLEONIDA_SPIRV_TOOLS_NATIVEentry doesn't override on a Linux host.main(depth24_convertand the two occlusion tests).d3d12_mesh,d3d12_drawandd3d12_vulkan_devicepass.main89b047c (75ef6e19, conflicts only in neighbouring fields):d3d12_mesh,d3d12_computeandd3d12_vulkan_devicepass under Wine.d3d12_drawnow fails its new "bundle blend" check (pixel (0, 0): got 255,0,0,255, expected red 64), andmainat 89b047c fails it the same way, so it isn't from this PR.main's primitive restart and graphics bindless set. A mesh PSO now skips the strip-cut check and the dynamic restart state (it has no index buffer or input assembly). The bindless set layout isVK_SHADER_STAGE_ALL, so it already covers the mesh stage.VK_EXT_mesh_shader(only simulated, by leaving the flag off).docs/design.md.Checklist
🤖 Generated with Claude Code