Add support for GL_*_shader__framebuffer_fetch
R=robertphillips@google.com
Review URL: https://codereview.chromium.org/14875002
git-svn-id: http://skia.googlecode.com/svn/trunk@8980 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/gl/GrGLProgramDesc.cpp b/src/gpu/gl/GrGLProgramDesc.cpp
index 8677179..1ae6aa6 100644
--- a/src/gpu/gl/GrGLProgramDesc.cpp
+++ b/src/gpu/gl/GrGLProgramDesc.cpp
@@ -96,8 +96,12 @@
}
if (readsDst) {
- GrAssert(NULL != dstCopy);
- desc->fDstRead = GrGLShaderBuilder::KeyForDstRead(dstCopy->texture(), gpu->glCaps());
+ GrAssert(NULL != dstCopy || gpu->caps()->dstReadInShaderSupport());
+ const GrTexture* dstCopyTexture = NULL;
+ if (NULL != dstCopy) {
+ dstCopyTexture = dstCopy->texture();
+ }
+ desc->fDstRead = GrGLShaderBuilder::KeyForDstRead(dstCopyTexture, gpu->glCaps());
GrAssert(0 != desc->fDstRead);
} else {
desc->fDstRead = 0;