Shader: Add support for exported functions

This commit is contained in:
Jérôme Leclercq
2022-03-14 18:00:02 +01:00
parent 1c4ce75aa0
commit bf44672354
14 changed files with 170 additions and 67 deletions

View File

@@ -194,8 +194,7 @@ namespace Nz
void LangWriter::Append(const ShaderAst::FunctionType& functionType)
{
const std::string& targetName = Retrieve(m_currentState->functions, functionType.funcIndex).name;
Append(targetName);
throw std::runtime_error("unexpected function type");
}
void LangWriter::Append(const ShaderAst::IdentifierType& identifierType)
@@ -971,7 +970,7 @@ namespace Nz
void LangWriter::Visit(ShaderAst::FunctionExpression& node)
{
Append(Retrieve(m_currentState->functions, node.funcId).name);
AppendIdentifier(m_currentState->functions, node.funcId);
}
void LangWriter::Visit(ShaderAst::IdentifierExpression& node)