diff --git a/src/effects/SkBlurMaskFilter.cpp b/src/effects/SkBlurMaskFilter.cpp
index a1acf65..2afb42f 100644
--- a/src/effects/SkBlurMaskFilter.cpp
+++ b/src/effects/SkBlurMaskFilter.cpp
@@ -691,7 +691,7 @@
 };
 
 void OutputRectBlurProfileLookup(GrGLSLFPFragmentBuilder* fragBuilder,
-                                 const GrGLSLSampler& sampler,
+                                 GrGLSLFragmentProcessor::SamplerHandle sampler,
                                  const char *output,
                                  const char *profileSize, const char *loc,
                                  const char *blurred_width,
diff --git a/src/effects/gradients/SkGradientShader.cpp b/src/effects/gradients/SkGradientShader.cpp
index 779756f..fdb6e59 100644
--- a/src/effects/gradients/SkGradientShader.cpp
+++ b/src/effects/gradients/SkGradientShader.cpp
@@ -1027,7 +1027,7 @@
                                    const char* gradientTValue,
                                    const char* outputColor,
                                    const char* inputColor,
-                                   const SamplerArray& texSamplers) {
+                                   const SamplerHandle* texSamplers) {
     if (SkGradientShaderBase::kTwo_GpuColorType == ge.getColorType()){
         fragBuilder->codeAppendf("\tvec4 colorTemp = mix(%s, %s, clamp(%s, 0.0, 1.0));\n",
                                  uniformHandler->getUniformVariable(fColorStartUni).c_str(),
diff --git a/src/effects/gradients/SkGradientShaderPriv.h b/src/effects/gradients/SkGradientShaderPriv.h
index 0677cf0..0280fca 100644
--- a/src/effects/gradients/SkGradientShaderPriv.h
+++ b/src/effects/gradients/SkGradientShaderPriv.h
@@ -423,7 +423,7 @@
                    const char* gradientTValue,
                    const char* outputColor,
                    const char* inputColor,
-                   const SamplerArray& texSamplers);
+                   const SamplerHandle* texSamplers);
 
 private:
     enum {
diff --git a/src/gpu/effects/GrTextureDomain.cpp b/src/gpu/effects/GrTextureDomain.cpp
index 4394c0e..cf6ebe5 100644
--- a/src/gpu/effects/GrTextureDomain.cpp
+++ b/src/gpu/effects/GrTextureDomain.cpp
@@ -49,7 +49,7 @@
                                               const GrTextureDomain& textureDomain,
                                               const char* outColor,
                                               const SkString& inCoords,
-                                              const GrGLSLSampler& sampler,
+                                              GrGLSLFragmentProcessor::SamplerHandle sampler,
                                               const char* inModulateColor) {
     SkASSERT((Mode)-1 == fMode || textureDomain.mode() == fMode);
     SkDEBUGCODE(fMode = textureDomain.mode();)
diff --git a/src/gpu/effects/GrTextureDomain.h b/src/gpu/effects/GrTextureDomain.h
index 2877c39..387016e 100644
--- a/src/gpu/effects/GrTextureDomain.h
+++ b/src/gpu/effects/GrTextureDomain.h
@@ -120,7 +120,7 @@
                            const GrTextureDomain& textureDomain,
                            const char* outColor,
                            const SkString& inCoords,
-                           const GrGLSLSampler& sampler,
+                           GrGLSLFragmentProcessor::SamplerHandle sampler,
                            const char* inModulateColor = nullptr);
 
         /**
diff --git a/src/gpu/gl/GrGLProgram.cpp b/src/gpu/gl/GrGLProgram.cpp
index 6a433e1..c270858 100644
--- a/src/gpu/gl/GrGLProgram.cpp
+++ b/src/gpu/gl/GrGLProgram.cpp
@@ -31,11 +31,11 @@
                          const BuiltinUniformHandles& builtinUniforms,
                          GrGLuint programID,
                          const UniformInfoArray& uniforms,
+                         const SkTArray<GrGLSampler>& samplers,
                          const VaryingInfoArray& pathProcVaryings,
                          GrGLSLPrimitiveProcessor* geometryProcessor,
                          GrGLSLXferProcessor* xferProcessor,
-                         const GrGLSLFragProcs& fragmentProcessors,
-                         SkTArray<UniformHandle>* passSamplerUniforms)
+                         const GrGLSLFragProcs& fragmentProcessors)
     : fBuiltinUniformHandles(builtinUniforms)
     , fProgramID(programID)
     , fGeometryProcessor(geometryProcessor)
@@ -44,12 +44,9 @@
     , fDesc(desc)
     , fGpu(gpu)
     , fProgramDataManager(gpu, programID, uniforms, pathProcVaryings) {
-    fSamplerUniforms.swap(passSamplerUniforms);
     // Assign texture units to sampler uniforms one time up front.
     GL_CALL(UseProgram(fProgramID));
-    for (int i = 0; i < fSamplerUniforms.count(); i++) {
-        fProgramDataManager.setSampler(fSamplerUniforms[i], i);
-    }
+    fProgramDataManager.setSamplers(samplers);
 }
 
 GrGLProgram::~GrGLProgram() {
diff --git a/src/gpu/gl/GrGLProgram.h b/src/gpu/gl/GrGLProgram.h
index c70b1bd..7487a1e 100644
--- a/src/gpu/gl/GrGLProgram.h
+++ b/src/gpu/gl/GrGLProgram.h
@@ -106,11 +106,11 @@
                 const BuiltinUniformHandles&,
                 GrGLuint programID,
                 const UniformInfoArray&,
+                const SkTArray<GrGLSampler>&,
                 const VaryingInfoArray&, // used for NVPR only currently
                 GrGLSLPrimitiveProcessor* geometryProcessor,
                 GrGLSLXferProcessor* xferProcessor,
-                const GrGLSLFragProcs& fragmentProcessors,
-                SkTArray<UniformHandle>* passSamplerUniforms);
+                const GrGLSLFragProcs& fragmentProcessors);
 
     // A helper to loop over effects, set the transforms (via subclass) and bind textures
     void setFragmentData(const GrPrimitiveProcessor&, const GrPipeline&, int* nextSamplerIdx);
@@ -135,7 +135,6 @@
     GrProgramDesc fDesc;
     GrGLGpu* fGpu;
     GrGLProgramDataManager fProgramDataManager;
-    SkTArray<UniformHandle> fSamplerUniforms;
 
     friend class GrGLProgramBuilder;
 
diff --git a/src/gpu/gl/GrGLProgramDataManager.cpp b/src/gpu/gl/GrGLProgramDataManager.cpp
index 6b2e111..9513a3f 100644
--- a/src/gpu/gl/GrGLProgramDataManager.cpp
+++ b/src/gpu/gl/GrGLProgramDataManager.cpp
@@ -61,19 +61,31 @@
     }
 }
 
-void GrGLProgramDataManager::setSampler(UniformHandle u, int texUnit) const {
-    const Uniform& uni = fUniforms[u.toIndex()];
-    SkASSERT(GrSLTypeIsSamplerType(uni.fType));
-    SkASSERT(GrGLSLShaderVar::kNonArray == uni.fArrayCount);
-    // FIXME: We still insert a single sampler uniform for every stage. If the shader does not
-    // reference the sampler then the compiler may have optimized it out. Uncomment this assert
-    // once stages insert their own samplers.
-    // this->printUnused(uni);
-    if (kUnusedUniform != uni.fFSLocation) {
-        GR_GL_CALL(fGpu->glInterface(), Uniform1i(uni.fFSLocation, texUnit));
-    }
-    if (kUnusedUniform != uni.fVSLocation && uni.fVSLocation != uni.fFSLocation) {
-        GR_GL_CALL(fGpu->glInterface(), Uniform1i(uni.fVSLocation, texUnit));
+void GrGLProgramDataManager::setSamplers(const SkTArray<GrGLSampler>& samplers) const {
+    for (int i = 0; i < samplers.count(); ++i) {
+        GrGLint vsLocation;
+        GrGLint fsLocation;
+        const GrGLSampler& sampler = samplers[i];
+        if (kVertex_GrShaderFlag & sampler.visibility()) {
+            vsLocation = sampler.location();
+        } else {
+            vsLocation = kUnusedUniform;
+        }
+        if (kFragment_GrShaderFlag & sampler.visibility()) {
+            fsLocation = sampler.location();
+        } else {
+            fsLocation = kUnusedUniform;
+        }
+        // FIXME: We still insert a single sampler uniform for every stage. If the shader does not
+        // reference the sampler then the compiler may have optimized it out. Uncomment this assert
+        // once stages insert their own samplers.
+        // this->printUnused(uni);
+        if (kUnusedUniform != fsLocation) {
+            GR_GL_CALL(fGpu->glInterface(), Uniform1i(fsLocation, i));
+        }
+        if (kUnusedUniform != vsLocation && vsLocation != fsLocation) {
+            GR_GL_CALL(fGpu->glInterface(), Uniform1i(vsLocation, i));
+        }
     }
 }
 
diff --git a/src/gpu/gl/GrGLProgramDataManager.h b/src/gpu/gl/GrGLProgramDataManager.h
index c2cb8fc..513b6a4 100644
--- a/src/gpu/gl/GrGLProgramDataManager.h
+++ b/src/gpu/gl/GrGLProgramDataManager.h
@@ -11,6 +11,7 @@
 #include "glsl/GrGLSLProgramDataManager.h"
 
 #include "GrAllocator.h"
+#include "gl/GrGLSampler.h"
 #include "gl/GrGLTypes.h"
 #include "glsl/GrGLSLShaderVar.h"
 
@@ -46,11 +47,12 @@
     GrGLProgramDataManager(GrGLGpu*, GrGLuint programID, const UniformInfoArray&,
                            const VaryingInfoArray&);
 
-    /** Functions for uploading uniform values. The varities ending in v can be used to upload to an
-     *  array of uniforms. arrayCount must be <= the array count of the uniform.
-     */
-    void setSampler(UniformHandle, int texUnit) const;
 
+    void setSamplers(const SkTArray<GrGLSampler>& samplers) const;
+
+    /** Functions for uploading uniform values. The varities ending in v can be used to upload to an
+    *  array of uniforms. arrayCount must be <= the array count of the uniform.
+    */
     void set1f(UniformHandle, float v0) const override;
     void set1fv(UniformHandle, int arrayCount, const float v[]) const override;
     void set2f(UniformHandle, float, float) const override;
diff --git a/src/gpu/gl/GrGLSampler.h b/src/gpu/gl/GrGLSampler.h
new file mode 100644
index 0000000..e270f5d
--- /dev/null
+++ b/src/gpu/gl/GrGLSampler.h
@@ -0,0 +1,45 @@
+/*
+* Copyright 2016 Google Inc.
+*
+* Use of this source code is governed by a BSD-style license that can be
+* found in the LICENSE file.
+*/
+
+#ifndef GrGLSampler_DEFINED
+#define GrGLSampler_DEFINED
+
+#include "glsl/GrGLSLSampler.h"
+
+#include "gl/GrGLTypes.h"
+#include "glsl/GrGLSLShaderVar.h"
+
+class GrGLSampler : public GrGLSLSampler {
+public:
+    GrGLSampler(uint32_t visibility,
+                GrPixelConfig config,
+                GrSLType type,
+                GrSLPrecision precision,
+                const char* name) : INHERITED(visibility, config) {
+        SkASSERT(GrSLTypeIsSamplerType(type));
+        fShaderVar.setType(type);
+        fShaderVar.setTypeModifier(GrGLSLShaderVar::kUniform_TypeModifier);
+        fShaderVar.setPrecision(precision);
+        fShaderVar.accessName()->set(name);
+    }
+
+    GrGLint location() const { return fLocation; }
+    GrSLType type() const override { return fShaderVar.getType(); }
+
+    const char* onGetSamplerNameForTexture2D() const override { return fShaderVar.c_str(); }
+    const char* getSamplerNameForTexelFetch() const override { return fShaderVar.c_str(); }
+
+private:
+    GrGLSLShaderVar fShaderVar;
+    GrGLint         fLocation;
+
+    friend class GrGLUniformHandler;
+
+    typedef GrGLSLSampler INHERITED;
+};
+
+#endif
diff --git a/src/gpu/gl/GrGLUniformHandler.cpp b/src/gpu/gl/GrGLUniformHandler.cpp
index 94da1f1..c418926 100644
--- a/src/gpu/gl/GrGLUniformHandler.cpp
+++ b/src/gpu/gl/GrGLUniformHandler.cpp
@@ -52,6 +52,22 @@
     return GrGLSLUniformHandler::UniformHandle(fUniforms.count() - 1);
 }
 
