Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(638)

Unified Diff: src/sksl/SkSLSPIRVCodeGenerator.cpp

Issue 2405383003: added basic dataflow analysis to skslc (Closed)
Patch Set: I have no idea what I was thinking Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/sksl/SkSLSPIRVCodeGenerator.h ('k') | src/sksl/ir/SkSLExpression.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/sksl/SkSLSPIRVCodeGenerator.cpp
diff --git a/src/sksl/SkSLSPIRVCodeGenerator.cpp b/src/sksl/SkSLSPIRVCodeGenerator.cpp
index 5403ba362814057ad46e2047d96a3f730b4a54c8..a4919686742f20c006b2a39f933e2aeb0184b228 100644
--- a/src/sksl/SkSLSPIRVCodeGenerator.cpp
+++ b/src/sksl/SkSLSPIRVCodeGenerator.cpp
@@ -2529,8 +2529,10 @@ void SPIRVCodeGenerator::writeForStatement(const ForStatement& f, std::ostream&
this->writeInstruction(SpvOpLoopMerge, end, next, SpvLoopControlMaskNone, out);
this->writeInstruction(SpvOpBranch, start, out);
this->writeLabel(start, out);
- SpvId test = this->writeExpression(*f.fTest, out);
- this->writeInstruction(SpvOpBranchConditional, test, body, end, out);
+ if (f.fTest) {
+ SpvId test = this->writeExpression(*f.fTest, out);
+ this->writeInstruction(SpvOpBranchConditional, test, body, end, out);
+ }
this->writeLabel(body, out);
this->writeStatement(*f.fStatement, out);
if (fCurrentBlock) {
« no previous file with comments | « src/sksl/SkSLSPIRVCodeGenerator.h ('k') | src/sksl/ir/SkSLExpression.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698