Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions source/MaterialXGenShader/ShaderGraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ void ShaderGraph::createConnectedNodes(const ElementPtr& downstreamElement,
{
continue;
}

InputPtr graphInput = activeInput->getInterfaceInput();
if (graphInput && graphInput->hasDefaultGeomPropString())
{
Expand Down Expand Up @@ -978,9 +978,9 @@ void ShaderGraph::optimize(GenContext& context)
{
if (node->hasClassification(ShaderNode::Classification::CONSTANT))
{
if (node->numInputs() == 0)
if (node->numInputs() != 1 || node->numOutputs() != 1)
{
// Cannot elide a constant node with no inputs.
// Constant node doesn't follow expected interface, cannot elide.
continue;
}
// Constant nodes can be elided by moving their value downstream.
Expand All @@ -1003,9 +1003,9 @@ void ShaderGraph::optimize(GenContext& context)
}
else if (node->hasClassification(ShaderNode::Classification::DOT))
{
if (node->numInputs() == 0)
if (node->numOutputs() != 1)
{
// Cannot elide a dot node with no inputs.
// Dot node dosen't follow expected interface, cannot elide.
continue;
}
// Filename dot nodes must be elided so they do not create extra samplers.
Expand Down