1010#include < MaterialXGenHw/Nodes/HwLightCompoundNode.h>
1111#include < MaterialXGenHw/Nodes/HwMaterialCompoundNode.h>
1212#include < MaterialXGenShader/Exception.h>
13+ #include < MaterialXGenShader/NodeGraphTopology.h>
1314#include < MaterialXGenShader/Nodes/CompoundNode.h>
1415#include < MaterialXGenShader/GenContext.h>
1516#include < MaterialXGenShader/Shader.h>
@@ -391,7 +392,9 @@ void HwShaderGenerator::addStageLightingUniforms(GenContext& context, ShaderStag
391392 numActiveLights->setValue (Value::createValue<int >(0 ));
392393 }
393394}
394- ShaderNodeImplPtr HwShaderGenerator::createShaderNodeImplForNodeGraph (const NodeGraph& nodegraph) const
395+ ShaderNodeImplPtr HwShaderGenerator::createShaderNodeImplForNodeGraph (
396+ const NodeGraph& nodegraph,
397+ std::unique_ptr<NodeGraphPermutation> permutation) const
395398{
396399 vector<OutputPtr> outputs = nodegraph.getActiveOutputs ();
397400 if (outputs.empty ())
@@ -404,15 +407,15 @@ ShaderNodeImplPtr HwShaderGenerator::createShaderNodeImplForNodeGraph(const Node
404407 // Use specialized implementations for nodes that output light shaders and materials.
405408 if (outputType == Type::LIGHTSHADER)
406409 {
410+ // HwLightCompoundNode doesn't support permutations (light shaders don't have lobe weights)
407411 return HwLightCompoundNode::create ();
408412 }
409413 if (outputType == Type::MATERIAL)
410414 {
411415 return HwMaterialCompoundNode::create ();
412416 }
413417
414- // Use the base implementation for nodes that output other types.
415- return CompoundNode::create ();
418+ return CompoundNode::create (std::move (permutation));
416419}
417420
418421void HwShaderGenerator::emitClosureDataArg (const ShaderNode& node, GenContext& /* context*/ , ShaderStage& stage) const
0 commit comments