Shader: Rework Swizzle and add support for swizzle store in SPIRV

This commit is contained in:
Jérôme Leclercq
2021-12-21 14:30:47 +01:00
parent e43a638112
commit 837b72f68e
11 changed files with 151 additions and 102 deletions

View File

@@ -881,27 +881,9 @@ namespace Nz
Visit(node.expression, true);
Append(".");
const char* componentStr = "xyzw";
for (std::size_t i = 0; i < node.componentCount; ++i)
{
switch (node.components[i])
{
case ShaderAst::SwizzleComponent::First:
Append("x");
break;
case ShaderAst::SwizzleComponent::Second:
Append("y");
break;
case ShaderAst::SwizzleComponent::Third:
Append("z");
break;
case ShaderAst::SwizzleComponent::Fourth:
Append("w");
break;
}
}
Append(componentStr[node.components[i]]);
}
void LangWriter::Visit(ShaderAst::VariableExpression& node)