Merge ProgramDesc's for GL and Vulkan

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2184413002

Review-Url: https://codereview.chromium.org/2184413002
diff --git a/src/gpu/gl/GrGLGpuProgramCache.cpp b/src/gpu/gl/GrGLGpuProgramCache.cpp
index f6e0eaa..4ba0d23 100644
--- a/src/gpu/gl/GrGLGpuProgramCache.cpp
+++ b/src/gpu/gl/GrGLGpuProgramCache.cpp
@@ -12,6 +12,7 @@
 #include "GrGLPathRendering.h"
 #include "glsl/GrGLSLFragmentProcessor.h"
 #include "glsl/GrGLSLProgramDataManager.h"
+#include "glsl/GrGLSLProgramDesc.h"
 #include "SkRTConf.h"
 #include "SkTSearch.h"
 
@@ -112,8 +113,8 @@
 #endif
 
     // Get GrGLProgramDesc
-    GrGLProgramDesc desc;
-    if (!GrGLProgramDescBuilder::Build(&desc, primProc, pipeline, *gpu->glCaps().glslCaps())) {
+    GrGLSLProgramDesc desc;
+    if (!GrGLSLProgramDescBuilder::Build(&desc, primProc, pipeline, *gpu->glCaps().glslCaps())) {
         GrCapsDebugf(gpu->caps(), "Failed to gl program descriptor!\n");
         return nullptr;
     }
diff --git a/src/gpu/gl/GrGLProgram.h b/src/gpu/gl/GrGLProgram.h
index 9f2b2e9..462ea14 100644
--- a/src/gpu/gl/GrGLProgram.h
+++ b/src/gpu/gl/GrGLProgram.h
@@ -10,10 +10,10 @@
 #define GrGLProgram_DEFINED
 
 #include "GrGLContext.h"
-#include "GrGLProgramDesc.h"
 #include "GrGLTexture.h"
 #include "GrGLProgramDataManager.h"
 #include "glsl/GrGLSLProgramDataManager.h"
+#include "glsl/GrGLSLProgramDesc.h"
 #include "glsl/GrGLSLUniformHandler.h"
 
 #include "SkString.h"
diff --git a/src/gpu/gl/GrGLProgramDesc.h b/src/gpu/gl/GrGLProgramDesc.h
deleted file mode 100644
index 0ebf6a2..0000000
--- a/src/gpu/gl/GrGLProgramDesc.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright 2013 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#ifndef GrGLProgramDesc_DEFINED
-#define GrGLProgramDesc_DEFINED
-
-#include "GrColor.h"
-#include "GrProgramDesc.h"
-#include "GrGpu.h"
-#include "GrTypesPriv.h"
-
-class GrGLGpu;
-class GrGLProgramDescBuilder;
-
-class GrGLProgramDesc : public GrProgramDesc {
-    friend class GrGLProgramDescBuilder;
-};
-
-/**
- * This class can be used to build a GrProgramDesc.  It also provides helpers for accessing
- * GL specific info in the header.
- */
-class GrGLProgramDescBuilder {
-public:
-    typedef GrProgramDesc::KeyHeader KeyHeader;
-    // The key, stored in fKey, is composed of five parts(first 2 are defined in the key itself):
-    // 1. uint32_t for total key length.
-    // 2. uint32_t for a checksum.
-    // 3. Header struct defined above.
-    // 4. Backend-specific information including per-processor keys and their key lengths.
-    //    Each processor's key is a variable length array of uint32_t.
-    enum {
-        // Part 3.
-        kHeaderOffset = GrGLProgramDesc::kHeaderOffset,
-        kHeaderSize = SkAlign4(sizeof(KeyHeader)),
-        // Part 4.
-        // This is the offset into the backenend specific part of the key, which includes
-        // per-processor keys.
-        kProcessorKeysOffset = kHeaderOffset + kHeaderSize,
-    };
-
-    /**
-     * Builds a GL specific program descriptor
-     *
-     * @param GrPrimitiveProcessor The geometry
-     * @param GrPipeline  The optimized drawstate.  The descriptor will represent a program
-     *                        which this optstate can use to draw with.  The optstate contains
-     *                        general draw information, as well as the specific color, geometry,
-     *                        and coverage stages which will be used to generate the GL Program for
-     *                        this optstate.
-     * @param GrGLSLCaps     Capabilities of the GLSL backend.
-     * @param GrProgramDesc  The built and finalized descriptor
-     **/
-    static bool Build(GrProgramDesc*,
-                      const GrPrimitiveProcessor&,
-                      const GrPipeline&,
-                      const GrGLSLCaps&);
-};
-
-#endif
diff --git a/src/gpu/gl/builders/GrGLProgramBuilder.cpp b/src/gpu/gl/builders/GrGLProgramBuilder.cpp
index c6422ca..2d06e43 100644
--- a/src/gpu/gl/builders/GrGLProgramBuilder.cpp
+++ b/src/gpu/gl/builders/GrGLProgramBuilder.cpp
@@ -16,13 +16,13 @@
 #include "SkTraceEvent.h"
 #include "gl/GrGLGpu.h"
 #include "gl/GrGLProgram.h"
-#include "gl/GrGLProgramDesc.h"
 #include "gl/GrGLSLPrettyPrint.h"
 #include "gl/builders/GrGLShaderStringBuilder.h"
 #include "glsl/GrGLSLCaps.h"
 #include "glsl/GrGLSLFragmentProcessor.h"
 #include "glsl/GrGLSLGeometryProcessor.h"
 #include "glsl/GrGLSLProgramDataManager.h"
+#include "glsl/GrGLSLProgramDesc.h"
 #include "glsl/GrGLSLSampler.h"
 #include "glsl/GrGLSLXferProcessor.h"
 
@@ -31,7 +31,7 @@
 
 GrGLProgram* GrGLProgramBuilder::CreateProgram(const GrPipeline& pipeline,
                                                const GrPrimitiveProcessor& primProc,
-                                               const GrGLProgramDesc& desc,
+                                               const GrGLSLProgramDesc& desc,
                                                GrGLGpu* gpu) {
     GrAutoLocaleSetter als("C");
 
@@ -57,7 +57,7 @@
 GrGLProgramBuilder::GrGLProgramBuilder(GrGLGpu* gpu,
                                        const GrPipeline& pipeline,
                                        const GrPrimitiveProcessor& primProc,
-                                       const GrGLProgramDesc& desc)
+                                       const GrGLSLProgramDesc& desc)
     : INHERITED(pipeline, primProc, desc)
     , fGpu(gpu)
     , fVaryingHandler(this)
diff --git a/src/gpu/gl/builders/GrGLProgramBuilder.h b/src/gpu/gl/builders/GrGLProgramBuilder.h
index 481d63b..4f441be 100644
--- a/src/gpu/gl/builders/GrGLProgramBuilder.h
+++ b/src/gpu/gl/builders/GrGLProgramBuilder.h
@@ -17,7 +17,7 @@
 
 class GrFragmentProcessor;
 class GrGLContextInfo;
-class GrGLProgramDesc;
+class GrGLSLProgramDesc;
 class GrGLSLShaderBuilder;
 class GrGLSLCaps;
 
@@ -32,7 +32,7 @@
      */
     static GrGLProgram* CreateProgram(const GrPipeline&,
                                       const GrPrimitiveProcessor&,
-                                      const GrGLProgramDesc&,
+                                      const GrGLSLProgramDesc&,
                                       GrGLGpu*);
 
     const GrCaps* caps() const override;
@@ -42,7 +42,7 @@
 
 private:
     GrGLProgramBuilder(GrGLGpu*, const GrPipeline&, const GrPrimitiveProcessor&,
-                       const GrGLProgramDesc&);
+                       const GrGLSLProgramDesc&);
 
     bool compileAndAttachShaders(GrGLSLShaderBuilder& shader,
                                  GrGLuint programId,
diff --git a/src/gpu/gl/GrGLProgramDesc.cpp b/src/gpu/glsl/GrGLSLProgramDesc.cpp
similarity index 92%
rename from src/gpu/gl/GrGLProgramDesc.cpp
rename to src/gpu/glsl/GrGLSLProgramDesc.cpp
index 695a46d..c44759a 100644
--- a/src/gpu/gl/GrGLProgramDesc.cpp
+++ b/src/gpu/glsl/GrGLSLProgramDesc.cpp
@@ -1,18 +1,15 @@
 /*
- * Copyright 2013 Google Inc.
+ * Copyright 2016 Google Inc.
  *
  * Use of this source code is governed by a BSD-style license that can be
  * found in the LICENSE file.
  */
-#include "GrGLProgramDesc.h"
+#include "GrGLSLProgramDesc.h"
 
 #include "GrProcessor.h"
 #include "GrPipeline.h"
 #include "GrRenderTargetPriv.h"
 #include "SkChecksum.h"
-#include "gl/GrGLDefines.h"
-#include "gl/GrGLTexture.h"
-#include "gl/GrGLTypes.h"
 #include "glsl/GrGLSLFragmentProcessor.h"
 #include "glsl/GrGLSLFragmentShaderBuilder.h"
 #include "glsl/GrGLSLCaps.h"
@@ -78,7 +75,7 @@
     uint32_t classID = proc.classID();
 
     // Currently we allow 16 bits for the class id and the overall processor key size.
-    static const uint32_t kMetaKeyInvalidMask = ~((uint32_t) SK_MaxU16);
+    static const uint32_t kMetaKeyInvalidMask = ~((uint32_t)SK_MaxU16);
     if ((processorKeySize | classID) & kMetaKeyInvalidMask) {
         return false;
     }
@@ -107,16 +104,16 @@
                                                                fp.numTransformsExclChildren()), b);
 }
 
