aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/glsl/GrGLSLProgramBuilder.cpp
diff options
context:
space:
mode:
authorGravatar cdalton <cdalton@nvidia.com>2016-02-26 12:22:02 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-02-26 12:22:02 -0800
commit87332103c605dc3e0f76c0d1250a76c4ff71fddc (patch)
tree691623aee5f5b4953ecfcb69dcd79f9f6f0b0937 /src/gpu/glsl/GrGLSLProgramBuilder.cpp
parente5824b90da4568544ecbf71ba5d690095b31307e (diff)
Replace fWillReadFragmentPosition with a bitfield
Replaces fWillReadFragmentPosition on GrProcessor with a "RequiredFeatures" bitfield. This will allow us to add additional built-in features. Completely removes information about reading the fragment position from GrPipeline and GrProcOptInfo. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1734163002 Review URL: https://codereview.chromium.org/1734163002
Diffstat (limited to 'src/gpu/glsl/GrGLSLProgramBuilder.cpp')
-rw-r--r--src/gpu/glsl/GrGLSLProgramBuilder.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/gpu/glsl/GrGLSLProgramBuilder.cpp b/src/gpu/glsl/GrGLSLProgramBuilder.cpp
index 9201da946c..417e924a0e 100644
--- a/src/gpu/glsl/GrGLSLProgramBuilder.cpp
+++ b/src/gpu/glsl/GrGLSLProgramBuilder.cpp
@@ -99,7 +99,7 @@ void GrGLSLProgramBuilder::emitAndInstallPrimProc(const GrPrimitiveProcessor& pr
// We have to check that effects and the code they emit are consistent, ie if an effect
// asks for dst color, then the emit code needs to follow suit
- verify(proc);
+ SkDEBUGCODE(verify(proc);)
fFS.codeAppend("}");
}
@@ -147,7 +147,7 @@ void GrGLSLProgramBuilder::emitAndInstallFragProc(const GrFragmentProcessor& fp,
// We have to check that effects and the code they emit are consistent, ie if an effect
// asks for dst color, then the emit code needs to follow suit
- verify(fp);
+ SkDEBUGCODE(verify(fp);)
fFragmentProcessors.push_back(fragProc);
fFS.codeAppend("}");
@@ -194,7 +194,7 @@ void GrGLSLProgramBuilder::emitAndInstallXferProc(const GrXferProcessor& xp,
// We have to check that effects and the code they emit are consistent, ie if an effect
// asks for dst color, then the emit code needs to follow suit
- verify(xp);
+ SkDEBUGCODE(verify(xp);)
fFS.codeAppend("}");
}
@@ -214,17 +214,20 @@ void GrGLSLProgramBuilder::emitFSOutputSwizzle(bool hasSecondaryOutput) {
}
}
+#ifdef SK_DEBUG
void GrGLSLProgramBuilder::verify(const GrPrimitiveProcessor& gp) {
- SkASSERT(fFS.hasReadFragmentPosition() == gp.willReadFragmentPosition());
+ SkASSERT(fFS.usedProcessorFeatures() == gp.requiredFeatures());
}
void GrGLSLProgramBuilder::verify(const GrXferProcessor& xp) {
+ SkASSERT(fFS.usedProcessorFeatures() == xp.requiredFeatures());
SkASSERT(fFS.hasReadDstColor() == xp.willReadDstColor());
}
void GrGLSLProgramBuilder::verify(const GrFragmentProcessor& fp) {
- SkASSERT(fFS.hasReadFragmentPosition() == fp.willReadFragmentPosition());
+ SkASSERT(fFS.usedProcessorFeatures() == fp.requiredFeatures());
}
+#endif
void GrGLSLProgramBuilder::nameVariable(SkString* out, char prefix, const char* name, bool mangle) {
if ('\0' == prefix) {