| Index: src/gpu/gl/GrGLShaderBuilder.cpp
|
| diff --git a/src/gpu/gl/GrGLShaderBuilder.cpp b/src/gpu/gl/GrGLShaderBuilder.cpp
|
| index 8d1e66be7c0e69ec7c3de2b1d05bc582f9f74519..60fbb39fe185ec005da0f28006b1b924d878b97b 100644
|
| --- a/src/gpu/gl/GrGLShaderBuilder.cpp
|
| +++ b/src/gpu/gl/GrGLShaderBuilder.cpp
|
| @@ -114,8 +114,7 @@ bool GrGLShaderBuilder::genProgram(const GrEffectStage* colorStages[],
|
|
|
| ///////////////////////////////////////////////////////////////////////////
|
| // emit code to read the dst copy texture, if necessary
|
| - if (kNoDstRead_DstReadKey != header.fDstReadKey &&
|
| - GrGLCaps::kNone_FBFetchType == fGpu->glCaps().fbFetchType()) {
|
| + if (kNoDstRead_DstReadKey != header.fDstReadKey && !fGpu->glCaps().fbFetchSupport()) {
|
| bool topDown = SkToBool(kTopLeftOrigin_DstReadKeyBit & header.fDstReadKey);
|
| const char* dstCopyTopLeftName;
|
| const char* dstCopyCoordScaleName;
|
| @@ -291,20 +290,6 @@ bool GrGLShaderBuilder::enablePrivateFeature(GLSLPrivateFeature feature) {
|
| "GL_ARB_fragment_coord_conventions");
|
| }
|
| return true;
|
| - case kEXTShaderFramebufferFetch_GLSLPrivateFeature:
|
| - if (GrGLCaps::kEXT_FBFetchType != fGpu->glCaps().fbFetchType()) {
|
| - return false;
|
| - }
|
| - this->addFSFeature(1 << kEXTShaderFramebufferFetch_GLSLPrivateFeature,
|
| - "GL_EXT_shader_framebuffer_fetch");
|
| - return true;
|
| - case kNVShaderFramebufferFetch_GLSLPrivateFeature:
|
| - if (GrGLCaps::kNV_FBFetchType != fGpu->glCaps().fbFetchType()) {
|
| - return false;
|
| - }
|
| - this->addFSFeature(1 << kNVShaderFramebufferFetch_GLSLPrivateFeature,
|
| - "GL_NV_shader_framebuffer_fetch");
|
| - return true;
|
| default:
|
| SkFAIL("Unexpected GLSLPrivateFeature requested.");
|
| return false;
|
| @@ -342,14 +327,11 @@ const char* GrGLShaderBuilder::dstColor() {
|
| return "";
|
| }
|
| }
|
| - static const char kFBFetchColorName[] = "gl_LastFragData[0]";
|
| - GrGLCaps::FBFetchType fetchType = fGpu->glCaps().fbFetchType();
|
| - if (GrGLCaps::kEXT_FBFetchType == fetchType) {
|
| - SkAssertResult(this->enablePrivateFeature(kEXTShaderFramebufferFetch_GLSLPrivateFeature));
|
| - return kFBFetchColorName;
|
| - } else if (GrGLCaps::kNV_FBFetchType == fetchType) {
|
| - SkAssertResult(this->enablePrivateFeature(kNVShaderFramebufferFetch_GLSLPrivateFeature));
|
| - return kFBFetchColorName;
|
| +
|
| + if (fGpu->glCaps().fbFetchSupport()) {
|
| + this->addFSFeature(1 << (kLastGLSLPrivateFeature + 1),
|
| + fGpu->glCaps().fbFetchExtensionString());
|
| + return fGpu->glCaps().fbFetchColorName();
|
| } else if (fOutput.fUniformHandles.fDstCopySamplerUni.isValid()) {
|
| return kDstCopyColorName;
|
| } else {
|
| @@ -389,7 +371,7 @@ void GrGLShaderBuilder::fsAppendTextureLookupAndModulate(
|
| GrGLShaderBuilder::DstReadKey GrGLShaderBuilder::KeyForDstRead(const GrTexture* dstCopy,
|
| const GrGLCaps& caps) {
|
| uint32_t key = kYesDstRead_DstReadKeyBit;
|
| - if (GrGLCaps::kNone_FBFetchType != caps.fbFetchType()) {
|
| + if (caps.fbFetchSupport()) {
|
| return key;
|
| }
|
| SkASSERT(NULL != dstCopy);
|
|
|