Shader/ShaderLang: Add support for Unary operators

This commit is contained in:
Lynix
2021-05-16 23:07:25 +02:00
parent 1f05e950e8
commit 525f24af2e
30 changed files with 566 additions and 208 deletions

View File

@@ -78,6 +78,13 @@ namespace Nz
m_constantCache.Register(*m_constantCache.BuildType(node.cachedExpressionType.value()));
}
void Visit(ShaderAst::BinaryExpression& node) override
{
AstRecursiveVisitor::Visit(node);
m_constantCache.Register(*m_constantCache.BuildType(node.cachedExpressionType.value()));
}
void Visit(ShaderAst::ConditionalExpression& node) override
{
if (TestBit<Nz::UInt64>(m_states.enabledOptions, node.optionIndex))
@@ -294,6 +301,13 @@ namespace Nz
m_constantCache.Register(*m_constantCache.BuildType(node.cachedExpressionType.value()));
}
void Visit(ShaderAst::UnaryExpression& node) override
{
AstRecursiveVisitor::Visit(node);
m_constantCache.Register(*m_constantCache.BuildType(node.cachedExpressionType.value()));
}
UInt32 HandleEntryInOutType(ShaderStageType entryPointType, std::size_t funcIndex, const ShaderAst::StructDescription::StructMember& member, SpirvStorageClass storageClass)
{
if (member.builtin)