Repository navigation
d3d12: guard mesh PSO conservative-raster and f16-halves paths; run non-mesh stream tests before mesh skip - #8200
Conversation
…on-mesh stream tests before mesh skip
|
Verified the two mesh PSO fixes on mesh-capable Windows hardware. Parent
The separate Radeon failure is specific to GSInvocations. A diagnostic run that logged each statistics assertion and continued through readback measured 2 for the mixed query, 0 for mesh only and 2 for vertex only. GSPrimitives, HSInvocations, DSInvocations and CSInvocations were zero in all three. Every other statistics assertion passed, all 4,096 pixels matched and validation reported zero errors. This extends the observation in #7256 to AMD’s Windows driver. The unmodified Radeon test still exits 1. Neither adapter skipped the mesh section. The f16 case checks PSO creation with the fixture’s metadata; the readback uses the ordinary draw shaders. AI-assisted independent verification. Original claim |
|
Independent synthetic Windows mesh testing of #8200 (95597e4) on main 867d922. Windows 11 build 26200, native x64 Release, MSVC 19.51, Vulkan headers 1.4.363, Khronos validation 1.4.357 and LEONIDA_VK_VALIDATION=1. Radeon gfx1036 driver 32.0.21042.62 and RTX 5090 driver 617.42. AI-assisted.
For the last tree I combined the overlapping test hunks so both the GS comparison from #7256 and the feature-dependent clipping assertions from #7112 run. Radeon reports meshShaderQueries=false and the mesh-only clipping counts are 0/0 in that tree. RTX reports meshShaderQueries=true and the same counters are 8/8. A temporary log marker confirmed that both adapters actually created the solid conservative mesh PSO without the topology subobject. Both also created the mesh PSO with the f16_halves pixel shader, with the expected linker-skip trace. The marker was used only for that extra run. The three-PR build passed seven focused CTests three times per GPU: d3d12_mesh, d3d12_pso_validation, d3d12_conservative_raster, conservative_raster, spirv_f16_halves, replay_query_edges and replay_query_predication. WARP was used for host comparisons where applicable. |
Claimed in the coordination issue as: #8047 (comment)
What and why
Fixes two mesh-PSO bugs in
PipelineState::create_graphics()(runtime/shims/d3d12_vulkan_device.cpp) introduced with pipeline state streams (#2359) and expandsruntime/test/d3d12_mesh_test.cppso non-meshID3D12Device2::CreatePipelineStatestream coverage runs on non-mesh GPUs (e.g. Pascal) before skipping theVK_EXT_mesh_shaderdraws:runtime/shims/d3d12_vulkan_device.cpp,runtime/src/conservative_raster.h):PipelineState::create_graphics()checkeddesc.PrimitiveTopologyType != D3D12_PRIMITIVE_TOPOLOGY_TYPE_TRIANGLEeven whenmesh == true, contradicting the input-assembly switch right above (mesh ? D3D12_PRIMITIVE_TOPOLOGY_TYPE_TRIANGLE : desc.PrimitiveTopologyType). Any mesh PSO enablingConservativeRaster = ONwithout a redundantPRIMITIVE_TOPOLOGYsubobject was rejected withE_INVALIDARG.leonida::conservative_raster::graphics_state_allowed(solid_fill, triangle_topology, mesh)(solid_fill && (mesh || triangle_topology)) and added pure-CPU unit checks inruntime/test/conservative_raster_test.cppandruntime/test/d3d12_mesh_test.cpp(plus an end-to-end mesh-PSO check whenVK_EXT_mesh_shaderandVK_EXT_conservative_rasterizationare both available).link_f16_halves()aliasingstages[0](MS) asvs_stage(runtime/shims/d3d12_vulkan_device.cpp):mesh == true,stages[0]holds the mesh shader (VK_SHADER_STAGE_MESH_BIT_EXT), not a vertex shader. Pairing a mesh shader with a pixel shader declaringf16_halveserroneously calledleonida::link_f16_halves()on the mesh SPIR-V module and failed withE_FAIL(f16_halves: VS has no Vertex entry point).link_f16_halves()with!meshand added alog_oncenotice whenmesh && ps_stage.entry && !ps_stage.entry->f16_halves.empty(), matching the existing geometry-shader branch.CreatePipelineStatestream regression coverage before theVK_EXT_mesh_shaderskip (runtime/test/d3d12_mesh_test.cpp):d3d12_mesh_testexited77immediately after checkingMeshShaderTierand the single mesh-PSOE_NOTIMPLrefusal, leaving all stream validation and VS+PS stream PSO draw/readback untested on non-mesh GPUs.E_INVALIDARGstream validation cases, 4 versioned depth-stencil/rasterizer subobject checks, 2E_NOTIMPLsubobject checks (AS,DepthBoundsTestEnable), conservative-raster stream checks, and a full 64x64 VS+PS stream PSO draw/readback (4096 pixels) ahead ofif (!d.mesh_shader) return 77;. Added mesh-path checks for conservative rasterization without a topology subobject and mesh+f16_halvesPSO creation inside thed.mesh_shaderblock.Tested
Built on Windows 11 with
clang-cl 23.1.6+lld-link 23.1.6+ Windows SDK10.0.26100(-DCMAKE_CXX_SCAN_FOR_MODULES=OFF -DLEONIDA_SDL3=OFF) and run on NVIDIA GeForce GTX 1070 (Pascal, driver 581.80, Vulkan 1.3, noVK_EXT_mesh_shader):conservative_raster_test.exe: PASS (exit 0) — all tier/inner-coverage and mesh/non-meshgraphics_state_allowedchecks pass.spirv_f16_halves_test.exe: PASS (exit 0).d3d12_mesh_test.exe: all non-mesh checks PASS (mesh PSOE_NOTIMPL, 9 invalid / 2 not-implemented / 4 versioned stream subobjects, conservative-raster unit + stream checks, VS+PS stream PSO draw/readback matched 4096/4096 pixels, clean COM refcount), then exits77to skip theVK_EXT_mesh_shaderdraw section as expected on Pascal.d3d12_draw_test.exe: PASS (exit 0, all 4096-pixel readbacks matched).d3d12_f16_halves_test.exe: PASS (exit 0,ps_packedandps_relocrendered(64,191,127,255)).d3d12_conservative_raster_test.exe(LEONIDA_HOST_ADAPTER=warp): PASS (exit 0, 48 Vulkan and 24 WARP scenario pairs).Note: the
VK_EXT_mesh_shaderdraw/PSO block (make_device(true, ...)) was compiled and inspected, not executed on mesh-capable hardware on this Pascal GPU.AI-assisted: yes
Checklist
docs/design.md, with how it was confirmed. (N/A — runtime/test change only.)