Shader/SanitizeVisitor: Fix an issue when double-sanitizing

... with differents parameters (like reducing loops to while, which introduces new variables which would take over existing var indices)
This commit is contained in:
Jérôme Leclercq
2022-03-10 12:44:47 +01:00
parent bf7f06ac4c
commit 98bd04e35a
5 changed files with 174 additions and 7 deletions

View File

@@ -32,12 +32,12 @@ namespace Nz
supportedStageType |= stageType;
};
callbacks.onOptionDeclaration = [&](const std::string& optionName, const ShaderAst::ExpressionValue<ShaderAst::ExpressionType>& optionType)
callbacks.onOptionDeclaration = [&](const ShaderAst::DeclareOptionStatement& option)
{
//TODO: Check optionType
m_optionIndexByName[optionName] = Option{
CRC32(optionName)
m_optionIndexByName[option.optName] = Option{
CRC32(option.optName)
};
optionCount++;