Index: src/gpu/gl/builders/GrGLFragmentShaderBuilder.cpp |
diff --git a/src/gpu/gl/builders/GrGLFragmentShaderBuilder.cpp b/src/gpu/gl/builders/GrGLFragmentShaderBuilder.cpp |
index 20bb3a389341a5bf1f614587d042a8ca3e0d91cf..a5b3a99ebe1a03d71b93c8f150d2d8cd0c4e09ff 100644 |
--- a/src/gpu/gl/builders/GrGLFragmentShaderBuilder.cpp |
+++ b/src/gpu/gl/builders/GrGLFragmentShaderBuilder.cpp |
@@ -302,13 +302,17 @@ void GrGLFragmentShaderBuilder::addVarying(GrGLVarying* v, GrSLPrecision fsPrec) |
} |
void GrGLFragmentBuilder::onBeforeChildProcEmitCode() { |
- fSubstageIndices.back()++; |
+ SkASSERT(fSubstageIndices.count() >= 1); |
fSubstageIndices.push_back(0); |
- fMangleString.append(this->getMangleStringThisLevel()); |
+ // second-to-last value in the fSubstageIndices stack is the index of the child proc |
+ // at that level which is currently emitting code. |
+ fMangleString.appendf("_c%d", fSubstageIndices[fSubstageIndices.count() - 2]); |
} |
void GrGLFragmentBuilder::onAfterChildProcEmitCode() { |
+ SkASSERT(fSubstageIndices.count() >= 2); |
fSubstageIndices.pop_back(); |
+ fSubstageIndices.back()++; |
int removeAt = fMangleString.findLastOf('_'); |
fMangleString.remove(removeAt, fMangleString.size() - removeAt); |
} |