From ab5bf7e48d5849b0333eb4d54dd5c4dec5a92af8 Mon Sep 17 00:00:00 2001 From: James Brodman Date: Mon, 2 Mar 2015 10:55:12 -0800 Subject: [PATCH] Add assignments to Uniform as an unsafe thing when checking to run with mask all off --- ast.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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; }