Skip to content

Commit 48e9a5f

Browse files
Rename setDefaultOptions to applyDefaultOptions for clarity
1 parent ca7d74a commit 48e9a5f

7 files changed

Lines changed: 12 additions & 12 deletions

File tree

source/MaterialXGenHw/HwShaderGenerator.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,9 @@ HwShaderGenerator::HwShaderGenerator(TypeSystemPtr typeSystem, SyntaxPtr syntax)
8888
_tokenSubstitutions[HW::T_CLOSURE_DATA_CONSTRUCTOR] = HW::CLOSURE_DATA_CONSTRUCTOR;
8989
}
9090

91-
void HwShaderGenerator::setDefaultOptions(GenOptions& options) const
91+
void HwShaderGenerator::applyDefaultOptions(GenOptions& options) const
9292
{
93-
ShaderGenerator::setDefaultOptions(options);
93+
ShaderGenerator::applyDefaultOptions(options);
9494
options.premultipliedBsdfAdd = true;
9595
}
9696

source/MaterialXGenHw/HwShaderGenerator.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ class MX_GENHW_API HwShaderGenerator : public ShaderGenerator
4343
void emitClosureDataArg(const ShaderNode& node, GenContext& context, ShaderStage& stage) const override;
4444
void emitClosureDataParameter(const ShaderNode& node, GenContext& context, ShaderStage& stage) const override;
4545

46-
/// Set the default GenOptions for hardware shader generation.
47-
void setDefaultOptions(GenOptions& options) const override;
46+
/// Apply the default GenOptions for hardware shader generation.
47+
void applyDefaultOptions(GenOptions& options) const override;
4848

4949
/// Logic to indicate whether code to support direct lighting should be emitted.
5050
/// By default if the graph is classified as a shader, or BSDF node then lighting is assumed to be required.

source/MaterialXGenMdl/MdlShaderGenerator.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,9 @@ MdlShaderGenerator::MdlShaderGenerator(TypeSystemPtr typeSystem) :
125125
registerImplementation("IM_image_vector4_" + MdlShaderGenerator::TARGET, ImageNodeMdl::create);
126126
}
127127

128-
void MdlShaderGenerator::setDefaultOptions(GenOptions& options) const
128+
void MdlShaderGenerator::applyDefaultOptions(GenOptions& options) const
129129
{
130-
ShaderGenerator::setDefaultOptions(options);
130+
ShaderGenerator::applyDefaultOptions(options);
131131
options.distributeLayerOverBsdfMix = true;
132132
}
133133

source/MaterialXGenMdl/MdlShaderGenerator.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ class MX_GENMDL_API MdlShaderGenerator : public ShaderGenerator
7070
/// Return a unique identifier for the target this generator is for
7171
const string& getTarget() const override { return TARGET; }
7272

73-
/// Set the default GenOptions for MDL shader generation.
74-
void setDefaultOptions(GenOptions& options) const override;
73+
/// Apply the default GenOptions for MDL shader generation.
74+
void applyDefaultOptions(GenOptions& options) const override;
7575

7676
/// Generate a shader starting from the given element, translating
7777
/// the element and all dependencies upstream into shader code.

source/MaterialXGenShader/GenContext.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ GenContext::GenContext(ShaderGeneratorPtr sg) :
2121
}
2222

2323
// Apply the generator's default options for its target.
24-
_sg->setDefaultOptions(_options);
24+
_sg->applyDefaultOptions(_options);
2525

2626
// Collect and cache reserved words from the shader generator
2727
StringSet reservedWords;

source/MaterialXGenShader/ShaderGenerator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ ShaderGenerator::ShaderGenerator(TypeSystemPtr typeSystem, SyntaxPtr syntax) :
3838
registerRefactor(std::make_shared<DistributeLayerOverMixRefactor>());
3939
}
4040

41-
void ShaderGenerator::setDefaultOptions(GenOptions& /*options*/) const
41+
void ShaderGenerator::applyDefaultOptions(GenOptions& /*options*/) const
4242
{
4343
// Base implementation sets no additional defaults.
4444
// Derived generators override to set target-specific defaults.

source/MaterialXGenShader/ShaderGenerator.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,8 +227,8 @@ class MX_GENSHADER_API ShaderGenerator
227227
return _refactors;
228228
}
229229

230-
/// Set the default GenOptions for this generator's target.
231-
virtual void setDefaultOptions(GenOptions& options) const;
230+
/// Apply the default GenOptions for this generator's target.
231+
virtual void applyDefaultOptions(GenOptions& options) const;
232232

233233
/// Register type definitions from the document.
234234
virtual void registerTypeDefs(const DocumentPtr& doc);

0 commit comments

Comments
 (0)