-
Notifications
You must be signed in to change notification settings - Fork 351
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
Default transform<X> nodes can crash shader generation (GLSL) #1425
Comments
Hello! I am going to work on this issue while the CLA agreement is being processed in my organization, if that's alright. I can suggest the following plan:
Just like for the texcoord nodes, it seems there's a lot of code duplication in there, and functions mostly only differ by name, while their content is almost identical. Merging things this way would still open the door to further customization via What do you think? |
Hi @madmann91 ,
|
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`.
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`.
Issue
There are no default "from" and "to" space values so they are left empty on creation.
If you try and generate code from them, then there are a few missing empty value checks missing and code gen can crash.
Setup
This is a simple example:
Initial Triage
Loading this in will crash the view and editor where only
GLSL
was tried out. The fix appears to be inTransformVectorNodeGLSL.cpp
but didn't check other code generators, and it seems all of the "transform" nodes will need to be patched, so wondering if there is a higher level place ?Proposed Fix
Add in firewall checks to see if there is a value and default to empty if none:
Secondary Proposal
Propose these nodes should have some reasonable default and be enumerations if it makes sense. Otherwise it's mostly
a guess as to what strings are required and documentation validation will fail if the string is incorrect.
The text was updated successfully, but these errors were encountered: