Shader/SPIRV: Add support for swizzling with one component

This commit is contained in:
Lynix
2021-12-18 15:51:20 +01:00
parent a6b8caa5ba
commit 9bd411e53c
4 changed files with 38 additions and 5 deletions

View File

@@ -357,6 +357,12 @@ namespace Nz
{
AstRecursiveVisitor::Visit(node);
for (std::size_t i = 0; i < node.componentCount; ++i)
{
Int32 indexCount = UnderlyingCast(node.components[i]) - UnderlyingCast(ShaderAst::SwizzleComponent::First);
m_constantCache.Register(*m_constantCache.BuildConstant(indexCount));
}
m_constantCache.Register(*m_constantCache.BuildType(node.cachedExpressionType.value()));
}