diff options
author | 2017-06-21 21:25:26 +0000 | |
---|---|---|
committer | 2017-06-21 21:25:43 +0000 | |
commit | e0a33e28e2786fb17be2edf28e04cd62bfe4ec1e (patch) | |
tree | b1b84386a5eba32f0b7e533a5ce1e26754e67d41 /src/sksl/SkSLGLSLCodeGenerator.cpp | |
parent | 93a2346dfa6a97e5631086082e74c7b38febf68b (diff) |
Revert "clean up sksl dead variable handling"
This reverts commit b29dd819c9f4cc0f33c24a10b128c363a4c83a6f.
Reason for revert: asan errors
Original change's description:
> clean up sksl dead variable handling
>
> Change-Id: I301e82bf87d976e59a02b0f383da67eaf5a8795a
> Reviewed-on: https://skia-review.googlesource.com/18494
> Reviewed-by: Chris Dalton <csmartdalton@google.com>
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
TBR=csmartdalton@google.com,ethannicholas@google.com
Change-Id: I32b3c6a04a014b31360d92b3f85491b01e8a381c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/20480
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'src/sksl/SkSLGLSLCodeGenerator.cpp')
-rw-r--r-- | src/sksl/SkSLGLSLCodeGenerator.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/sksl/SkSLGLSLCodeGenerator.cpp b/src/sksl/SkSLGLSLCodeGenerator.cpp index 4326f4c794..6381acb322 100644 --- a/src/sksl/SkSLGLSLCodeGenerator.cpp +++ b/src/sksl/SkSLGLSLCodeGenerator.cpp @@ -621,6 +621,9 @@ void GLSLCodeGenerator::writeVarDeclarations(const VarDeclarations& decl, bool g ASSERT(decl.fVars.size() > 0); bool wroteType = false; for (const auto& stmt : decl.fVars) { + if (stmt->fKind == Statement::kNop_Kind) { + continue; + } VarDeclaration& var = (VarDeclaration&) *stmt; if (wroteType) { this->write(", "); @@ -835,7 +838,6 @@ bool GLSLCodeGenerator::generateCode() { case ProgramElement::kVar_Kind: { VarDeclarations& decl = (VarDeclarations&) *e; if (decl.fVars.size() > 0) { - ASSERT(decl.fVars[0]->fKind == Statement::kVarDeclaration_Kind); int builtin = ((VarDeclaration&) *decl.fVars[0]).fVar->fModifiers.fLayout.fBuiltin; if (builtin == -1) { |