Shader: Add initial support for arrays

This commit is contained in:
Jérôme Leclercq
2022-01-01 23:01:31 +01:00
parent 89c7bbf197
commit 1f15328fdd
22 changed files with 781 additions and 57 deletions

View File

@@ -8,7 +8,7 @@
namespace Nz::ShaderAst
{
template<typename T>
AttributeValue<T> AstCloner::CloneAttribute(const AttributeValue<T>& attribute)
AttributeValue<T> AstCloner::Clone(const AttributeValue<T>& attribute)
{
if (!attribute.HasValue())
return {};
@@ -38,6 +38,14 @@ namespace Nz::ShaderAst
return CloneStatement(*statement);
}
template<typename T>
AttributeValue<T> Clone(const AttributeValue<T>& attribute)
{
AstCloner cloner;
return cloner.Clone(attribute);
}
inline ExpressionPtr Clone(Expression& node)
{
AstCloner cloner;