+GrGLSLUniformHandler::SamplerHandle GrGLUniformHandler::internalAddSampler(uint32_t visibility,
+                                                                           GrPixelConfig config,
+                                                                           GrSLType type,
+                                                                           GrSLPrecision precision,
+                                                                           const char* name) {
+    SkASSERT(name && strlen(name));
+    SkDEBUGCODE(static const uint32_t kVisMask = kVertex_GrShaderFlag | kFragment_GrShaderFlag);
+    SkASSERT(0 == (~kVisMask & visibility));
+    SkASSERT(0 != visibility);
+    SkString mangleName;
+    char prefix = 'u';
+    fProgramBuilder->nameVariable(&mangleName, prefix, name, true);
+    fSamplers.emplace_back(visibility, config, type, precision, mangleName.c_str());
+    return GrGLSLUniformHandler::SamplerHandle(fSamplers.count() - 1);
+}
+
 void GrGLUniformHandler::appendUniformDecls(GrShaderFlags visibility, SkString* out) const {
     for (int i = 0; i < fUniforms.count(); ++i) {
         if (fUniforms[i].fVisibility & visibility) {
@@ -59,6 +75,12 @@
             out->append(";\n");
         }
     }
+    for (int i = 0; i < fSamplers.count(); ++i) {
+        if (fSamplers[i].visibility() & visibility) {
+            fSamplers[i].fShaderVar.appendDecl(fProgramBuilder->glslCaps(), out);
+            out->append(";\n");
+        }
+    }
 }
 
 void GrGLUniformHandler::bindUniformLocations(GrGLuint programID, const GrGLCaps& caps) {
@@ -68,6 +90,10 @@
             GL_CALL(BindUniformLocation(programID, i, fUniforms[i].fVariable.c_str()));
             fUniforms[i].fLocation = i;
         }
+        for (int i = 0; i < fSamplers.count(); ++i) {
+            GL_CALL(BindUniformLocation(programID, i, fSamplers[i].fShaderVar.c_str()));
+            fSamplers[i].fLocation = i;
+        }
     }
 }
 
@@ -79,6 +105,11 @@
             GL_CALL_RET(location, GetUniformLocation(programID, fUniforms[i].fVariable.c_str()));
             fUniforms[i].fLocation = location;
         }
+        for (int i = 0; i < fSamplers.count(); ++i) {
+            GrGLint location;
+            GL_CALL_RET(location, GetUniformLocation(programID, fSamplers[i].fShaderVar.c_str()));
+            fSamplers[i].fLocation = location;
+        }
     }
 }
 
diff --git a/src/gpu/gl/GrGLUniformHandler.h b/src/gpu/gl/GrGLUniformHandler.h
index 1dac8d9..3656d3a 100644
--- a/src/gpu/gl/GrGLUniformHandler.h
+++ b/src/gpu/gl/GrGLUniformHandler.h
@@ -11,6 +11,7 @@
 #include "glsl/GrGLSLUniformHandler.h"
 
 #include "gl/GrGLProgramDataManager.h"
+#include "gl/GrGLSampler.h"
 
 class GrGLCaps;
 
@@ -38,6 +39,17 @@
                                           int arrayCount,
                                           const char** outName) override;
 
