Merge pull request #981 from jbrodman/maskoffunif

Add assignments to Uniform as an unsafe thing when checking to run with ...
This commit is contained in:
Dmitry Babokin
2015-03-03 21:47:13 +03:00

14
ast.cpp
View File

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