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.
Vonsek
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
56e57fb to
d8102a2
Compare
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).
Review follow-up on ItsNotRexed#3500 (@whattheflop): the status paragraph now says M1 is met with stand-in shaders (d3d12_draw_test), M1.5 with hand-written RDNA2 run through the translator (d3d12_translated_draw_test), and M2's synthetic part by d3d12_m2_textured_test (descriptor heaps, SRVs, a sampler and a translated textured-quad draw, 4,096 exact pixels), as the milestone table records. The pipeline-state-stream and mesh gap links to D3D-29 (ItsNotRexed#1712). Written with AI assistance (Claude, via OpenBot). Tested: python -I tests/test_docs_{design_rows,links,list_items,repo_paths}.py, tests/test_i18n_index.py and tests/test_text_write_line_endings.py pass (Windows 11, docs only). Co-authored-by: OpenBot <335604065+openbotgit[bot]@users.noreply.github.com>
whattheflop
left a comment
There was a problem hiding this comment.
AI-assisted Windows retest of d8102a22 on f847748c. Five fresh Ninja/MSVC x64 19.44.35228 targets built, including stock d3d12_mesh_test; three synthetic shaders passed spirv-val. A positive-only CPU harness passed 12/12 for stream parsing, metadata and VS/mesh command snapshots, and the mock replay CTest passed 1/1. The stock mesh binary was build-only for this retest.
- The test's 144-byte requirement is still unchecked before mesh PSO creation. This leaves the reported 128-byte Ryzen iGPU failure applicable after rebase. A capability-based skip for this fixture would avoid counting a device limitation as a regression.
- Stream PSOs bypass cache-key bookkeeping. CreatePipelineState creates them directly without assigning a key. GetCachedBlob encodes that key, so distinct stream PSOs on the same device can produce identical blobs. Reusing classic PSO key construction for equivalent CS/VS streams and including MS/AS bytecode for mesh streams would cover the new path. This is a source finding.
|
AI-assisted exact-head follow-up to the cache-key review. Both legal stream PSOs returned S_OK and identical 104-byte blobs from GetCachedBlob. Both positive draw runs also matched 4,096/4,096 pixels on RTX 3080 with zero validation messages. Details and scope. |
|
Tested d8102a2 on an RTX 5090 (driver 616.92), Windows 11, MSVC 19.44, Vulkan SDK 1.4.363, RelWithDebInfo:
AI-assisted (Claude Code). |
|
Note for when you rebase (no action needed from me): this PR conflicts with
Built on top of that: AI-assisted (Claude Code). |
…h (D3D-29) The device enables VK_EXT_mesh_shader (meshShader) where the GPU has it and reports MeshShaderTier 1 only then. ID3D12Device2::CreatePipelineState parses pipeline state streams in the d3dx12.h layout into the descriptions the existing PSO creators take, with the runtime's defaults for missing subobjects. Streams the PC runtime refuses are E_INVALIDARG; AS, depth bounds, split stencil masks and view instancing are E_NOTIMPL with a log. A mesh PSO is MS + PS with no vertex input or input assembly, and no dynamic topology or strides. Its output sizes and workgroup are checked against VkPhysicalDeviceMeshShaderPropertiesEXT. DispatchMesh records a Draw with mesh set and replays as vkCmdDrawMeshTasksEXT; a draw of the wrong kind for its pipeline fails with ReplayResult::invalid_draw. d3d12_mesh_test covers the refusals and checks a 2x2x1 and a 1x1x2 mesh grid plus a VS PSO from a stream, pixel by pixel. AI-assisted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…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>
d8102a2 to
9c4bff4
Compare
|
Tested
AI-assisted (Claude Code). No game files. |
Depends on: ItsNotRexed#1712 AI-assisted (Codex)
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