+    SamplerHandle internalAddSampler(uint32_t visibility,
+                                     GrPixelConfig config,
+                                     GrSLType type,
+                                     GrSLPrecision precision,
+                                     const char* name) override;
+
+    int numSamplers() const override { return fSamplers.count(); }
+    const GrGLSLSampler& getSampler(SamplerHandle handle) const override {
+        return fSamplers[handle.toIndex()];
+    }
+
     void appendUniformDecls(GrShaderFlags visibility, SkString*) const override;
 
     // Manually set uniform locations for all our uniforms.
@@ -53,6 +65,8 @@
 
     UniformInfoArray fUniforms;
 
+    SkTArray<GrGLSampler> fSamplers;
+
     friend class GrGLProgramBuilder;
 
     typedef GrGLSLUniformHandler INHERITED;
diff --git a/src/gpu/gl/builders/GrGLProgramBuilder.cpp b/src/gpu/gl/builders/GrGLProgramBuilder.cpp
index fbe1722..c6422ca 100644
--- a/src/gpu/gl/builders/GrGLProgramBuilder.cpp
+++ b/src/gpu/gl/builders/GrGLProgramBuilder.cpp
@@ -233,9 +233,9 @@
                            fUniformHandles,
                            programID,
                            fUniformHandler.fUniforms,
+                           fUniformHandler.fSamplers,
                            fVaryingHandler.fPathProcVaryingInfos,
                            fGeometryProcessor,
                            fXferProcessor,
-                           fFragmentProcessors,
-                           &fSamplerUniforms);
+                           fFragmentProcessors);
 }
diff --git a/src/gpu/glsl/GrGLSLFragmentProcessor.cpp b/src/gpu/glsl/GrGLSLFragmentProcessor.cpp
index 42538ea..9533d5a 100644
--- a/src/gpu/glsl/GrGLSLFragmentProcessor.cpp
+++ b/src/gpu/glsl/GrGLSLFragmentProcessor.cpp
@@ -83,17 +83,16 @@
         firstBufferAt += args.fFp.childProcessor(i).numBuffers();
     }
     GrGLSLTransformedCoordsArray childCoords;
-    SamplerArray childTexSamplers;
-    SamplerArray childBufferSamplers;
+    const SamplerHandle* childTexSamplers = nullptr;
+    const SamplerHandle* childBufferSamplers =  nullptr;
     if (childProc.numTransforms() > 0) {
         childCoords.push_back_n(childProc.numTransforms(), &args.fCoords[firstCoordAt]);
     }
     if (childProc.numTextures() > 0) {
-        childTexSamplers.push_back_n(childProc.numTextures(), &args.fTexSamplers[firstTextureAt]);
+        childTexSamplers = &args.fTexSamplers[firstTextureAt];
     }
     if (childProc.numBuffers() > 0) {
-        childBufferSamplers.push_back_n(childProc.numBuffers(),
-                                        &args.fBufferSamplers[firstBufferAt]);
+        childBufferSamplers = &args.fBufferSamplers[firstBufferAt];
     }
 
     // emit the code for the child in its own scope
diff --git a/src/gpu/glsl/GrGLSLFragmentProcessor.h b/src/gpu/glsl/GrGLSLFragmentProcessor.h
index 9fc4a8c..43614f2 100644
--- a/src/gpu/glsl/GrGLSLFragmentProcessor.h
+++ b/src/gpu/glsl/GrGLSLFragmentProcessor.h
@@ -31,7 +31,7 @@
     }
 
     typedef GrGLSLProgramDataManager::UniformHandle UniformHandle;
