Skip to content
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

Upgrade switch node to ten inputs in 1.39 #1660

Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fix incorrectly indexed 'width' parameter in Switch node shader gen code
ld-kerley committed Jan 19, 2024
commit a17328c96c1c478fb1f628f3dfddb63b15e3a359
4 changes: 2 additions & 2 deletions source/MaterialXGenShader/Nodes/SwitchNode.cpp
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@

MATERIALX_NAMESPACE_BEGIN

const StringVec SwitchNode::INPUT_NAMES = { "in1", "in2", "in3", "in4", "in5", "in6", "in7", "in8", "in9", "in10", "which" };
const StringVec SwitchNode::INPUT_NAMES = { "in1", "in2", "in3", "in4", "in5", "in6", "in7", "in8", "in9", "in10" };

ShaderNodeImplPtr SwitchNode::create()
{
@@ -29,7 +29,7 @@ void SwitchNode::emitFunctionCall(const ShaderNode& node, GenContext& context, S
shadergen.emitOutput(node.getOutput(), true, true, context, stage);
shadergen.emitLineEnd(stage);

const ShaderInput* which = node.getInput(INPUT_NAMES[5]);
const ShaderInput* which = node.getInput("which");

// Process the branches of the switch node
for (int branch = 0; branch < 10; ++branch)