Shader: Implement const if and const values
This commit is contained in:
@@ -737,6 +737,8 @@ namespace Nz
|
||||
|
||||
void GlslWriter::Visit(ShaderAst::BranchStatement& node)
|
||||
{
|
||||
assert(!node.isConst);
|
||||
|
||||
bool first = true;
|
||||
for (const auto& statement : node.condStatements)
|
||||
{
|
||||
@@ -850,6 +852,11 @@ namespace Nz
|
||||
}, node.value);
|
||||
}
|
||||
|
||||
void GlslWriter::Visit(ShaderAst::DeclareConstStatement& /*node*/)
|
||||
{
|
||||
/* nothing to do */
|
||||
}
|
||||
|
||||
void GlslWriter::Visit(ShaderAst::DeclareExternalStatement& node)
|
||||
{
|
||||
assert(node.varIndex);
|
||||
@@ -1033,9 +1040,7 @@ namespace Nz
|
||||
assert(node.varIndex);
|
||||
RegisterVariable(*node.varIndex, node.varName);
|
||||
|
||||
Append(node.varType);
|
||||
Append(" ");
|
||||
Append(node.varName);
|
||||
Append(node.varType, " ", node.varName);
|
||||
if (node.initialExpression)
|
||||
{
|
||||
Append(" = ");
|
||||
|
||||
Reference in New Issue
Block a user