-    typedef GrGLSLSampler::SamplerArray SamplerArray;
+    typedef GrGLSLProgramDataManager::UniformHandle SamplerHandle;
 
     /** Called when the program stage should insert its code into the shaders. The code in each
         shader will be in its own block ({}) and so locally scoped names will not collide across
@@ -60,8 +60,8 @@
                  const char* outputColor,
                  const char* inputColor,
                  const GrGLSLTransformedCoordsArray& coords,
-                 const SamplerArray& texSamplers,
-                 const SamplerArray& bufferSamplers)
+                 const SamplerHandle* texSamplers,
+                 const SamplerHandle* bufferSamplers)
             : fFragBuilder(fragBuilder)
             , fUniformHandler(uniformHandler)
             , fGLSLCaps(caps)
@@ -78,8 +78,8 @@
         const char* fOutputColor;
         const char* fInputColor;
         const GrGLSLTransformedCoordsArray& fCoords;
-        const SamplerArray& fTexSamplers;
-        const SamplerArray& fBufferSamplers;
+        const SamplerHandle* fTexSamplers;
+        const SamplerHandle* fBufferSamplers;
     };
 
     virtual void emitCode(EmitArgs&) = 0;
diff --git a/src/gpu/glsl/GrGLSLPrimitiveProcessor.h b/src/gpu/glsl/GrGLSLPrimitiveProcessor.h
index 4bd5fef..3bb1db9 100644
--- a/src/gpu/glsl/GrGLSLPrimitiveProcessor.h
+++ b/src/gpu/glsl/GrGLSLPrimitiveProcessor.h
@@ -27,7 +27,7 @@
     virtual ~GrGLSLPrimitiveProcessor() {}
 
     typedef GrGLSLProgramDataManager::UniformHandle UniformHandle;
-    typedef GrGLSLSampler::SamplerArray SamplerArray;
+    typedef GrGLSLProgramDataManager::UniformHandle SamplerHandle;
 
     typedef SkSTArray<2, const GrCoordTransform*, true> ProcCoords;
     typedef SkSTArray<8, ProcCoords> TransformsIn;
@@ -42,8 +42,8 @@
                  const GrPrimitiveProcessor& gp,
                  const char* outputColor,
                  const char* outputCoverage,
-                 const SamplerArray& texSamplers,
-                 const SamplerArray& bufferSamplers,
+                 const SamplerHandle* texSamplers,
+                 const SamplerHandle* bufferSamplers,
                  const TransformsIn& transformsIn,
                  TransformsOut* transformsOut)
             : fVertBuilder(vertBuilder)
@@ -66,8 +66,8 @@
         const GrPrimitiveProcessor& fGP;
         const char* fOutputColor;
         const char* fOutputCoverage;
-        const SamplerArray& fTexSamplers;
-        const SamplerArray& fBufferSamplers;
+        const SamplerHandle* fTexSamplers;
+        const SamplerHandle* fBufferSamplers;
         const TransformsIn& fTransformsIn;
         TransformsOut* fTransformsOut;
     };
diff --git a/src/gpu/glsl/GrGLSLProgramBuilder.cpp b/src/gpu/glsl/GrGLSLProgramBuilder.cpp
index 88ef5b9..31d1de2 100644
--- a/src/gpu/glsl/GrGLSLProgramBuilder.cpp
+++ b/src/gpu/glsl/GrGLSLProgramBuilder.cpp
@@ -27,7 +27,6 @@
     , fDesc(desc)
     , fGeometryProcessor(nullptr)
     , fXferProcessor(nullptr)
-    , fSamplerUniforms(4)
     , fNumVertexSamplers(0)
     , fNumGeometrySamplers(0)
     , fNumFragmentSamplers(0) {
@@ -97,8 +96,8 @@
     SkASSERT(!fGeometryProcessor);
     fGeometryProcessor = proc.createGLSLInstance(*this->glslCaps());
 
-    SkSTArray<4, GrGLSLSampler> texSamplers(proc.numTextures());
-    SkSTArray<2, GrGLSLSampler> bufferSamplers(proc.numBuffers());
+    SkSTArray<4, SamplerHandle> texSamplers(proc.numTextures());
+    SkSTArray<2, SamplerHandle> bufferSamplers(proc.numBuffers());
     this->emitSamplers(proc, &texSamplers, &bufferSamplers);
 
     GrGLSLGeometryProcessor::EmitArgs args(&fVS,
@@ -109,8 +108,8 @@
                                            proc,
                                            outputColor->c_str(),
                                            outputCoverage->c_str(),
-                                           texSamplers,
-                                           bufferSamplers,
+                                           texSamplers.begin(),
+                                           bufferSamplers.begin(),
                                            fCoordTransforms,
                                            &fOutCoords);
     fGeometryProcessor->emitCode(args);
@@ -150,8 +149,8 @@
 
     GrGLSLFragmentProcessor* fragProc = fp.createGLSLInstance();
 
-    SkSTArray<4, GrGLSLSampler> texSamplers(fp.numTextures());
-    SkSTArray<2, GrGLSLSampler> bufferSamplers(fp.numBuffers());
+    SkSTArray<4, SamplerHandle> texSamplers(fp.numTextures());
+    SkSTArray<2, SamplerHandle> bufferSamplers(fp.numBuffers());
     this->emitSamplers(fp, &texSamplers, &bufferSamplers);
 
     GrGLSLFragmentProcessor::EmitArgs args(&fFS,
@@ -161,8 +160,8 @@
                                            output->c_str(),
                                            input.isOnes() ? nullptr : input.c_str(),
                                            fOutCoords[index],
-                                           texSamplers,
-                                           bufferSamplers);
+                                           texSamplers.begin(),
+                                           bufferSamplers.begin());
     fragProc->emitCode(args);
 
     // We have to check that effects and the code they emit are consistent, ie if an effect
@@ -197,8 +196,8 @@
     openBrace.printf("{ // Xfer Processor: %s\n", xp.name());
     fFS.codeAppend(openBrace.c_str());
 
-    SkSTArray<4, GrGLSLSampler> texSamplers(xp.numTextures());
-    SkSTArray<2, GrGLSLSampler> bufferSamplers(xp.numBuffers());
+    SkSTArray<4, SamplerHandle> texSamplers(xp.numTextures());
+    SkSTArray<2, SamplerHandle> bufferSamplers(xp.numBuffers());
     this->emitSamplers(xp, &texSamplers, &bufferSamplers);
 
     bool usePLSDstRead = (plsState == GrPixelLocalStorageState::kFinish_GrPixelLocalStorageState);
@@ -209,8 +208,8 @@
                                        ignoresCoverage ? nullptr : coverageIn.c_str(),
                                        fFS.getPrimaryColorOutputName(),
                                        fFS.getSecondaryColorOutputName(),
-                                       texSamplers,
-                                       bufferSamplers,
+                                       texSamplers.begin(),
+                                       bufferSamplers.begin(),
                                        usePLSDstRead);
     fXferProcessor->emitCode(args);
 
@@ -221,8 +220,8 @@
 }
 
 void GrGLSLProgramBuilder::emitSamplers(const GrProcessor& processor,
-                                        GrGLSLSampler::SamplerArray* outTexSamplers,
-                                        GrGLSLSampler::SamplerArray* outBufferSamplers) {
+                                        SkTArray<SamplerHandle>* outTexSamplers,
+                                        SkTArray<SamplerHandle>* outBufferSamplers) {
     SkString name;
     int numTextures = processor.numTextures();
     for (int t = 0; t < numTextures; ++t) {
@@ -265,7 +264,7 @@
                                        GrPixelConfig config,
                                        const char* name,
                                        GrShaderFlags visibility,
-                                       GrGLSLSampler::SamplerArray* outSamplers) {
+                                       SkTArray<SamplerHandle>* outSamplers) {
     if (visibility & kVertex_GrShaderFlag) {
         ++fNumVertexSamplers;
     }
@@ -277,9 +276,12 @@
         ++fNumFragmentSamplers;
     }
     GrSLPrecision precision = this->glslCaps()->samplerPrecision(config, visibility);
-    UniformHandle u = this->uniformHandler()->addUniform(visibility, samplerType, precision, name);
-    fSamplerUniforms.push_back(u);
-    outSamplers->emplace_back(u, config);
+    SamplerHandle handle = this->uniformHandler()->addSampler(visibility,
+                                                              config,
+                                                              samplerType,
+                                                              precision,
+                                                              name);
+    outSamplers->emplace_back(handle);
 }
 
 void GrGLSLProgramBuilder::emitFSOutputSwizzle(bool hasSecondaryOutput) {
@@ -369,6 +371,10 @@
     this->uniformHandler()->appendUniformDecls(visibility, out);
 }
 
+const GrGLSLSampler& GrGLSLProgramBuilder::getSampler(SamplerHandle handle) const {
+    return this->uniformHandler()->getSampler(handle);
+}
+
 void GrGLSLProgramBuilder::addRTAdjustmentUniform(GrSLPrecision precision,
                                                   const char* name,
                                                   const char** outName) {
diff --git a/src/gpu/glsl/GrGLSLProgramBuilder.h b/src/gpu/glsl/GrGLSLProgramBuilder.h
index 3ce7daf..c175fc6 100644
--- a/src/gpu/glsl/GrGLSLProgramBuilder.h
+++ b/src/gpu/glsl/GrGLSLProgramBuilder.h
@@ -41,6 +41,10 @@
 
     void appendUniformDecls(GrShaderFlags visibility, SkString*) const;
 
+    typedef GrGLSLUniformHandler::SamplerHandle SamplerHandle;
+
+    const GrGLSLSampler& getSampler(SamplerHandle handle) const;
+
     // Handles for program uniforms (other than per-effect uniforms)
     struct BuiltinUniformHandles {
         UniformHandle       fRTAdjustmentUni;
@@ -104,8 +108,6 @@
 
     void finalizeShaders();
 
-    SkTArray<UniformHandle> fSamplerUniforms;
-
 private:
     // reset is called by program creator between each processor's emit code.  It increments the
     // stage offset for variable name mangling, and also ensures verfication variables in the
@@ -146,14 +148,15 @@
                                 const GrGLSLExpr4& coverageIn,
                                 bool ignoresCoverage,
                                 GrPixelLocalStorageState plsState);
+
     void emitSamplers(const GrProcessor& processor,
-                      GrGLSLSampler::SamplerArray* outTexSamplers,
-                      GrGLSLSampler::SamplerArray* outBufferSamplers);
+                      SkTArray<SamplerHandle>* outTexSamplers,
+                      SkTArray<SamplerHandle>* outBufferSamplers);
     void emitSampler(GrSLType samplerType,
                      GrPixelConfig,
                      const char* name,
                      GrShaderFlags visibility,
-                     GrGLSLSampler::SamplerArray* outSamplers);
+                     SkTArray<SamplerHandle>* outSamplers);
     void emitFSOutputSwizzle(bool hasSecondaryOutput);
     bool checkSamplerCounts();
 
diff --git a/src/gpu/glsl/GrGLSLSampler.h b/src/gpu/glsl/GrGLSLSampler.h
index 0fc67a9..a105009 100644
--- a/src/gpu/glsl/GrGLSLSampler.h
+++ b/src/gpu/glsl/GrGLSLSampler.h
@@ -9,27 +9,37 @@
 #define GrGLSLSampler_DEFINED
 
 #include "GrTypes.h"
-#include "SkTArray.h"
-#include "glsl/GrGLSLProgramDataManager.h"
+#include "GrTypesPriv.h"
+#include "SkString.h"
 
 class GrGLSLSampler {
 public:
-    typedef GrGLSLProgramDataManager::UniformHandle UniformHandle;
-    typedef SkTArray<GrGLSLSampler> SamplerArray;
+    virtual ~GrGLSLSampler() {}
 
-    GrGLSLSampler(UniformHandle uniform, GrPixelConfig config)
-        : fSamplerUniform(uniform)
+    explicit GrGLSLSampler(uint32_t visibility, GrPixelConfig config)
+        : fVisibility(visibility)
         , fConfig(config) {
         SkASSERT(kUnknown_GrPixelConfig != fConfig);
     }
 
+    uint32_t visibility() const { return fVisibility; }
     GrPixelConfig config() const { return fConfig; }
+    virtual GrSLType type() const = 0;
+
+    // Returns the string to be used for the sampler in glsl 2D texture functions (texture,
+    // texture2D, etc.)
+    const char* getSamplerNameForTexture2D() const {
+        SkASSERT(GrSLTypeIs2DTextureType(this->type()));
+        return this->onGetSamplerNameForTexture2D();
+    }
+
+    // Returns the string to be used for the sampler in glsl texelFetch.
+    virtual const char* getSamplerNameForTexelFetch() const = 0;
 
 private:
-    UniformHandle fSamplerUniform;
+    virtual const char* onGetSamplerNameForTexture2D() const = 0;
+    uint32_t      fVisibility;
     GrPixelConfig fConfig;
-
-    friend class GrGLSLShaderBuilder;
 };
 
 #endif
diff --git a/src/gpu/glsl/GrGLSLShaderBuilder.cpp b/src/gpu/glsl/GrGLSLShaderBuilder.cpp
index 1031f84..1342d1c 100644
--- a/src/gpu/glsl/GrGLSLShaderBuilder.cpp
+++ b/src/gpu/glsl/GrGLSLShaderBuilder.cpp
@@ -63,71 +63,68 @@
 }
 
 void GrGLSLShaderBuilder::appendTextureLookup(SkString* out,
-                                              const GrGLSLSampler& sampler,
+                                              SamplerHandle samplerHandle,
                                               const char* coordName,
                                               GrSLType varyingType) const {
     const GrGLSLCaps* glslCaps = fProgramBuilder->glslCaps();
-    GrGLSLUniformHandler* uniformHandler = fProgramBuilder->uniformHandler();
-    GrSLType samplerType = uniformHandler->getUniformVariable(sampler.fSamplerUniform).getType();
+    const GrGLSLSampler& sampler = fProgramBuilder->getSampler(samplerHandle);
+    GrSLType samplerType = sampler.type();
     if (samplerType == kSampler2DRect_GrSLType) {
         if (varyingType == kVec2f_GrSLType) {
             out->appendf("%s(%s, textureSize(%s) * %s)",
                          GrGLSLTexture2DFunctionName(varyingType, samplerType,
                                                      glslCaps->generation()),
-                         uniformHandler->getUniformCStr(sampler.fSamplerUniform),
-                         uniformHandler->getUniformCStr(sampler.fSamplerUniform),
+                         sampler.getSamplerNameForTexture2D(),
+                         sampler.getSamplerNameForTexture2D(),
                          coordName);
         } else {
             out->appendf("%s(%s, vec3(textureSize(%s) * %s.xy, %s.z))",
                          GrGLSLTexture2DFunctionName(varyingType, samplerType,
                                                      glslCaps->generation()),
-                         uniformHandler->getUniformCStr(sampler.fSamplerUniform),
-                         uniformHandler->getUniformCStr(sampler.fSamplerUniform),
+                         sampler.getSamplerNameForTexture2D(),
+                         sampler.getSamplerNameForTexture2D(),
                          coordName,
                          coordName);
         }
     } else {
         out->appendf("%s(%s, %s)",
                      GrGLSLTexture2DFunctionName(varyingType, samplerType, glslCaps->generation()),
-                     uniformHandler->getUniformCStr(sampler.fSamplerUniform),
+                     sampler.getSamplerNameForTexture2D(),
                      coordName);
     }
 
     this->appendTextureSwizzle(out, sampler.config());
 }
 
-void GrGLSLShaderBuilder::appendTextureLookup(const GrGLSLSampler& sampler,
+void GrGLSLShaderBuilder::appendTextureLookup(SamplerHandle samplerHandle,
                                               const char* coordName,
                                               GrSLType varyingType) {
-    this->appendTextureLookup(&this->code(), sampler, coordName, varyingType);
+    this->appendTextureLookup(&this->code(), samplerHandle, coordName, varyingType);
 }
 
 void GrGLSLShaderBuilder::appendTextureLookupAndModulate(const char* modulation,
-                                                         const GrGLSLSampler& sampler,
+                                                         SamplerHandle samplerHandle,
                                                          const char* coordName,
                                                          GrSLType varyingType) {
     SkString lookup;
-    this->appendTextureLookup(&lookup, sampler, coordName, varyingType);
+    this->appendTextureLookup(&lookup, samplerHandle, coordName, varyingType);
     this->codeAppend((GrGLSLExpr4(modulation) * GrGLSLExpr4(lookup)).c_str());
 }
 
 void GrGLSLShaderBuilder::appendTexelFetch(SkString* out,
-                                           const GrGLSLSampler& sampler,
+                                           SamplerHandle samplerHandle,
                                            const char* coordExpr) const {
-    const GrGLSLUniformHandler* uniformHandler = fProgramBuilder->uniformHandler();
+    const GrGLSLSampler& sampler = fProgramBuilder->getSampler(samplerHandle);
     SkASSERT(fProgramBuilder->glslCaps()->texelFetchSupport());
-    SkASSERT(GrSLTypeIsSamplerType(
-             uniformHandler->getUniformVariable(sampler.fSamplerUniform).getType()));
+    SkASSERT(GrSLTypeIsSamplerType(sampler.type()));
 
-    out->appendf("texelFetch(%s, %s)",
-                 uniformHandler->getUniformCStr(sampler.fSamplerUniform),
-                 coordExpr);
+    out->appendf("texelFetch(%s, %s)", sampler.getSamplerNameForTexelFetch(), coordExpr);
 
     this->appendTextureSwizzle(out, sampler.config());
 }
 
-void GrGLSLShaderBuilder::appendTexelFetch(const GrGLSLSampler& sampler, const char* coordExpr) {
-    this->appendTexelFetch(&this->code(), sampler, coordExpr);
+void GrGLSLShaderBuilder::appendTexelFetch(SamplerHandle samplerHandle, const char* coordExpr) {
+    this->appendTexelFetch(&this->code(), samplerHandle, coordExpr);
 }
 
 void GrGLSLShaderBuilder::appendTextureSwizzle(SkString* out, GrPixelConfig config) const {
diff --git a/src/gpu/glsl/GrGLSLShaderBuilder.h b/src/gpu/glsl/GrGLSLShaderBuilder.h
index ef7963f..ea36a56 100644
--- a/src/gpu/glsl/GrGLSLShaderBuilder.h
+++ b/src/gpu/glsl/GrGLSLShaderBuilder.h
@@ -9,14 +9,12 @@
 #define GrGLSLShaderBuilder_DEFINED
 
 #include "GrAllocator.h"
+#include "glsl/GrGLSLUniformHandler.h"
 #include "glsl/GrGLSLShaderVar.h"
 #include "SkTDArray.h"
 
 #include <stdarg.h>
 
-class GrGLSLProgramBuilder;
-class GrGLSLSampler;
-
 /**
   base class for all shaders builders
 */
