Skip to content

Commit 2224621

Browse files
authored
Fix MDL code gen after removing ClosureSourceCodeNode (AcademySoftwareFoundation#2465)
In AcademySoftwareFoundation#2400 the ClosureSourceCodeNode has been removed and replaced by the regular SourceCodeNode. For that to work, the SourceCodeNode needs to emit dependent function calls to generate code for the inputs.
1 parent 87c4a2b commit 2224621

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

source/MaterialXGenMdl/Nodes/SourceCodeNodeMdl.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,13 @@ void SourceCodeNodeMdl::emitFunctionCall(const ShaderNode& node, GenContext& con
7777
{
7878
const ShaderGenerator& shadergen = context.getShaderGenerator();
7979
const MdlShaderGenerator& shadergenMdl = static_cast<const MdlShaderGenerator&>(shadergen);
80+
81+
if (nodeOutputIsClosure(node))
82+
{
83+
// Emit calls for any closure dependencies upstream from this node.
84+
shadergen.emitDependentFunctionCalls(node, context, stage, ShaderNode::Classification::CLOSURE);
85+
}
86+
8087
if (_inlined)
8188
{
8289
const MdlSyntax& syntax = static_cast<const MdlSyntax&>(shadergenMdl.getSyntax());

0 commit comments

Comments
 (0)