aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrProcOptInfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu/GrProcOptInfo.cpp')
-rw-r--r--src/gpu/GrProcOptInfo.cpp20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/gpu/GrProcOptInfo.cpp b/src/gpu/GrProcOptInfo.cpp
index 18a32020d4..a84ac2e17f 100644
--- a/src/gpu/GrProcOptInfo.cpp
+++ b/src/gpu/GrProcOptInfo.cpp
@@ -7,8 +7,9 @@
#include "GrProcOptInfo.h"
-#include "GrGeometryProcessor.h"
+#include "GrFragmentProcessor.h"
#include "GrFragmentStage.h"
+#include "GrGeometryProcessor.h"
void GrProcOptInfo::calcWithInitialValues(const GrFragmentStage* stages,
int stageCount,
@@ -22,6 +23,7 @@ void GrProcOptInfo::calcWithInitialValues(const GrFragmentStage* stages,
fInputColor = startColor;
fRemoveVertexAttrib = false;
fReadsDst = false;
+ fReadsFragPosition = false;
if (areCoverageStages && gp) {
gp->computeInvariantOutput(&fInOut);
@@ -31,17 +33,22 @@ void GrProcOptInfo::calcWithInitialValues(const GrFragmentStage* stages,
const GrFragmentProcessor* processor = stages[i].getProcessor();
fInOut.resetWillUseInputColor();
processor->computeInvariantOutput(&fInOut);
- #ifdef SK_DEBUG
+#ifdef SK_DEBUG
fInOut.validate();
- #endif
+#endif
if (!fInOut.willUseInputColor()) {
fFirstEffectStageIndex = i;
fInputColorIsUsed = false;
- fReadsDst = false; // Reset this since we don't care if previous stages read dst
+ // Reset these since we don't care if previous stages read these values
+ fReadsDst = false;
+ fReadsFragPosition = false;
}
if (processor->willReadDstColor()) {
fReadsDst = true;
}
+ if (processor->willReadFragmentPosition()) {
+ fReadsFragPosition = true;
+ }
if (kRGBA_GrColorComponentFlags == fInOut.validFlags()) {
fFirstEffectStageIndex = i + 1;
fInputColor = fInOut.color();
@@ -50,7 +57,10 @@ void GrProcOptInfo::calcWithInitialValues(const GrFragmentStage* stages,
// Since we are clearing all previous color stages we are in a state where we have found
// zero stages that don't multiply the inputColor.
fInOut.resetNonMulStageFound();
- fReadsDst = false; // Reset this since we don't care if previous stages read dst
+ // Reset these since we don't care if previous stages read these values
+ fReadsDst = false;
+ fReadsFragPosition = false;
}
}
}
+