Closed kwokcb closed 8 months ago
As of today, on main
(c7f01d8), this MaterialX network can be loaded both via MaterialXGraphEditor
and MaterialXView
, without crashing. Should this perhaps be closed then?
Hi @madmann91 , I'm not sure. I don't recall if this was performed via unit tests and there was additional protection added to those apps to prevent a crash. Might be best to add this to the testsuite and run RTS first.
Although there are likely still improvements needed on the GLSL code generation side, I believe we should close this issue as we no longer have a straightforward repro case. Feel free to write up a new issue if we encounter this again in the future.
Issue
If you create a
<surfacematerial>
but don't specify thesurfaceshader
and try to generate code then code generation can crash when it tries to emit the function for aShaderNode
created by default for thesurfaceshader
input. This is due to the fact that this node has no implementation and code tries to read through these null implementations.Example
Initial Triage
ShaderNode
was being created based on thesurfacematerial
nodedef signature instead of just failed during initlaShaderGraph
creation time. This would avoid trying to parse this node to get it's implementation later on inside theMaterialNode
implementation.Note: There are pre-checks for this in integrations but it seems that this check should exist within code-generation to not try and create a dummy surface shader as not sure what it means to have a material with no surface shader but have a displacement shader?