| Index: src/gpu/gl/builders/GrGLProgramBuilder.cpp
|
| diff --git a/src/gpu/gl/builders/GrGLProgramBuilder.cpp b/src/gpu/gl/builders/GrGLProgramBuilder.cpp
|
| index 9f4291513c7d6bda0a682646e291e05ef61df566..1c5cf25eb78903b02f2d000e7b56814c2cbb64d2 100644
|
| --- a/src/gpu/gl/builders/GrGLProgramBuilder.cpp
|
| +++ b/src/gpu/gl/builders/GrGLProgramBuilder.cpp
|
| @@ -40,9 +40,7 @@ GrGLProgram* GrGLProgramBuilder::CreateProgram(const DrawArgs& args, GrGLGpu* gp
|
| GrGLSLExpr4 inputColor;
|
| GrGLSLExpr4 inputCoverage;
|
|
|
| - if (!builder.emitAndInstallProcs(&inputColor,
|
| - &inputCoverage,
|
| - gpu->glCaps().maxFragmentTextureUnits())) {
|
| + if (!builder.emitAndInstallProcs(&inputColor, &inputCoverage)) {
|
| builder.cleanupFragmentProcessors();
|
| return nullptr;
|
| }
|
| @@ -55,7 +53,6 @@ GrGLProgram* GrGLProgramBuilder::CreateProgram(const DrawArgs& args, GrGLGpu* gp
|
| GrGLProgramBuilder::GrGLProgramBuilder(GrGLGpu* gpu, const DrawArgs& args)
|
| : INHERITED(args)
|
| , fGpu(gpu)
|
| - , fSamplerUniforms(4)
|
| , fVaryingHandler(this)
|
| , fUniformHandler(this) {
|
| }
|
| @@ -68,39 +65,6 @@ const GrGLSLCaps* GrGLProgramBuilder::glslCaps() const {
|
| return fGpu->ctxInfo().caps()->glslCaps();
|
| }
|
|
|
| -static GrSLType get_sampler_type(const GrTextureAccess& access) {
|
| - GrGLTexture* glTexture = static_cast<GrGLTexture*>(access.getTexture());
|
| - if (glTexture->target() == GR_GL_TEXTURE_EXTERNAL) {
|
| - return kSamplerExternal_GrSLType;
|
| - } else if (glTexture->target() == GR_GL_TEXTURE_RECTANGLE) {
|
| - return kSampler2DRect_GrSLType;
|
| - } else {
|
| - SkASSERT(glTexture->target() == GR_GL_TEXTURE_2D);
|
| - return kSampler2D_GrSLType;
|
| - }
|
| -}
|
| -
|
| -void GrGLProgramBuilder::emitSamplers(const GrProcessor& processor,
|
| - GrGLSLTextureSampler::TextureSamplerArray* outSamplers) {
|
| - int numTextures = processor.numTextures();
|
| - UniformHandle* localSamplerUniforms = fSamplerUniforms.push_back_n(numTextures);
|
| - SkString name;
|
| - for (int t = 0; t < numTextures; ++t) {
|
| - name.printf("Sampler%d", t);
|
| - GrSLType samplerType = get_sampler_type(processor.textureAccess(t));
|
| - localSamplerUniforms[t] = fUniformHandler.addUniform(kFragment_GrShaderFlag, samplerType,
|
| - kDefault_GrSLPrecision, name.c_str());
|
| - outSamplers->emplace_back(localSamplerUniforms[t], processor.textureAccess(t));
|
| - if (kSamplerExternal_GrSLType == samplerType) {
|
| - const char* externalFeatureString = this->glslCaps()->externalTextureExtensionString();
|
| - // We shouldn't ever create a GrGLTexture that requires external sampler type
|
| - SkASSERT(externalFeatureString);
|
| - fFS.addFeature(1 << GrGLSLFragmentShaderBuilder::kExternalTexture_GLSLPrivateFeature,
|
| - externalFeatureString);
|
| - }
|
| - }
|
| -}
|
| -
|
| bool GrGLProgramBuilder::compileAndAttachShaders(GrGLSLShaderBuilder& shader,
|
| GrGLuint programId,
|
| GrGLenum type,
|
|
|