Index: src/gpu/gl/GrGLProgramDesc.cpp |
diff --git a/src/gpu/gl/GrGLProgramDesc.cpp b/src/gpu/gl/GrGLProgramDesc.cpp |
index a1cd85e9f4afb6d5ad2770fd9ac03a50292ccdca..61f6dd9e1095bfcad00e07143a62d9f83c1953b3 100644 |
--- a/src/gpu/gl/GrGLProgramDesc.cpp |
+++ b/src/gpu/gl/GrGLProgramDesc.cpp |
@@ -76,6 +76,7 @@ void GrGLProgramDesc::Build(const GrDrawState& drawState, |
} |
bool readsDst = false; |
+ bool readFragPosition = false; |
int lastEnabledStage = -1; |
for (int s = 0; s < GrDrawState::kNumStages; ++s) { |
@@ -90,6 +91,9 @@ void GrGLProgramDesc::Build(const GrDrawState& drawState, |
if (effect->willReadDstColor()) { |
readsDst = true; |
} |
+ if (effect->willReadFragmentPosition()) { |
+ readFragPosition = true; |
+ } |
} else { |
desc->fEffectKeys[s] = 0; |
} |
@@ -107,6 +111,13 @@ void GrGLProgramDesc::Build(const GrDrawState& drawState, |
desc->fDstRead = 0; |
} |
+ if (readFragPosition) { |
+ desc->fFragPos = GrGLShaderBuilder::KeyForFragmentPosition(drawState.getRenderTarget(), |
+ gpu->glCaps()); |
+ } else { |
robertphillips
2013/05/10 13:53:58
Use 'kNoFragPosRead_FragPosKey' here?
bsalomon
2013/05/13 15:16:49
It's private. I think in the long run the desc sho
|
+ desc->fFragPos = 0; |
+ } |
+ |
desc->fCoverageOutput = kModulate_CoverageOutput; |
// Currently the experimental GS will only work with triangle prims (and it doesn't do anything |