Shader: backport struct fix from phong-lighting

This commit is contained in:
Lynix 2022-01-19 20:44:32 +01:00
parent 9f05a22db7
commit f0b6f2122d
2 changed files with 4 additions and 1 deletions

View File

@ -202,7 +202,7 @@ namespace Nz::ShaderAst
else else
accessIdentifierPtr = static_cast<AccessIdentifierExpression*>(indexedExpr.get()); accessIdentifierPtr = static_cast<AccessIdentifierExpression*>(indexedExpr.get());
accessIdentifierPtr->identifiers.push_back(s->members[fieldIndex].name); accessIdentifierPtr->identifiers.push_back(fieldPtr->name);
accessIdentifierPtr->cachedExpressionType = ResolveType(fieldPtr->type); accessIdentifierPtr->cachedExpressionType = ResolveType(fieldPtr->type);
} }
else else

View File

@ -1118,6 +1118,9 @@ namespace Nz
bool first = true; bool first = true;
for (const auto& member : node.description.members) for (const auto& member : node.description.members)
{ {
if (member.cond.HasValue() && !member.cond.GetResultingValue())
continue;
if (!first) if (!first)
AppendLine(); AppendLine();