-bool GrGLProgramDescBuilder::Build(GrProgramDesc* desc,
-                                   const GrPrimitiveProcessor& primProc,
-                                   const GrPipeline& pipeline,
-                                   const GrGLSLCaps& glslCaps) {
+bool GrGLSLProgramDescBuilder::Build(GrProgramDesc* desc,
+                                     const GrPrimitiveProcessor& primProc,
+                                     const GrPipeline& pipeline,
+                                     const GrGLSLCaps& glslCaps) {
     // The descriptor is used as a cache key. Thus when a field of the
     // descriptor will not affect program generation (because of the attribute
     // bindings in use or other descriptor field settings) it should be set
     // to a canonical value to avoid duplicate programs with different keys.
 
-    GrGLProgramDesc* glDesc = (GrGLProgramDesc*) desc;
+    GrGLSLProgramDesc* glDesc = (GrGLSLProgramDesc*)desc;
 
     GR_STATIC_ASSERT(0 == kProcessorKeysOffset % sizeof(uint32_t));
     // Make room for everything up to the effect keys.
diff --git a/src/gpu/glsl/GrGLSLProgramDesc.h b/src/gpu/glsl/GrGLSLProgramDesc.h
new file mode 100644
index 0000000..1498179
--- /dev/null
+++ b/src/gpu/glsl/GrGLSLProgramDesc.h
@@ -0,0 +1,63 @@
+/*
+* 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 GrGLSLProgramDesc_DEFINED
+#define GrGLSLProgramDesc_DEFINED
+
+#include "GrColor.h"
+#include "GrProgramDesc.h"
+#include "GrGpu.h"
+#include "GrTypesPriv.h"
+
+class GrGLSLProgramDescBuilder;
+
+class GrGLSLProgramDesc : public GrProgramDesc {
+    friend class GrGLSLProgramDescBuilder;
+};
+
+/**
+* This class can be used to build a GrProgramDesc.  It also provides helpers for accessing
+* GL specific info in the header.
+*/
+class GrGLSLProgramDescBuilder {
+public:
+    typedef GrProgramDesc::KeyHeader KeyHeader;
+    // The key, stored in fKey, is composed of five parts(first 2 are defined in the key itself):
+    // 1. uint32_t for total key length.
+    // 2. uint32_t for a checksum.
+    // 3. Header struct defined above.
+    // 4. Backend-specific information including per-processor keys and their key lengths.
+    //    Each processor's key is a variable length array of uint32_t.
+    enum {
+        // Part 3.
+        kHeaderOffset = GrGLSLProgramDesc::kHeaderOffset,
+        kHeaderSize = SkAlign4(sizeof(KeyHeader)),
+        // Part 4.
+        // This is the offset into the backenend specific part of the key, which includes
+        // per-processor keys.
+        kProcessorKeysOffset = kHeaderOffset + kHeaderSize,
+    };
+
+    /**
+    * Builds a GLSL specific program descriptor
+    *
+    * @param GrPrimitiveProcessor The geometry
+    * @param GrPipeline  The optimized drawstate.  The descriptor will represent a program
+    *                        which this optstate can use to draw with.  The optstate contains
+    *                        general draw information, as well as the specific color, geometry,
+    *                        and coverage stages which will be used to generate the GL Program for
+    *                        this optstate.
+    * @param GrGLSLCaps     Capabilities of the GLSL backend.
+    * @param GrProgramDesc  The built and finalized descriptor
+    **/
+    static bool Build(GrProgramDesc*,
+                      const GrPrimitiveProcessor&,
+                      const GrPipeline&,
+                      const GrGLSLCaps&);
+};
+
+#endif
diff --git a/src/gpu/vk/GrVkPipeline.cpp b/src/gpu/vk/GrVkPipeline.cpp
index e401d8d..c7e99d2 100644
--- a/src/gpu/vk/GrVkPipeline.cpp
+++ b/src/gpu/vk/GrVkPipeline.cpp
@@ -11,7 +11,6 @@
 #include "GrPipeline.h"
 #include "GrVkCommandBuffer.h"
 #include "GrVkGpu.h"
-#include "GrVkProgramDesc.h"
 #include "GrVkRenderTarget.h"
 #include "GrVkUtil.h"
 
diff --git a/src/gpu/vk/GrVkPipelineState.h b/src/gpu/vk/GrVkPipelineState.h
index 60c1db6..f92cdea 100644
--- a/src/gpu/vk/GrVkPipelineState.h
+++ b/src/gpu/vk/GrVkPipelineState.h
@@ -12,9 +12,9 @@
 #include "GrStencilSettings.h"
 #include "GrVkDescriptorSetManager.h"
 #include "GrVkImage.h"
-#include "GrVkProgramDesc.h"
 #include "GrVkPipelineStateDataManager.h"
 #include "glsl/GrGLSLProgramBuilder.h"
+#include "glsl/GrGLSLProgramDesc.h"
 
 #include "vk/GrVkDefines.h"
 
@@ -72,7 +72,7 @@
      * For Vulkan we want to cache the entire VkPipeline for reuse of draws. The Desc here holds all
      * the information needed to differentiate one pipeline from another.
      *
-     * The GrVkProgramDesc contains all the information need to create the actual shaders for the
+     * The GrGLSLProgramDesc contains all the information need to create the actual shaders for the
      * pipeline.
      *
      * The fStateKey is used to store all the inputs for the rest of the state stored on the
@@ -86,7 +86,7 @@
      */
     struct Desc {
         uint32_t                fChecksum;
-        GrVkProgramDesc         fProgramDesc;
+        GrGLSLProgramDesc       fProgramDesc;
 
         enum {
             kRenderPassKeyAlloc = 12, // This is typical color attachment with no stencil or msaa
diff --git a/src/gpu/vk/GrVkPipelineStateBuilder.cpp b/src/gpu/vk/GrVkPipelineStateBuilder.cpp
index a3032d7..f607c98 100644
--- a/src/gpu/vk/GrVkPipelineStateBuilder.cpp
+++ b/src/gpu/vk/GrVkPipelineStateBuilder.cpp
@@ -39,7 +39,7 @@
 GrVkPipelineStateBuilder::GrVkPipelineStateBuilder(GrVkGpu* gpu,
                                                    const GrPipeline& pipeline,
                                                    const GrPrimitiveProcessor& primProc,
-                                                   const GrVkProgramDesc& desc)
+                                                   const GrGLSLProgramDesc& desc)
     : INHERITED(pipeline, primProc, desc)
     , fGpu(gpu)
     , fVaryingHandler(this)
diff --git a/src/gpu/vk/GrVkPipelineStateBuilder.h b/src/gpu/vk/GrVkPipelineStateBuilder.h
index 2f78116..96d9fe2 100644
--- a/src/gpu/vk/GrVkPipelineStateBuilder.h
+++ b/src/gpu/vk/GrVkPipelineStateBuilder.h
@@ -19,7 +19,7 @@
 
 class GrVkGpu;
 class GrVkRenderPass;
-class GrVkProgramDesc;
+class GrGLSLProgramDesc;
 
 class GrVkPipelineStateBuilder : public GrGLSLProgramBuilder {
 public:
@@ -48,7 +48,7 @@
     GrVkPipelineStateBuilder(GrVkGpu*,
                              const GrPipeline&,
                              const GrPrimitiveProcessor&,
-                             const GrVkProgramDesc&);
+                             const GrGLSLProgramDesc&);
 
     GrVkPipelineState* finalize(GrPrimitiveType primitiveType,
                                 const GrVkRenderPass& renderPass,
diff --git a/src/gpu/vk/GrVkPipelineStateCache.cpp b/src/gpu/vk/GrVkPipelineStateCache.cpp
index fc3464c..b8335e8 100644
--- a/src/gpu/vk/GrVkPipelineStateCache.cpp
+++ b/src/gpu/vk/GrVkPipelineStateCache.cpp
@@ -99,10 +99,10 @@
 #endif
     // Get GrVkProgramDesc
     GrVkPipelineState::Desc desc;
-    if (!GrVkProgramDescBuilder::Build(&desc.fProgramDesc,
-                                       primProc,
-                                       pipeline,
-                                       *fGpu->vkCaps().glslCaps())) {
+    if (!GrGLSLProgramDescBuilder::Build(&desc.fProgramDesc,
+                                         primProc,
+                                         pipeline,
+                                         *fGpu->vkCaps().glslCaps())) {
         GrCapsDebugf(fGpu->caps(), "Failed to build vk program descriptor!\n");
         return nullptr;
     }
diff --git a/src/gpu/vk/GrVkProgramDesc.cpp b/src/gpu/vk/GrVkProgramDesc.cpp
deleted file mode 100644
index 2154af6..0000000
--- a/src/gpu/vk/GrVkProgramDesc.cpp
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- * Copyright 2015 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-#include "GrVkProgramDesc.h"
-
-//#include "GrVkProcessor.h"
-#include "GrProcessor.h"
-#include "GrPipeline.h"
-#include "GrRenderTargetPriv.h"
-#include "GrVkGpu.h"
-#include "GrVkUtil.h"
-#include "SkChecksum.h"
-#include "glsl/GrGLSLFragmentProcessor.h"
-#include "glsl/GrGLSLFragmentShaderBuilder.h"
-#include "glsl/GrGLSLCaps.h"
-
-static void add_texture_key(GrProcessorKeyBuilder* b, const GrProcessor& proc,
-                            const GrGLSLCaps& caps) {
-    int numTextures = proc.numTextures();
-    SkASSERT(0 == proc.numBuffers());
-    // Need two bytes per key (swizzle, sampler type, and precision).
-    int word32Count = (proc.numTextures() + 1) / 2;
-    if (0 == word32Count) {
-        return;
-    }
-    uint16_t* k16 = SkTCast<uint16_t*>(b->add32n(word32Count));
-    for (int i = 0; i < numTextures; ++i) {
-        const GrTextureAccess& access = proc.textureAccess(i);
-        GrTexture* texture = access.getTexture();
-        k16[i] = SkToU16(caps.configTextureSwizzle(texture->config()).asKey() |
-                         (caps.samplerPrecision(texture->config(), access.getVisibility()) << 8));
-    }
-    // zero the last 16 bits if the number of textures is odd.
-    if (numTextures & 0x1) {
-        k16[numTextures] = 0;
-    }
-}
-
-/**
-* A function which emits a meta key into the key builder.  This is required because shader code may
-* be dependent on properties of the effect that the effect itself doesn't use
-* in its key (e.g. the pixel format of textures used). So we create a meta-key for
-* every effect using this function. It is also responsible for inserting the effect's class ID
-* which must be different for every GrProcessor subclass. It can fail if an effect uses too many
-* transforms, etc, for the space allotted in the meta-key.  NOTE, both FPs and GPs share this
-* function because it is hairy, though FPs do not have attribs, and GPs do not have transforms
-*/
-static bool gen_meta_key(const GrProcessor& proc,
-                         const GrGLSLCaps& glslCaps,
-                         uint32_t transformKey,
-                         GrProcessorKeyBuilder* b) {
-    size_t processorKeySize = b->size();
-    uint32_t classID = proc.classID();
-
-    // Currently we allow 16 bits for the class id and the overall processor key size.
-    static const uint32_t kMetaKeyInvalidMask = ~((uint32_t)SK_MaxU16);
-    if ((processorKeySize | classID) & kMetaKeyInvalidMask) {
-        return false;
-    }
-
-    add_texture_key(b, proc, glslCaps);
-
-    uint32_t* key = b->add32n(2);
-    key[0] = (classID << 16) | SkToU32(processorKeySize);
-    key[1] = transformKey;
-    return true;
-}
-
-static bool gen_frag_proc_and_meta_keys(const GrPrimitiveProcessor& primProc,
-                                        const GrFragmentProcessor& fp,
-                                        const GrGLSLCaps& glslCaps,
-                                        GrProcessorKeyBuilder* b) {
-    for (int i = 0; i < fp.numChildProcessors(); ++i) {
-        if (!gen_frag_proc_and_meta_keys(primProc, fp.childProcessor(i), glslCaps, b)) {
-            return false;
-        }
-    }
-
-    fp.getGLSLProcessorKey(glslCaps, b);
-
-    return gen_meta_key(fp, glslCaps, primProc.getTransformKey(fp.coordTransforms(),
-        fp.numTransformsExclChildren()), b);
-}
-
-bool GrVkProgramDescBuilder::Build(GrProgramDesc* desc,
-                                   const GrPrimitiveProcessor& primProc,
-                                   const GrPipeline& pipeline,
-                                   const GrGLSLCaps& glslCaps) {
-    // The descriptor is used as a cache key. Thus when a field of the
-    // descriptor will not affect program generation (because of the attribute
-    // bindings in use or other descriptor field settings) it should be set
-    // to a canonical value to avoid duplicate programs with different keys.
-
-    GrVkProgramDesc* vkDesc = (GrVkProgramDesc*)desc;
-
-    GR_STATIC_ASSERT(0 == kProcessorKeysOffset % sizeof(uint32_t));
-    // Make room for everything up to the effect keys.
-    vkDesc->key().reset();
-    vkDesc->key().push_back_n(kProcessorKeysOffset);
-
-    GrProcessorKeyBuilder b(&vkDesc->key());
-
-    primProc.getGLSLProcessorKey(glslCaps, &b);
-    if (!gen_meta_key(primProc, glslCaps, 0, &b)) {
-        vkDesc->key().reset();
-        return false;
-    }
-    GrProcessor::RequiredFeatures requiredFeatures = primProc.requiredFeatures();
-
-    for (int i = 0; i < pipeline.numFragmentProcessors(); ++i) {
-        const GrFragmentProcessor& fp = pipeline.getFragmentProcessor(i);
-        if (!gen_frag_proc_and_meta_keys(primProc, fp, glslCaps, &b)) {
-            vkDesc->key().reset();
-            return false;
-        }
-        requiredFeatures |= fp.requiredFeatures();
-    }
-
-    const GrXferProcessor& xp = pipeline.getXferProcessor();
-    xp.getGLSLProcessorKey(glslCaps, &b);
-    if (!gen_meta_key(xp, glslCaps, 0, &b)) {
-        vkDesc->key().reset();
-        return false;
-    }
-    requiredFeatures |= xp.requiredFeatures();
-
-    // --------DO NOT MOVE HEADER ABOVE THIS LINE--------------------------------------------------
-    // Because header is a pointer into the dynamic array, we can't push any new data into the key
-    // below here.
-    KeyHeader* header = vkDesc->atOffset<KeyHeader, kHeaderOffset>();
-
-    // make sure any padding in the header is zeroed.
-    memset(header, 0, kHeaderSize);
-
-    GrRenderTarget* rt = pipeline.getRenderTarget();
-
-    if (requiredFeatures & (GrProcessor::kFragmentPosition_RequiredFeature |
-                            GrProcessor::kSampleLocations_RequiredFeature)) {
-        header->fSurfaceOriginKey = GrGLSLFragmentShaderBuilder::KeyForSurfaceOrigin(rt->origin());
-    } else {
-        header->fSurfaceOriginKey = 0;
-    }
-
-    if (requiredFeatures & GrProcessor::kSampleLocations_RequiredFeature) {
-        SkASSERT(pipeline.isHWAntialiasState());
-        header->fSamplePatternKey =
-            rt->renderTargetPriv().getMultisampleSpecs(pipeline.getStencil()).fUniqueID;
-    } else {
-        header->fSamplePatternKey = 0;
-    }
-
-    header->fOutputSwizzle = glslCaps.configOutputSwizzle(rt->config()).asKey();
-
-    if (pipeline.ignoresCoverage()) {
-        header->fIgnoresCoverage = 1;
-    } else {
-        header->fIgnoresCoverage = 0;
-    }
-
-    header->fSnapVerticesToPixelCenters = pipeline.snapVerticesToPixelCenters();
-    header->fColorEffectCnt = pipeline.numColorFragmentProcessors();
-    header->fCoverageEffectCnt = pipeline.numCoverageFragmentProcessors();
-    vkDesc->finalize();
-    return true;
-}
diff --git a/src/gpu/vk/GrVkProgramDesc.h b/src/gpu/vk/GrVkProgramDesc.h
deleted file mode 100644
index 3e9a4cb..0000000
--- a/src/gpu/vk/GrVkProgramDesc.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright 2015 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#ifndef GrVkProgramDesc_DEFINED
-#define GrVkProgramDesc_DEFINED
-
-#include "GrColor.h"
-#include "GrProgramDesc.h"
-#include "GrGpu.h"
-#include "GrTypesPriv.h"
-
-#include "vk/GrVkDefines.h"
-
-class GrVkGpu;
-class GrVkProgramDescBuilder;
-
-class GrVkProgramDesc : public GrProgramDesc {
-private:
-    friend class GrVkProgramDescBuilder;
-};
-
-/**
- * This class can be used to build a GrProgramDesc.  It also provides helpers for accessing
- * GL specific info in the header.
- */
-class GrVkProgramDescBuilder {
-public:
-    typedef GrProgramDesc::KeyHeader KeyHeader;
-    // The key, stored in fKey, is composed of five parts(first 2 are defined in the key itself):
-    // 1. uint32_t for total key length.
-    // 2. uint32_t for a checksum.
-    // 3. Header struct defined above.
-    // 4. Backend-specific information including per-processor keys and their key lengths.
-    //    Each processor's key is a variable length array of uint32_t.
-    enum {
-        // Part 3.
-        kHeaderOffset = GrVkProgramDesc::kHeaderOffset,
-        kHeaderSize = SkAlign4(sizeof(KeyHeader)),
-        // Part 4.
-        // This is the offset into the backenend specific part of the key, which includes
-        // per-processor keys.
-        kProcessorKeysOffset = kHeaderOffset + kHeaderSize,
-    };
-
-    /**
-     * Builds a GL specific program descriptor
-     *
-     * @param GrPrimitiveProcessor The geometry
-     * @param GrPipeline  The optimized drawstate.  The descriptor will represent a program
-     *                        which this optstate can use to draw with.  The optstate contains
-     *                        general draw information, as well as the specific color, geometry,
-     *                        and coverage stages which will be used to generate the GL Program for
-     *                        this optstate.
-     * @param GrVkGpu  A GL Gpu, the caps and Gpu object are used to output processor specific
-     *                 parts of the descriptor.
-     * @param GrProgramDesc  The built and finalized descriptor
-     **/
-    static bool Build(GrProgramDesc*,
-                      const GrPrimitiveProcessor&,
-                      const GrPipeline&,
-                      const GrGLSLCaps&);
-};
-
-#endif