-
Notifications
You must be signed in to change notification settings - Fork 810
Implement mesh node output params #6482
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement mesh node output params #6482
Conversation
To enable reuse of the mesh code generation for output parameters, mesh nodes now share the mesh shader function properties instead of having their own copies. This allows us to rely on the same code to detect errors and pass along parameter information. Since nodes don't store their info in the shader info union, there isn't a conflict. Similar sharing with mesh signature lowering is possible by calling the mesh signature lowering stages for mesh nodes and lightly altering those functions to accomodate for node shaders. Some changes were made to validation to allow for the new parameters and DXIL intrinsics in node shaders. Created a convenience method in function properties to identify mesh nodes as I was tired of typing out the conditionals to identify it. Adds tests for invalid output parameters, misuse of SetMeshOutputCounts, and a thorough end-to-end node record-to-mesh output test. Fixes microsoft#6475 Add a raft of tests for mesh node out param fails enable signature lowering more tests
|
✅ With the latest revision this PR passed the Python code formatter. |
|
✅ With the latest revision this PR passed the C/C++ code formatter. |
tex3d
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some general things (see comments for specifics):
- Gate mesh node metadata on
IsMeshNode()rather than things like validator version for HL IR or the field of a union member (likeShaderProps.MS.outputTopology). - Don't access
ShaderProps.MSunion member without being sure it's valid (IsMS() || IsMeshNode()). - Validation tests should probably be IR based, not HLSL based, since we'd likely want to prevent some of these cases in HLSL before reaching validation at some point.
- Test file paths could be improved.
tools/clang/test/CodeGenDXIL/hlsl/objects/NodeObjects/mesh-node-input-parameters.hlsl
Show resolved
Hide resolved
tools/clang/test/CodeGenDXIL/hlsl/objects/NodeObjects/mesh-node-input-parameters.hlsl
Show resolved
Hide resolved
tools/clang/test/CodeGenDXIL/hlsl/objects/NodeObjects/mesh-node-multi-setoutcounts.hlsl
Show resolved
Hide resolved
tools/clang/test/HLSLFileCheck/shader_targets/mesh/notArrayOutIndicesMesh.hlsl
Show resolved
Hide resolved
tools/clang/test/HLSLFileCheck/shader_targets/mesh-node/notArrayOutIndicesNode.hlsl
Show resolved
Hide resolved
tex3d
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is basically fine to merge for now. Follow-ups can be done later.
To enable reuse of the mesh code generation for output parameters, mesh nodes now share the mesh shader function properties instead of having their own copies. This allows us to rely on the same code to detect errors and pass along parameter information. Since nodes don't store their info in the shader info union, there isn't a conflict.
Similar sharing with mesh signature lowering is possible by calling the mesh signature lowering stages for mesh nodes and lightly altering those functions to accomodate for node shaders.
Some changes were made to validation to allow for the new parameters and DXIL intrinsics in node shaders.
Created a convenience method in function properties to identify mesh nodes as I was tired of typing out the conditionals to identify it.
Adds tests for invalid output parameters, misuse of SetMeshOutputCounts, and a thorough end-to-end node record-to-mesh output test.
Fixes #6475