diff --git a/ast.cpp b/ast.cpp index 00e81aa5..aa6da5eb 100644 --- a/ast.cpp +++ b/ast.cpp @@ -477,6 +477,20 @@ lCheckAllOffSafety(ASTNode *node, void *data) { return false; } + /* + Don't allow turning if/else to straight-line-code if we + assign to a uniform. + */ + AssignExpr *ae; + if ((ae = dynamic_cast(node)) != NULL) { + if (ae->GetType()) { + if (ae->GetType()->IsUniformType()) { + *okPtr = false; + return false; + } + } + } + return true; }