d3d12_xs: match mesh PSO primitive topology to PSV0 and drop empty legacy stages #176
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
library
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/omonkeyz--xbox-emulator!176
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/176/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@GDAgent on GitHub · 2026-11-22 18:08 UTC · original
GDAgent:fix/d3d12-mesh-pso-drop-topology→main· +169 −3 · 1 files · 1 commits · closed without mergingLibrary / area: d3d12_xs (
mesh_pso.rs)Exports changed (exports.txt rows): none
Source of the behaviour: console mesh shader PSO streams frequently carry subobject
14(D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_PRIMITIVE_TOPOLOGY) set to0(D3D12_PRIMITIVE_TOPOLOGY_TYPE_UNDEFINED), omit it altogether, or include empty (null bytecode) legacy VS/HS/DS/GS subobjects alongsideSUB_MS. On PC D3D12,ID3D12Device2::CreatePipelineStatefires D3D12 error#673(CreateMeshShader_TopologyMismatch) ifPRIMITIVE_TOPOLOGYis omitted/0 rather than matching the mesh shader'sPSV0output topology.Changes:
mesh_dxil_topologyto readPSV0MeshInfo::topology(1->LINE = 2,2->TRIANGLE = 3) viatombox_xshader::meta::parse_psv0_mesh.mesh_pso::translate_stream:VS/HS/DS/GSsubobjects whenSUB_MSis present;SUB_PRIMITIVE_TOPOLOGY (14)or append one whenSUB_MSprovides aPSV0topology (and dropSUB_PRIMITIVE_TOPOLOGYif noPSV0topology is available), while keepingSUB_PRIMITIVE_TOPOLOGYuntouched on non-mesh graphics streams.mesh_pso::create_pipeline_state, log a compact subobject summary (subs=[ty:w0,...]) when the PC driver rejects a stream.mesh_stream_sets_primitive_topology_from_psv0_and_drops_empty_legacy_stagesto coverSUB_PRIMITIVE_TOPOLOGYbeforeSUB_MS, afterSUB_MS, omitted, withoutPSV0, empty legacy stage removal, and vertex-shader passthrough.Tests:
cargo test -p d3d12_xs mesh_pso: 7 passed, 0 failed.Not verified in a title: verified by the unit tests above on
main(and previously observed resolving D3D12#673on mesh PSOs in a local test run with a mesh-shader title).cargo test -p d3d12_xs mesh_psopasses (7 passed)14untouched@GDAgent on GitHub · 2026-11-22 18:45 UTC · original
Updated and rebased onto current
mainafter testing against PC D3D12 validation (#673CreateMeshShader_TopologyMismatch):SUB_PRIMITIVE_TOPOLOGY (14)still leaves PC D3D12 defaulting it toUNDEFINED (0)and firing#673on mesh PSOs.translate_streamnow reads the mesh shader's DXILPSV0MeshInfo::topology(1->LINE (2),2->TRIANGLE (3)) and populates or appendsSUB_PRIMITIVE_TOPOLOGY (14)accordingly.VS/HS/DS/GSsubobjects whenSUB_MSis present.subs=[ty:w0,...]summary when the PC driver rejects a stream.SUB_MS, afterSUB_MS, omitted, noPSV0, empty legacy stages, and VS passthrough).Ready for review!
@omonkeyz on GitHub · 2026-11-22 18:48 UTC · original
Applied in
7047013(merged in190a4b3) with your authorship kept, thanks. #168 touches the same file and will be rebased onto this when it's updated.@omonkeyz on GitHub · 2026-11-22 18:53 UTC · original
Your updated version (PSV0 topology + dropping empty legacy stages, SUB_PRIMITIVE_TOPOLOGY fixed to 14) is applied in
7748afd(merged in0d5f02a) with your authorship kept, thanks. The first version had already landed in190a4b3; this one supersedes it. d3d12_xs lib tests pass (548/0).Pull request closed