@@ -25,17 +23,19 @@
     GrGLSLShaderBuilder(GrGLSLProgramBuilder* program);
     virtual ~GrGLSLShaderBuilder() {}
 
+    typedef GrGLSLUniformHandler::SamplerHandle SamplerHandle;
+
     /** Appends a 2D texture sample with projection if necessary. coordType must either be Vec2f or
         Vec3f. The latter is interpreted as projective texture coords. The vec length and swizzle
         order of the result depends on the GrTextureAccess associated with the GrGLSLSampler.
         */
     void appendTextureLookup(SkString* out,
-                             const GrGLSLSampler&,
+                             SamplerHandle,
                              const char* coordName,
                              GrSLType coordType = kVec2f_GrSLType) const;
 
     /** Version of above that appends the result to the shader code instead.*/
-    void appendTextureLookup(const GrGLSLSampler&,
+    void appendTextureLookup(SamplerHandle,
                              const char* coordName,
                              GrSLType coordType = kVec2f_GrSLType);
 
@@ -45,17 +45,17 @@
         vec4 or float. If modulation is "" or nullptr it this function acts as though
         appendTextureLookup were called. */
     void appendTextureLookupAndModulate(const char* modulation,
-                                        const GrGLSLSampler&,
+                                        SamplerHandle,
                                         const char* coordName,
                                         GrSLType coordType = kVec2f_GrSLType);
 
     /** Fetches an unfiltered texel from a sampler at integer coordinates. coordExpr must match the
         dimensionality of the sampler and must be within the sampler's range. coordExpr is emitted
         exactly once, so expressions like "idx++" are acceptable. */
-    void appendTexelFetch(SkString* out, const GrGLSLSampler&, const char* coordExpr) const;
+    void appendTexelFetch(SkString* out, SamplerHandle, const char* coordExpr) const;
 
     /** Version of above that appends the result to the shader code instead.*/
-    void appendTexelFetch(const GrGLSLSampler&, const char* coordExpr);
+    void appendTexelFetch(SamplerHandle, const char* coordExpr);
 
     /**
     * Adds a #define directive to the top of the shader.
diff --git a/src/gpu/glsl/GrGLSLUniformHandler.h b/src/gpu/glsl/GrGLSLUniformHandler.h
index a2f7053..56cac4a 100644
--- a/src/gpu/glsl/GrGLSLUniformHandler.h
+++ b/src/gpu/glsl/GrGLSLUniformHandler.h
@@ -12,12 +12,14 @@
 #include "GrGLSLShaderVar.h"
 
 class GrGLSLProgramBuilder;
+class GrGLSLSampler;
 
 class GrGLSLUniformHandler {
 public:
     virtual ~GrGLSLUniformHandler() {}
 
     typedef GrGLSLProgramDataManager::UniformHandle UniformHandle;
+    typedef GrGLSLProgramDataManager::UniformHandle SamplerHandle;
 
     /** Add a uniform variable to the current program, that has visibility in one or more shaders.
         visibility is a bitfield of GrShaderFlag values indicating from which shaders the uniform
@@ -30,6 +32,7 @@
                              GrSLPrecision precision,
                              const char* name,
                              const char** outName = nullptr) {
+        SkASSERT(!GrSLTypeIsSamplerType(type));
         return this->addUniformArray(visibility, type, precision, name, 0, outName);
     }
 
@@ -39,6 +42,7 @@
                                   const char* name,
                                   int arrayCount,
                                   const char** outName = nullptr) {
+        SkASSERT(!GrSLTypeIsSamplerType(type));
         return this->internalAddUniformArray(visibility, type, precision, name, true, arrayCount,
                                              outName);
     }
@@ -49,6 +53,7 @@
      * Shortcut for getUniformVariable(u).c_str()
      */
     virtual const char* getUniformCStr(UniformHandle u) const = 0;
+
 protected:
     explicit GrGLSLUniformHandler(GrGLSLProgramBuilder* program) : fProgramBuilder(program) {}
 
@@ -56,6 +61,23 @@
     GrGLSLProgramBuilder* fProgramBuilder;
 
 private:
+    virtual int numSamplers() const = 0;
+    virtual const GrGLSLSampler& getSampler(SamplerHandle handle) const = 0;
+
+    SamplerHandle addSampler(uint32_t visibility,
+                             GrPixelConfig config,
+                             GrSLType type,
+                             GrSLPrecision precision,
+                             const char* name) {
+        return this->internalAddSampler(visibility, config, type, precision, name);
+    }
+
+    virtual SamplerHandle internalAddSampler(uint32_t visibility,
+                                             GrPixelConfig config,
+                                             GrSLType type,
+                                             GrSLPrecision precision,
+                                             const char* name) = 0;
+
     virtual UniformHandle internalAddUniformArray(uint32_t visibility,
                                                   GrSLType type,
                                                   GrSLPrecision precision,
diff --git a/src/gpu/glsl/GrGLSLXferProcessor.h b/src/gpu/glsl/GrGLSLXferProcessor.h
index adc3d41..f4a8ebd 100644
--- a/src/gpu/glsl/GrGLSLXferProcessor.h
+++ b/src/gpu/glsl/GrGLSLXferProcessor.h
@@ -22,7 +22,8 @@
     GrGLSLXferProcessor() {}
     virtual ~GrGLSLXferProcessor() {}
 
-    typedef GrGLSLSampler::SamplerArray SamplerArray;
+    typedef GrGLSLProgramDataManager::UniformHandle SamplerHandle;
+
     struct EmitArgs {
         EmitArgs(GrGLSLXPFragmentBuilder* fragBuilder,
                  GrGLSLUniformHandler* uniformHandler,
@@ -32,8 +33,8 @@
                  const char* inputCoverage,
                  const char* outputPrimary,
                  const char* outputSecondary,
-                 const SamplerArray& texSamplers,
-                 const SamplerArray& bufferSamplers,
+                 const SamplerHandle* texSamplers,
+                 const SamplerHandle* bufferSamplers,
                  const bool usePLSDstRead)
             : fXPFragBuilder(fragBuilder)
             , fUniformHandler(uniformHandler)
@@ -55,8 +56,8 @@
         const char* fInputCoverage;
         const char* fOutputPrimary;
         const char* fOutputSecondary;
-        const SamplerArray& fTexSamplers;
-        const SamplerArray& fBufferSamplers;
+        const SamplerHandle* fTexSamplers;
+        const SamplerHandle* fBufferSamplers;
         bool fUsePLSDstRead;
     };
     /**
diff --git a/src/gpu/vk/GrVkGLSLSampler.h b/src/gpu/vk/GrVkGLSLSampler.h
new file mode 100644
index 0000000..4bfacae
--- /dev/null
+++ b/src/gpu/vk/GrVkGLSLSampler.h
@@ -0,0 +1,49 @@
+/*
+* Copyright 2016 Google Inc.
+*
+* Use of this source code is governed by a BSD-style license that can be
+* found in the LICENSE file.
+*/
+
+#ifndef GrVkGLSLSampler_DEFINED
+#define GrVkGLSLSampler_DEFINED
+
+#include "glsl/GrGLSLSampler.h"
+
+#include "glsl/GrGLSLShaderVar.h"
+
+class GrVkGLSLSampler : public GrGLSLSampler {
+public:
+    GrVkGLSLSampler(uint32_t visibility,
+                    GrPixelConfig config,
+                    GrSLType type,
+                    GrSLPrecision precision,
+                    const char* name,
+                    uint32_t binding,
+                    uint32_t set) : INHERITED(visibility, config), fBinding(binding) {
+        SkASSERT(GrSLTypeIsSamplerType(type));
+        fShaderVar.setType(type);
+        fShaderVar.setTypeModifier(GrGLSLShaderVar::kUniform_TypeModifier);
+        fShaderVar.setPrecision(precision);
+        fShaderVar.accessName()->set(name);
+        SkString layoutQualifier;
+        layoutQualifier.appendf("set=%d, binding=%d", set, binding);
+        fShaderVar.setLayoutQualifier(layoutQualifier.c_str());
+    }
+
+    GrSLType type() const override { return fShaderVar.getType(); }
+    uint32_t binding() const { return fBinding; }
+
+    const char* onGetSamplerNameForTexture2D() const override { return fShaderVar.c_str(); }
+    const char* getSamplerNameForTexelFetch() const override { return fShaderVar.c_str(); }
+
+private:
+    GrGLSLShaderVar fShaderVar;
+    uint32_t        fBinding;
+
+    friend class GrVkUniformHandler;
+
+    typedef GrGLSLSampler INHERITED;
+};
+
+#endif
diff --git a/src/gpu/vk/GrVkPipelineStateBuilder.cpp b/src/gpu/vk/GrVkPipelineStateBuilder.cpp
index 2bd8003..be30bb3 100644
--- a/src/gpu/vk/GrVkPipelineStateBuilder.cpp
+++ b/src/gpu/vk/GrVkPipelineStateBuilder.cpp
@@ -162,20 +162,18 @@
     VkShaderModule vertShaderModule;
     VkShaderModule fragShaderModule;
 
-    uint32_t numSamplers = fSamplerUniforms.count();
+    uint32_t numSamplers = (uint32_t)fUniformHandler.numSamplers();
 
     SkAutoTDeleteArray<VkDescriptorSetLayoutBinding> dsSamplerBindings(
                                                      new VkDescriptorSetLayoutBinding[numSamplers]);
     for (uint32_t i = 0; i < numSamplers; ++i) {
-        UniformHandle uniHandle = fSamplerUniforms[i];
-        GrVkUniformHandler::UniformInfo uniformInfo = fUniformHandler.getUniformInfo(uniHandle);
-        SkASSERT(kSampler2D_GrSLType == uniformInfo.fVariable.getType());
-        SkASSERT(GrVkUniformHandler::kSamplerDescSet == uniformInfo.fSetNumber);
-        SkASSERT(uniformInfo.fBinding == i);
-        dsSamplerBindings[i].binding = uniformInfo.fBinding;
+        const GrVkGLSLSampler& sampler =
+            static_cast<const GrVkGLSLSampler&>(fUniformHandler.getSampler(i));
+        SkASSERT(sampler.binding() == i);
+        dsSamplerBindings[i].binding = sampler.binding();
         dsSamplerBindings[i].descriptorType = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER;
         dsSamplerBindings[i].descriptorCount = 1;
-        dsSamplerBindings[i].stageFlags = visibility_to_vk_stage_flags(uniformInfo.fVisibility);
+        dsSamplerBindings[i].stageFlags = visibility_to_vk_stage_flags(sampler.visibility());
         dsSamplerBindings[i].pImmutableSamplers = nullptr;
     }
 
@@ -184,11 +182,10 @@
     dsSamplerLayoutCreateInfo.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO;
     dsSamplerLayoutCreateInfo.pNext = nullptr;
     dsSamplerLayoutCreateInfo.flags = 0;
-    dsSamplerLayoutCreateInfo.bindingCount = fSamplerUniforms.count();
+    dsSamplerLayoutCreateInfo.bindingCount = numSamplers;
     // Setting to nullptr fixes an error in the param checker validation layer. Even though
     // bindingCount is 0 (which is valid), it still tries to validate pBindings unless it is null.
-    dsSamplerLayoutCreateInfo.pBindings = fSamplerUniforms.count() ? dsSamplerBindings.get() :
-                                                                     nullptr;
+    dsSamplerLayoutCreateInfo.pBindings = numSamplers ? dsSamplerBindings.get() : nullptr;
 
     GR_VK_CALL_ERRCHECK(fGpu->vkInterface(),
                         CreateDescriptorSetLayout(fGpu->device(),
diff --git a/src/gpu/vk/GrVkPipelineStateDataManager.cpp b/src/gpu/vk/GrVkPipelineStateDataManager.cpp
index 60d7d7f..c72f209 100644
--- a/src/gpu/vk/GrVkPipelineStateDataManager.cpp
+++ b/src/gpu/vk/GrVkPipelineStateDataManager.cpp
@@ -32,11 +32,10 @@
             uniform.fArrayCount = uniformInfo.fVariable.getArrayCount();
             uniform.fType = uniformInfo.fVariable.getType();
         );
-        uniform.fBinding = uniformInfo.fBinding;
+        uniform.fBinding =
+            (kVertex_GrShaderFlag == uniformInfo.fVisibility) ? GrVkUniformHandler::kVertexBinding
+                                                              : GrVkUniformHandler::kFragBinding;
         uniform.fOffset = uniformInfo.fUBOffset;
-        SkDEBUGCODE(
-            uniform.fSetNumber = uniformInfo.fSetNumber;
-        );
     }
 }
 
@@ -59,7 +58,6 @@
     const Uniform& uni = fUniforms[u.toIndex()];
     SkASSERT(uni.fType == kFloat_GrSLType);
     SkASSERT(GrGLSLShaderVar::kNonArray == uni.fArrayCount);
-    SkASSERT(GrVkUniformHandler::kUniformBufferDescSet == uni.fSetNumber);
     void* buffer = this->getBufferPtrAndMarkDirty(uni);
     SkASSERT(sizeof(float) == 4);
     memcpy(buffer, &v0, sizeof(float));
@@ -73,7 +71,6 @@
     SkASSERT(arrayCount > 0);
     SkASSERT(arrayCount <= uni.fArrayCount ||
              (1 == arrayCount && GrGLSLShaderVar::kNonArray == uni.fArrayCount));
-    SkASSERT(GrVkUniformHandler::kUniformBufferDescSet == uni.fSetNumber);
 
     void* buffer = this->getBufferPtrAndMarkDirty(uni);
     SkASSERT(sizeof(float) == 4);
@@ -88,7 +85,6 @@
     const Uniform& uni = fUniforms[u.toIndex()];
     SkASSERT(uni.fType == kVec2f_GrSLType);
     SkASSERT(GrGLSLShaderVar::kNonArray == uni.fArrayCount);
-    SkASSERT(GrVkUniformHandler::kUniformBufferDescSet == uni.fSetNumber);
     void* buffer = this->getBufferPtrAndMarkDirty(uni);
     SkASSERT(sizeof(float) == 4);
     float v[2] = { v0, v1 };
@@ -103,7 +99,6 @@
     SkASSERT(arrayCount > 0);
     SkASSERT(arrayCount <= uni.fArrayCount ||
              (1 == arrayCount && GrGLSLShaderVar::kNonArray == uni.fArrayCount));
-    SkASSERT(GrVkUniformHandler::kUniformBufferDescSet == uni.fSetNumber);
 
     void* buffer = this->getBufferPtrAndMarkDirty(uni);
     SkASSERT(sizeof(float) == 4);
@@ -118,7 +113,6 @@
     const Uniform& uni = fUniforms[u.toIndex()];
     SkASSERT(uni.fType == kVec3f_GrSLType);
     SkASSERT(GrGLSLShaderVar::kNonArray == uni.fArrayCount);
-    SkASSERT(GrVkUniformHandler::kUniformBufferDescSet == uni.fSetNumber);
     void* buffer = this->getBufferPtrAndMarkDirty(uni);
     SkASSERT(sizeof(float) == 4);
     float v[3] = { v0, v1, v2 };
@@ -133,7 +127,6 @@
     SkASSERT(arrayCount > 0);
     SkASSERT(arrayCount <= uni.fArrayCount ||
              (1 == arrayCount && GrGLSLShaderVar::kNonArray == uni.fArrayCount));
-    SkASSERT(GrVkUniformHandler::kUniformBufferDescSet == uni.fSetNumber);
 
     void* buffer = this->getBufferPtrAndMarkDirty(uni);
     SkASSERT(sizeof(float) == 4);
@@ -152,7 +145,6 @@
     const Uniform& uni = fUniforms[u.toIndex()];
     SkASSERT(uni.fType == kVec4f_GrSLType);
     SkASSERT(GrGLSLShaderVar::kNonArray == uni.fArrayCount);
-    SkASSERT(GrVkUniformHandler::kUniformBufferDescSet == uni.fSetNumber);
     void* buffer = this->getBufferPtrAndMarkDirty(uni);
     SkASSERT(sizeof(float) == 4);
     float v[4] = { v0, v1, v2, v3 };
@@ -167,7 +159,6 @@
     SkASSERT(arrayCount > 0);
     SkASSERT(arrayCount <= uni.fArrayCount ||
              (1 == arrayCount && GrGLSLShaderVar::kNonArray == uni.fArrayCount));
-    SkASSERT(GrVkUniformHandler::kUniformBufferDescSet == uni.fSetNumber);
 
     void* buffer = this->getBufferPtrAndMarkDirty(uni);
     SkASSERT(sizeof(float) == 4);
@@ -214,7 +205,6 @@
     SkASSERT(arrayCount > 0);
     SkASSERT(arrayCount <= uni.fArrayCount ||
              (1 == arrayCount && GrGLSLShaderVar::kNonArray == uni.fArrayCount));
-    SkASSERT(GrVkUniformHandler::kUniformBufferDescSet == uni.fSetNumber);
 
     void* buffer;
     if (GrVkUniformHandler::kVertexBinding == uni.fBinding) {
diff --git a/src/gpu/vk/GrVkPipelineStateDataManager.h b/src/gpu/vk/GrVkPipelineStateDataManager.h
index 089d170..0a03579 100644
--- a/src/gpu/vk/GrVkPipelineStateDataManager.h
+++ b/src/gpu/vk/GrVkPipelineStateDataManager.h
@@ -59,7 +59,6 @@
         SkDEBUGCODE(
             GrSLType    fType;
             int         fArrayCount;
-            uint32_t    fSetNumber;
         );
     };
 
diff --git a/src/gpu/vk/GrVkUniformHandler.cpp b/src/gpu/vk/GrVkUniformHandler.cpp
index 4ffbcfe..3451d6b 100644
--- a/src/gpu/vk/GrVkUniformHandler.cpp
+++ b/src/gpu/vk/GrVkUniformHandler.cpp
@@ -136,6 +136,7 @@
     SkASSERT(0 == (~kVisibilityMask & visibility));
     SkASSERT(0 != visibility);
     SkASSERT(kDefault_GrSLPrecision == precision || GrSLTypeIsFloatType(type));
+    GrSLTypeIsFloatType(type);
 
     UniformInfo& uni = fUniforms.push_back();
     uni.fVariable.setType(type);
@@ -155,58 +156,63 @@
     SkASSERT(kVertex_GrShaderFlag == visibility || kFragment_GrShaderFlag == visibility);
     uni.fVisibility = visibility;
     uni.fVariable.setPrecision(precision);
-    if (GrSLTypeIsFloatType(type)) {
-        // When outputing the GLSL, only the outer uniform block will get the Uniform modifier. Thus
-        // we set the modifier to none for all uniforms declared inside the block.
-        uni.fVariable.setTypeModifier(GrGLSLShaderVar::kNone_TypeModifier);
+    // When outputing the GLSL, only the outer uniform block will get the Uniform modifier. Thus
+    // we set the modifier to none for all uniforms declared inside the block.
+    uni.fVariable.setTypeModifier(GrGLSLShaderVar::kNone_TypeModifier);
 
-        uint32_t* currentOffset = kVertex_GrShaderFlag == visibility ? &fCurrentVertexUBOOffset
-                                                                     : &fCurrentFragmentUBOOffset;
-        get_ubo_aligned_offset(&uni.fUBOffset, currentOffset, type, arrayCount);
-        uni.fSetNumber = kUniformBufferDescSet;
-        uni.fBinding = kVertex_GrShaderFlag == visibility ? kVertexBinding : kFragBinding;
+    uint32_t* currentOffset = kVertex_GrShaderFlag == visibility ? &fCurrentVertexUBOOffset
+                                                                   : &fCurrentFragmentUBOOffset;
+    get_ubo_aligned_offset(&uni.fUBOffset, currentOffset, type, arrayCount);
 
-        if (outName) {
-            *outName = uni.fVariable.c_str();
-        }
-    } else {
-        SkASSERT(type == kSampler2D_GrSLType);
-        uni.fVariable.setTypeModifier(GrGLSLShaderVar::kUniform_TypeModifier);
-
-        uni.fSetNumber = kSamplerDescSet;
-        uni.fBinding = fCurrentSamplerBinding++;
-        uni.fUBOffset = 0; // This value will be ignored, but initializing to avoid any errors.
-        SkString layoutQualifier;
-        layoutQualifier.appendf("set=%d, binding=%d", uni.fSetNumber, uni.fBinding);
-        uni.fVariable.setLayoutQualifier(layoutQualifier.c_str());
+    if (outName) {
+        *outName = uni.fVariable.c_str();
     }
 
     return GrGLSLUniformHandler::UniformHandle(fUniforms.count() - 1);
 }
 
+GrGLSLUniformHandler::SamplerHandle GrVkUniformHandler::internalAddSampler(uint32_t visibility,
+                                                                           GrPixelConfig config,
+                                                                           GrSLType type,
+                                                                           GrSLPrecision precision,
+                                                                           const char* name) {
+    SkASSERT(name && strlen(name));
+    SkDEBUGCODE(static const uint32_t kVisMask = kVertex_GrShaderFlag | kFragment_GrShaderFlag);
+    SkASSERT(0 == (~kVisMask & visibility));
+    SkASSERT(0 != visibility);
+    SkString mangleName;
+    char prefix = 'u';
+    fProgramBuilder->nameVariable(&mangleName, prefix, name, true);
+    fSamplers.emplace_back(visibility, config, type, precision, mangleName.c_str(),
+                           (uint32_t)fSamplers.count(), kSamplerDescSet);
+    return GrGLSLUniformHandler::SamplerHandle(fSamplers.count() - 1);
+}
+
 void GrVkUniformHandler::appendUniformDecls(GrShaderFlags visibility, SkString* out) const {
-    SkTArray<UniformInfo*> uniformBufferUniform;
-    // Used to collect all the variables that will be place inside the uniform buffer
-    SkString uniformsString;
     SkASSERT(kVertex_GrShaderFlag == visibility || kFragment_GrShaderFlag == visibility);
-    uint32_t uniformBinding = (visibility == kVertex_GrShaderFlag) ? kVertexBinding : kFragBinding;
+
+    for (int i = 0; i < fSamplers.count(); ++i) {
+        const GrVkGLSLSampler& sampler = fSamplers[i];
+        SkASSERT(sampler.type() == kSampler2D_GrSLType);
+        if (visibility == sampler.visibility()) {
+            sampler.fShaderVar.appendDecl(fProgramBuilder->glslCaps(), out);
+            out->append(";\n");
+        }
+    }
+
+    SkString uniformsString;
     for (int i = 0; i < fUniforms.count(); ++i) {
         const UniformInfo& localUniform = fUniforms[i];
         if (visibility == localUniform.fVisibility) {
             if (GrSLTypeIsFloatType(localUniform.fVariable.getType())) {
-                SkASSERT(uniformBinding == localUniform.fBinding);
-                SkASSERT(kUniformBufferDescSet == localUniform.fSetNumber);
                 localUniform.fVariable.appendDecl(fProgramBuilder->glslCaps(), &uniformsString);
                 uniformsString.append(";\n");
-            } else {
-                SkASSERT(localUniform.fVariable.getType() == kSampler2D_GrSLType);
-                SkASSERT(kSamplerDescSet == localUniform.fSetNumber);
-                localUniform.fVariable.appendDecl(fProgramBuilder->glslCaps(), out);
-                out->append(";\n");
             }
         }
     }
     if (!uniformsString.isEmpty()) {
+        uint32_t uniformBinding = (visibility == kVertex_GrShaderFlag) ? kVertexBinding
+                                                                       : kFragBinding;
         const char* stage = (visibility == kVertex_GrShaderFlag) ? "vertex" : "fragment";
         out->appendf("layout (set=%d, binding=%d) uniform %sUniformBuffer\n{\n",
                      kUniformBufferDescSet, uniformBinding, stage);
diff --git a/src/gpu/vk/GrVkUniformHandler.h b/src/gpu/vk/GrVkUniformHandler.h
index 46d27cd..f6060b0 100644
--- a/src/gpu/vk/GrVkUniformHandler.h
+++ b/src/gpu/vk/GrVkUniformHandler.h
@@ -11,6 +11,7 @@
 #include "glsl/GrGLSLUniformHandler.h"
 
 #include "GrAllocator.h"
+#include "GrVkGLSLSampler.h"
 #include "glsl/GrGLSLShaderVar.h"
 
 class GrVkUniformHandler : public GrGLSLUniformHandler {
@@ -30,8 +31,6 @@
     struct UniformInfo {
         GrGLSLShaderVar fVariable;
         uint32_t        fVisibility;
-        uint32_t        fSetNumber;
-        uint32_t        fBinding;
         uint32_t        fUBOffset;
     };
     typedef GrTAllocator<UniformInfo> UniformInfoArray;
@@ -61,6 +60,17 @@
                                           int arrayCount,
                                           const char** outName) override;
 
+    SamplerHandle internalAddSampler(uint32_t visibility,
+                                     GrPixelConfig config,
+                                     GrSLType type,
+                                     GrSLPrecision precision,
+                                     const char* name) override;
+
+    int numSamplers() const override { return fSamplers.count(); }
+    const GrGLSLSampler& getSampler(SamplerHandle handle) const override {
+        return fSamplers[handle.toIndex()];
+    }
+
     void appendUniformDecls(GrShaderFlags, SkString*) const override;
 
     bool hasVertexUniforms() const { return fCurrentVertexUBOOffset > 0; }
@@ -73,6 +83,8 @@
 
 
     UniformInfoArray fUniforms;
+    SkTArray<GrVkGLSLSampler> fSamplers;
+
     uint32_t         fCurrentVertexUBOOffset;
     uint32_t         fCurrentFragmentUBOOffset;
     uint32_t         fCurrentSamplerBinding;
