Skip to content

Commit

Permalink
Improve robustness of TypeDesc pointer comparisons (#1665)
Browse files Browse the repository at this point in the history
- The globals presets defined for TypeDesc are pointers which may not be shared between shared modules. This occurs for instance in Python where the pointers are declared locally for each module.
- Any pointer comparison between the same TypeDesc preset can thus result in a failure status.
  • Loading branch information
kwokcb authored Jan 21, 2024
1 parent 98eaae0 commit ab08c66
Show file tree
Hide file tree
Showing 38 changed files with 101 additions and 85 deletions.
2 changes: 1 addition & 1 deletion source/MaterialXGenGlsl/GlslResourceBindingContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ void GlslResourceBindingContext::emitResourceBindings(GenContext& context, const
// Second, emit all sampler uniforms as separate uniforms with separate layout bindings
for (auto uniform : uniforms.getVariableOrder())
{
if (uniform->getType() == Type::FILENAME)
if (*uniform->getType() == *Type::FILENAME)
{
generator.emitString("layout (binding=" + std::to_string(_separateBindingLocation ? _hwUniformBindLocation++ : _hwSamplerBindLocation++) + ") " + syntax.getUniformQualifier() + " ", stage);
generator.emitVariableDeclaration(uniform, EMPTY_STRING, context, stage, false);
Expand Down
10 changes: 5 additions & 5 deletions source/MaterialXGenGlsl/GlslShaderGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -782,11 +782,11 @@ void GlslShaderGenerator::toVec4(const TypeDesc* type, string& variable)
{
variable = "vec4(" + variable + ", 0.0, 1.0)";
}
else if (type == Type::FLOAT || type == Type::INTEGER)
else if (*type == *Type::FLOAT || *type == *Type::INTEGER)
{
variable = "vec4(" + variable + ", " + variable + ", " + variable + ", 1.0)";
}
else if (type == Type::BSDF || type == Type::EDF)
else if (*type == *Type::BSDF || *type == *Type::EDF)
{
variable = "vec4(" + variable + ", 1.0)";
}
Expand All @@ -802,7 +802,7 @@ void GlslShaderGenerator::emitVariableDeclaration(const ShaderPort* variable, co
bool assignValue) const
{
// A file texture input needs special handling on GLSL
if (variable->getType() == Type::FILENAME)
if (*variable->getType() == *Type::FILENAME)
{
// Samplers must always be uniforms
string str = qualifier.empty() ? EMPTY_STRING : qualifier + " ";
Expand All @@ -813,7 +813,7 @@ void GlslShaderGenerator::emitVariableDeclaration(const ShaderPort* variable, co
string str = qualifier.empty() ? EMPTY_STRING : qualifier + " ";
// Varying parameters of type int must be flat qualified on output from vertex stage and
// input to pixel stage. The only way to get these is with geompropvalue_integer nodes.
if (qualifier.empty() && variable->getType() == Type::INTEGER && !assignValue && variable->getName().rfind(HW::T_IN_GEOMPROP, 0) == 0)
if (qualifier.empty() && *variable->getType() == *Type::INTEGER && !assignValue && variable->getName().rfind(HW::T_IN_GEOMPROP, 0) == 0)
{
str += GlslSyntax::FLAT_QUALIFIER + " ";
}
Expand Down Expand Up @@ -870,7 +870,7 @@ ShaderNodeImplPtr GlslShaderGenerator::getImplementation(const NodeDef& nodedef,
if (implElement->isA<NodeGraph>())
{
// Use a compound implementation.
if (outputType == Type::LIGHTSHADER)
if (*outputType == *Type::LIGHTSHADER)
{
impl = LightCompoundNodeGlsl::create();
}
Expand Down
2 changes: 1 addition & 1 deletion source/MaterialXGenGlsl/GlslSyntax.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ bool GlslSyntax::remapEnumeration(const string& value, const TypeDesc* type, con
// Don't convert already supported types
// or filenames and arrays.
if (typeSupported(type) ||
type == Type::FILENAME || (type && type->isArray()))
*type == *Type::FILENAME || (type && type->isArray()))
{
return false;
}
Expand Down
4 changes: 2 additions & 2 deletions source/MaterialXGenGlsl/Nodes/GeomColorNodeGlsl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ void GeomColorNodeGlsl::emitFunctionCall(const ShaderNode& node, GenContext& con
DEFINE_SHADER_STAGE(stage, Stage::PIXEL)
{
string suffix = "";
if (output->getType() == Type::FLOAT)
if (*output->getType() == *Type::FLOAT)
{
suffix = ".r";
}
else if (output->getType() == Type::COLOR3)
else if (*output->getType() == *Type::COLOR3)
{
suffix = ".rgb";
}
Expand Down
2 changes: 1 addition & 1 deletion source/MaterialXGenGlsl/Nodes/HeightToNormalNodeGlsl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ void HeightToNormalNodeGlsl::computeSampleOffsetStrings(const string& sampleSize
bool HeightToNormalNodeGlsl::acceptsInputType(const TypeDesc* type) const
{
// Only support inputs which are float scalar
return (type == Type::FLOAT && type->isScalar());
return (*type == *Type::FLOAT && type->isScalar());
}

void HeightToNormalNodeGlsl::emitFunctionDefinition(const ShaderNode&, GenContext& context, ShaderStage& stage) const
Expand Down
2 changes: 1 addition & 1 deletion source/MaterialXGenGlsl/VkResourceBindingContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ void VkResourceBindingContext::emitResourceBindings(GenContext& context, const V
// Second, emit all sampler uniforms as separate uniforms with separate layout bindings
for (auto uniform : uniforms.getVariableOrder())
{
if (uniform->getType() == Type::FILENAME)
if (*uniform->getType() == *Type::FILENAME)
{
generator.emitString("layout (binding=" + std::to_string(_hwUniformBindLocation++) + ") " + syntax.getUniformQualifier() + " ", stage);
generator.emitVariableDeclaration(uniform, EMPTY_STRING, context, stage, false);
Expand Down
4 changes: 2 additions & 2 deletions source/MaterialXGenMdl/MdlShaderGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ ShaderPtr MdlShaderGenerator::generate(const string& name, ElementPtr element, G
const TypeDesc* outputType = outputSocket->getType();
if (graph.hasClassification(ShaderNode::Classification::TEXTURE))
{
if (outputType == Type::DISPLACEMENTSHADER)
if (*outputType == *Type::DISPLACEMENTSHADER)
{
emitLine("float3 displacement__ = " + result + ".geometry.displacement", stage);
emitLine("color finalOutput__ = mk_color3("
Expand Down Expand Up @@ -667,7 +667,7 @@ void MdlShaderGenerator::emitShaderInputs(const VariableBlock& inputs, ShaderSta
{
const ShaderPort* input = inputs[i];

const string& qualifier = input->isUniform() || input->getType() == Type::FILENAME ? uniformPrefix : EMPTY_STRING;
const string& qualifier = input->isUniform() || *input->getType() == *Type::FILENAME ? uniformPrefix : EMPTY_STRING;
const string& type = _syntax->getTypeName(input->getType());

string value = input->getValue() ? _syntax->getValue(input->getType(), *input->getValue(), true) : EMPTY_STRING;
Expand Down
6 changes: 3 additions & 3 deletions source/MaterialXGenMdl/MdlSyntax.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ const std::unordered_map<char, char> CHANNELS_TO_XYZW =

string MdlSyntax::getSwizzledVariable(const string& srcName, const TypeDesc* srcType, const string& channels, const TypeDesc* dstType) const
{
if (srcType == Type::COLOR3 || srcType == Type::COLOR4)
if (*srcType == *Type::COLOR3 || *srcType == *Type::COLOR4)
{
const TypeSyntax& srcSyntax = getTypeSyntax(srcType);
const TypeSyntax& dstSyntax = getTypeSyntax(dstType);
Expand Down Expand Up @@ -523,7 +523,7 @@ string MdlSyntax::getSwizzledVariable(const string& srcName, const TypeDesc* src
}

string variable = srcName;
if (srcType == Type::COLOR3)
if (*srcType == *Type::COLOR3)
{
variable = "float3(" + srcName + ")";
}
Expand Down Expand Up @@ -567,7 +567,7 @@ bool MdlSyntax::remapEnumeration(const string& value, const TypeDesc* type, cons
}

// Don't convert filenames or arrays.
if (type == Type::FILENAME || (type && type->isArray()))
if (*type == *Type::FILENAME || (type && type->isArray()))
{
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion source/MaterialXGenMdl/Nodes/ClosureLayerNodeMdl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ void ClosureLayerNodeMdl::emitFunctionCall(const ShaderNode& _node, GenContext&
//
// 1. Handle the BSDF-over-VDF case
//
if (baseInput->getType() == Type::VDF)
if (*baseInput->getType() == *Type::VDF)
{
// Make sure we have a top BSDF connected.
if (!topInput->getConnection())
Expand Down
4 changes: 2 additions & 2 deletions source/MaterialXGenMdl/Nodes/CombineNodeMdl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ void CombineNodeMdl::emitFunctionCall(const ShaderNode& node, GenContext& contex
throw ExceptionShaderGenError("Node '" + node.getName() + "' is not a valid convert node");
}

if (in1->getType() == Type::COLOR3)
if (*in1->getType() == *Type::COLOR3)
{
const ShaderInput* in2 = node.getInput(1);
if (!in2 || in2->getType() != Type::FLOAT)
if (!in2 || *in2->getType() != *Type::FLOAT)
{
throw ExceptionShaderGenError("Node '" + node.getName() + "' is not a valid convert node");
}
Expand Down
2 changes: 1 addition & 1 deletion source/MaterialXGenMdl/Nodes/CompoundNodeMdl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ void CompoundNodeMdl::emitFunctionSignature(const ShaderNode&, GenContext& conte
int count = int(_rootGraph->numInputSockets());
for (ShaderGraphInputSocket* input : _rootGraph->getInputSockets())
{
const string& qualifier = input->isUniform() || input->getType() == Type::FILENAME ? uniformPrefix : EMPTY_STRING;
const string& qualifier = input->isUniform() || *input->getType() == *Type::FILENAME ? uniformPrefix : EMPTY_STRING;
const string& type = syntax.getTypeName(input->getType());

string value = input->getValue() ? syntax.getValue(input->getType(), *input->getValue(), true) : EMPTY_STRING;
Expand Down
2 changes: 1 addition & 1 deletion source/MaterialXGenMdl/Nodes/HeightToNormalNodeMdl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ void HeightToNormalNodeMdl::computeSampleOffsetStrings(const string& sampleSizeN
bool HeightToNormalNodeMdl::acceptsInputType(const TypeDesc* type) const
{
// Only support inputs which are float scalar
return (type == Type::FLOAT && type->isScalar());
return (*type == *Type::FLOAT && type->isScalar());
}

void HeightToNormalNodeMdl::emitFunctionCall(const ShaderNode& node, GenContext& context, ShaderStage& stage) const
Expand Down
2 changes: 1 addition & 1 deletion source/MaterialXGenMdl/Nodes/SurfaceNodeMdl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const ShaderInput* findTransmissionIOR(const ShaderNode& node)
}
for (const ShaderInput* input : node.getInputs())
{
if (input->getType() == Type::BSDF && input->getConnection())
if (*input->getType() == *Type::BSDF && input->getConnection())
{
const ShaderInput* ior = findTransmissionIOR(*input->getConnection()->getNode());
if (ior)
Expand Down
12 changes: 6 additions & 6 deletions source/MaterialXGenMsl/MslShaderGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ void MslShaderGenerator::emitGlobalVariables(GenContext& context,
bool hasUniforms = false;
for (const ShaderPort* uniform : uniforms.getVariableOrder())
{
if (uniform->getType() == Type::FILENAME)
if (*uniform->getType() == *Type::FILENAME)
{
emitString(separator, stage);
emitString("texture2d<float> " + TEXTURE_NAME(uniform->getVariable()), stage);
Expand Down Expand Up @@ -1282,11 +1282,11 @@ void MslShaderGenerator::toVec4(const TypeDesc* type, string& variable)
{
variable = "float4(" + variable + ", 0.0, 1.0)";
}
else if (type == Type::FLOAT || type == Type::INTEGER)
else if (*type == *Type::FLOAT || *type == *Type::INTEGER)
{
variable = "float4(" + variable + ", " + variable + ", " + variable + ", 1.0)";
}
else if (type == Type::BSDF || type == Type::EDF)
else if (*type == *Type::BSDF || *type == *Type::EDF)
{
variable = "float4(" + variable + ", 1.0)";
}
Expand All @@ -1302,7 +1302,7 @@ void MslShaderGenerator::emitVariableDeclaration(const ShaderPort* variable, con
bool assignValue) const
{
// A file texture input needs special handling on MSL
if (variable->getType() == Type::FILENAME)
if (*variable->getType() == *Type::FILENAME)
{
// Samplers must always be uniforms
string str = qualifier.empty() ? EMPTY_STRING : qualifier + " ";
Expand All @@ -1327,7 +1327,7 @@ void MslShaderGenerator::emitVariableDeclaration(const ShaderPort* variable, con

// Varying parameters of type int must be flat qualified on output from vertex stage and
// input to pixel stage. The only way to get these is with geompropvalue_integer nodes.
if (qualifier.empty() && variable->getType() == Type::INTEGER && !assignValue && variable->getName().rfind(HW::T_IN_GEOMPROP, 0) == 0)
if (qualifier.empty() && *variable->getType() == *Type::INTEGER && !assignValue && variable->getName().rfind(HW::T_IN_GEOMPROP, 0) == 0)
{
str += "[[ " + MslSyntax::FLAT_QUALIFIER + " ]]";
}
Expand Down Expand Up @@ -1372,7 +1372,7 @@ ShaderNodeImplPtr MslShaderGenerator::getImplementation(const NodeDef& nodedef,
if (implElement->isA<NodeGraph>())
{
// Use a compound implementation.
if (outputType == Type::LIGHTSHADER)
if (*outputType == *Type::LIGHTSHADER)
{
impl = LightCompoundNodeMsl::create();
}
Expand Down
2 changes: 1 addition & 1 deletion source/MaterialXGenMsl/MslSyntax.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ bool MslSyntax::remapEnumeration(const string& value, const TypeDesc* type, cons
// Don't convert already supported types
// or filenames and arrays.
if (typeSupported(type) ||
type == Type::FILENAME || (type && type->isArray()))
*type == *Type::FILENAME || (type && type->isArray()))
{
return false;
}
Expand Down
4 changes: 2 additions & 2 deletions source/MaterialXGenMsl/Nodes/GeomColorNodeMsl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ void GeomColorNodeMsl::emitFunctionCall(const ShaderNode& node, GenContext& cont
DEFINE_SHADER_STAGE(stage, Stage::PIXEL)
{
string suffix = "";
if (output->getType() == Type::FLOAT)
if (*output->getType() == *Type::FLOAT)
{
suffix = ".r";
}
else if (output->getType() == Type::COLOR3)
else if (*output->getType() == *Type::COLOR3)
{
suffix = ".rgb";
}
Expand Down
2 changes: 1 addition & 1 deletion source/MaterialXGenMsl/Nodes/HeightToNormalNodeMsl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ void HeightToNormalNodeMsl::computeSampleOffsetStrings(const string& sampleSizeN
bool HeightToNormalNodeMsl::acceptsInputType(const TypeDesc* type) const
{
// Only support inputs which are float scalar
return (type == Type::FLOAT && type->isScalar());
return (*type == *Type::FLOAT && type->isScalar());
}

void HeightToNormalNodeMsl::emitFunctionDefinition(const ShaderNode&, GenContext& context, ShaderStage& stage) const
Expand Down
2 changes: 1 addition & 1 deletion source/MaterialXGenOsl/Nodes/ClosureLayerNodeOsl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ void ClosureLayerNodeOsl::emitFunctionCall(const ShaderNode& _node, GenContext&

// Calculate the layering result.
emitOutputVariables(node, context, stage);
if (base->getOutput()->getType() == Type::VDF)
if (*base->getOutput()->getType() == *Type::VDF)
{
// Combining a surface closure with a volumetric closure is simply done with the add operator in OSL.
shadergen.emitLine(output->getVariable() + ".response = " + topResult + ".response + " + baseResult, stage);
Expand Down
12 changes: 6 additions & 6 deletions source/MaterialXGenOsl/OslShaderGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,11 +196,11 @@ ShaderPtr OslShaderGenerator::generate(const string& name, ElementPtr element, G
// Emit shader type, determined from the first
// output if there are multiple outputs.
const ShaderGraphOutputSocket* outputSocket0 = graph.getOutputSocket(0);
if (outputSocket0->getType() == Type::SURFACESHADER)
if (*outputSocket0->getType() == *Type::SURFACESHADER)
{
emitString("surface ", stage);
}
else if (outputSocket0->getType() == Type::VOLUMESHADER)
else if (*outputSocket0->getType() == *Type::VOLUMESHADER)
{
emitString("volume ", stage);
}
Expand Down Expand Up @@ -250,10 +250,10 @@ ShaderPtr OslShaderGenerator::generate(const string& name, ElementPtr element, G
const VariableBlock& outputs = stage.getOutputBlock(OSL::OUTPUTS);
const ShaderPort* singleOutput = outputs.size() == 1 ? outputs[0] : NULL;

const bool isSurfaceShaderOutput = singleOutput && singleOutput->getType() == Type::SURFACESHADER;
const bool isSurfaceShaderOutput = singleOutput && *singleOutput->getType() == *Type::SURFACESHADER;

#ifdef MATERIALX_OSL_LEGACY_CLOSURES
const bool isBsdfOutput = singleOutput && singleOutput->getType() == Type::BSDF;
const bool isBsdfOutput = singleOutput && *singleOutput->getType() == *Type::BSDF;
#endif

if (isSurfaceShaderOutput)
Expand Down Expand Up @@ -301,7 +301,7 @@ ShaderPtr OslShaderGenerator::generate(const string& name, ElementPtr element, G
for (size_t i = 0; i < inputs.size(); ++i)
{
ShaderPort* input = inputs[i];
if (input->getType() == Type::FILENAME)
if (*input->getType() == *Type::FILENAME)
{
// Construct the textureresource variable.
const string newVariableName = input->getVariable() + "_";
Expand Down Expand Up @@ -529,7 +529,7 @@ void OslShaderGenerator::emitShaderInputs(const VariableBlock& inputs, ShaderSta
const ShaderPort* input = inputs[i];
const string& type = _syntax->getTypeName(input->getType());

if (input->getType() == Type::FILENAME)
if (*input->getType() == *Type::FILENAME)
{
// Shader inputs of type 'filename' (textures) need special handling.
// In OSL codegen a 'filename' is translated to the custom type 'textureresource',
Expand Down
2 changes: 1 addition & 1 deletion source/MaterialXGenShader/HwShaderGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ ShaderPtr HwShaderGenerator::createShader(const string& name, ElementPtr element
{
for (ShaderInput* input : node->getInputs())
{
if (!input->getConnection() && input->getType() == Type::FILENAME)
if (!input->getConnection() && *input->getType() == *Type::FILENAME)
{
// Create the uniform using the filename type to make this uniform into a texture sampler.
ShaderPort* filename = psPublicUniforms->add(Type::FILENAME, input->getVariable(), input->getValue());
Expand Down
2 changes: 1 addition & 1 deletion source/MaterialXGenShader/Nodes/BlurNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ void BlurNode::computeSampleOffsetStrings(const string& sampleSizeName, const st
bool BlurNode::acceptsInputType(const TypeDesc* type) const
{
// Float 1-4 is acceptable as input
return ((type == Type::FLOAT && type->isScalar()) ||
return ((*type == *Type::FLOAT && type->isScalar()) ||
type->isFloat2() || type->isFloat3() || type->isFloat4());
}

Expand Down
4 changes: 2 additions & 2 deletions source/MaterialXGenShader/Nodes/ClosureAddNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ void ClosureAddNode::emitFunctionCall(const ShaderNode& _node, GenContext& conte
const string in2Result = shadergen.getUpstreamResult(in2, context);

ShaderOutput* output = node.getOutput();
if (output->getType() == Type::BSDF)
if (*output->getType() == *Type::BSDF)
{
emitOutputVariables(node, context, stage);
shadergen.emitLine(output->getVariable() + ".response = " + in1Result + ".response + " + in2Result + ".response", stage);
shadergen.emitLine(output->getVariable() + ".throughput = " + in1Result + ".throughput * " + in2Result + ".throughput", stage);
}
else if (output->getType() == Type::EDF)
else if (*output->getType() == *Type::EDF)
{
shadergen.emitLine(shadergen.getSyntax().getTypeName(Type::EDF) + " " + output->getVariable() + " = " + in1Result + " + " + in2Result, stage);
}
Expand Down
2 changes: 1 addition & 1 deletion source/MaterialXGenShader/Nodes/ClosureCompoundNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ void ClosureCompoundNode::emitFunctionCall(const ShaderNode& node, GenContext& c

// Check if extra parameters has been added for this node.
const ClosureContext::ClosureParams* params = cct->getClosureParams(&node);
if (closureType == Type::BSDF && params)
if (*closureType == *Type::BSDF && params)
{
// Assign the parameters to the BSDF.
for (auto it : *params)
Expand Down
2 changes: 1 addition & 1 deletion source/MaterialXGenShader/Nodes/ClosureLayerNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ void ClosureLayerNode::emitFunctionCall(const ShaderNode& _node, GenContext& con

// Calculate the layering result.
emitOutputVariables(node, context, stage);
if (base->getOutput()->getType() == Type::VDF)
if (*(base->getOutput()->getType()) == *Type::VDF)
{
shadergen.emitLine(output->getVariable() + ".response = " + topResult + ".response * " + baseResult + ".throughput", stage);
shadergen.emitLine(output->getVariable() + ".throughput = " + topResult + ".throughput * " + baseResult + ".throughput", stage);
Expand Down
4 changes: 2 additions & 2 deletions source/MaterialXGenShader/Nodes/ClosureMixNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@ void ClosureMixNode::emitFunctionCall(const ShaderNode& _node, GenContext& conte
const string mixResult = shadergen.getUpstreamResult(mix, context);

ShaderOutput* output = node.getOutput();
if (output->getType() == Type::BSDF)
if (*output->getType() == *Type::BSDF)
{
emitOutputVariables(node, context, stage);
shadergen.emitLine(output->getVariable() + ".response = mix(" + bgResult + ".response, " + fgResult + ".response, " + mixResult + ")", stage);
shadergen.emitLine(output->getVariable() + ".throughput = mix(" + bgResult + ".throughput, " + fgResult + ".throughput, " + mixResult + ")", stage);
}
else if (output->getType() == Type::EDF)
else if (*output->getType() == *Type::EDF)
{
shadergen.emitLine(shadergen.getSyntax().getTypeName(Type::EDF) + " " + output->getVariable() + " = mix(" + bgResult + ", " + fgResult + ", " + mixResult + ")", stage);
}
Expand Down
Loading

0 comments on commit ab08c66

Please sign in to comment.