Repository navigation
Runtime: link sparse mesh varyings at graphics pipeline creation (BUILD-1463) - #4954
jeremygold02 wants to merge 4 commits into
Conversation
…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>
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
|
Independent Windows/Vulkan check at Environment: Windows 11 build 26300, MSVC 19.51.36260.0, NVIDIA GeForce RTX 5070 driver 621.24, Vulkan SDK 1.4.363.0, RelWithDebInfo, Vulkan validation enabled.
Non-blocking: the test-only No game data; synthetic shaders and pixels only. AI-assisted. |
whattheflop
left a comment
There was a problem hiding this comment.
Independent Windows CPU verification, AI-assisted. The exact #1712 dependency and this head each dry-merged cleanly with 3faac557. MSVC 19.38 built spirv_mesh_inputs_test. In a separate valid synthetic harness, linking fresh copies of one fragment in A → B → A order remapped its input locations to (4, 2), (3, 5), and (4, 2). All three matched independently assembled expected modules. Exactly two words changed per call; render targets, FragCoord, the original fragment and the first linked result stayed intact. All eight modules passed spirv-val for Vulkan 1.2.
One docs detail: the runtime guide can mention that a nonidentity dense permutation is refused even when the tables agree, because its occupied location set cannot distinguish an already-linked interface. This check used no GPU or game inputs.
|
Linux check of effca4a (Arch, in a VM, GCC, Ninja, RelWithDebInfo, Mesa llvmpipe): the runtime builds, and the full Linux CTest passes 51 of 51, including the new |
|
Non-blocking addendum after reading the rest of the diff (tests and GPU result above still stand):
The branch also carries #1712 (4 commits, 1,251 insertions); the PR diff is only the last commit. AI-assisted review, no game data. |
|
Independent check of Environment: Windows 11, MSVC 19.44 (RelWithDebInfo, Ninja), NVIDIA GeForce RTX 5090 (driver 617.42), Vulkan SDK 1.4.363.0, Built
So sparse (vertex-indexed) fragment inputs now link at pipeline creation and rasterize correctly on the newest NVIDIA arch — previously the varyings were dropped/unbound. The wrong-kind-draw and oversized-grid refusal paths also verified live. Not run: negative control — the change is header-coupled across AI-assisted (Devin). |
|
Tested AI-assisted (Claude Code). Synthetic data only, no game files. |
BUILD-1463
Depends on: #1712 at
9c4bff42f52cf27333655e08f93a36a3932186da. Review the two commits after that dependency. Follow-up diff · ClaimAn ordinary mesh pipeline can compile successfully and still interpolate the wrong value. The translator numbers fragment attributes densely, while the mesh keeps native export numbers. When the fragment skips an export, two compatible
vec4outputs can both satisfy Vulkan's type check.At
CreatePipelineStatethe submitted mesh and fragment programs identify the pair. This change reads their existing FSSM tables, cross-checks both translated interfaces and edits only the fragment input Location operands for this PSO. It supports directvec4andPerVertexKHRtriangle-array inputs. Other pipelines sharing the fragment still receive their own original words. The offline utility remains independently usable. Offline linkerVerification
The new 64×64 synthetic fixture submits two graphics pipeline streams through the normal D3D12 device. The mesh writes distinct colors at locations 0 and 1. Its pixel shader requests the second export. The VS pipeline then reuses that pixel shader and supplies its color at location 0.
effca4a28b94b8c7d4234794f2d06750ac8cdb32, all 4,096 pixels matched (exit 0): 1,024 red and 512 green mesh pixels, 1,024 yellow VS-control pixels and 1,536 clear blue pixels. The three shader binaries had identical hashes for the two runs and all three passed Vulkan 1.3 SPIR-V validation. The runtime was built with MSVC 19.44 and CMake 3.31.6 in RelWithDebInfo./W4. They cover a sparse map, a render target sharing an input's original location, identity, malformed/contradictory rows, unsupported types, a dense permutation, repeated linkage, and a mix of ordinary and vertex-indexed inputs. The hand-written mesh, original mixed fragment, linked mixed fragment, and undecorated-array negative all passedspirv-val --target-env vulkan1.2.Run
ctest --test-dir <build> -C RelWithDebInfo -R "^(spirv_mesh_inputs|d3d12_mesh)$" --output-on-failurewith Vulkan headers, glslang and a mesh-capable GPU. This change covers native MeshEXT graphics pipeline creation. Compute fallback and decoded-half placement have separate interfaces.AI-assisted by GPT-6.2 Astra.