Don't destroy VkPipelineLayouts until after command buffer recording.

Bug: skia:
Change-Id: I70be1dc6b29db9a9152e008293a7d0a276384011
Reviewed-on: https://skia-review.googlesource.com/135867
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
diff --git a/src/gpu/vk/GrVkPipelineLayout.h b/src/gpu/vk/GrVkPipelineLayout.h
new file mode 100644
index 0000000..7ab3242
--- /dev/null
+++ b/src/gpu/vk/GrVkPipelineLayout.h
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2018 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef GrVkPipelineLayout_DEFINED
+#define GrVkPipelineLayout_DEFINED
+
+#include "GrTypes.h"
+#include "GrVkResource.h"
+#include "vk/GrVkDefines.h"
+
+class GrVkPipelineLayout : public GrVkResource {
+public:
+    GrVkPipelineLayout(VkPipelineLayout layout) : fPipelineLayout(layout) {}
+
+    VkPipelineLayout layout() const { return fPipelineLayout; }
+
+#ifdef SK_TRACE_VK_RESOURCES
+    void dumpInfo() const override {
+        SkDebugf("GrVkPipelineLayout: %d (%d refs)\n", fPipelineLayout, this->getRefCnt());
+    }
+#endif
+
+private:
+    GrVkPipelineLayout(const GrVkPipelineLayout&);
+    GrVkPipelineLayout& operator=(const GrVkPipelineLayout&);
+
+    void freeGPUData(const GrVkGpu* gpu) const override;
+
+    VkPipelineLayout  fPipelineLayout;
+
+    typedef GrVkResource INHERITED;
+};
+
+#endif