Index: src/gpu/gl/GrGLProgramDesc.cpp |
=================================================================== |
--- src/gpu/gl/GrGLProgramDesc.cpp (revision 8448) |
+++ src/gpu/gl/GrGLProgramDesc.cpp (working copy) |
@@ -9,6 +9,7 @@ |
#include "GrBackendEffectFactory.h" |
#include "GrDrawEffect.h" |
#include "GrEffect.h" |
+#include "GrGLShaderBuilder.h" |
#include "GrGpuGL.h" |
void GrGLProgramDesc::Build(const GrDrawState& drawState, |
@@ -17,6 +18,7 @@ |
GrBlendCoeff srcCoeff, |
GrBlendCoeff dstCoeff, |
const GrGpuGL* gpu, |
+ const GrDeviceCoordTexture* dstCopy, |
GrGLProgramDesc* desc) { |
// This should already have been caught |
@@ -80,6 +82,7 @@ |
desc->fCoverageInput = kAttribute_ColorInput; |
} |
+ bool readsDst = false; |
int lastEnabledStage = -1; |
for (int s = 0; s < GrDrawState::kNumStages; ++s) { |
@@ -93,11 +96,22 @@ |
GrDrawState::kLocalCoords_AttribBindingsBit); |
GrDrawEffect drawEffect(drawState.getStage(s), explicitLocalCoords); |
desc->fEffectKeys[s] = factory.glEffectKey(drawEffect, gpu->glCaps()); |
+ if (effect->willReadDst()) { |
+ readsDst = true; |
+ } |
} else { |
desc->fEffectKeys[s] = 0; |
} |
} |
+ if (readsDst) { |
+ GrAssert(NULL != dstCopy); |
+ desc->fDstRead = GrGLShaderBuilder::KeyForDstRead(dstCopy->texture(), gpu->glCaps()); |
+ GrAssert(0 != desc->fDstRead); |
+ } else { |
+ desc->fDstRead = 0; |
+ } |
+ |
desc->fDualSrcOutput = kNone_DualSrcOutput; |
// Currently the experimental GS will only work with triangle prims (and it doesn't do anything |