Skip to content
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

Fix edge case in HW shader generation for transform nodes #1560

Merged

Conversation

madmann91
Copy link
Contributor

@madmann91 madmann91 commented Oct 12, 2023

This merges the TransformXXXNodeGlsl and TransformXXXNodeMsl classes into a HwTransformNode which has 3 subclasses,
HwTransformVectorNode, HwTransformPointNode, and HwTransformNormalNode, all of which can be configured by overriding the virtual methods of HwTransformNode.

Fixes #1425

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Oct 12, 2023

CLA Signed

The committers listed above are authorized under a signed CLA.

This merges the `TransformXXXNodeGlsl` and `TransformXXXNodeMsl` classes
into a `HwTransformNode` which has 3 subclasses,
`HwTransformVectorNode`, `HwTransformPointNode`, and
`HwTransformNormalNode`, all of which can be configured by overriding
the virtual methods of `HwTransformNode`.
- Use static strings for `fromspace` and `tospace`
- Create helper method `getValueString` on `ShaderPort`.
@jstone-lucasfilm jstone-lucasfilm changed the title Fix issue #1425. Fix edge case in HW shader generation for transform nodes Oct 13, 2023
Copy link
Member

@jstone-lucasfilm jstone-lucasfilm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work, @madmann91, and this is a very elegant solution to the posted issue!

@jstone-lucasfilm jstone-lucasfilm merged commit a62a468 into AcademySoftwareFoundation:main Oct 15, 2023
31 checks passed
JGamache-autodesk added a commit to Autodesk/maya-usd that referenced this pull request Jan 12, 2024
A transform node with empty space values will cause the shadergen to
crash. This has been fixed in future MaterialX 1.38.9 by introducing
ShaderPort::getValueString() in AcademySoftwareFoundation/MaterialX#1560

We have backported that fix in local copies of the transform node
C++ implementations in order to prevent crashing with the current
versions of MaterialX.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Default transform<X> nodes can crash shader generation (GLSL)
3 participants