Add vulkan files into skia repo. This is an incomplete backend with only partial functionality at this time.
R=robertphillips@google.com
TBR=bsalomon@google.com
BUG=skia:4955
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1718693002
Committed: https://skia.googlesource.com/skia/+/48cf268defad66f58f1aa03b4835e5583be96b2f
Review URL: https://codereview.chromium.org/1718693002
diff --git a/src/gpu/vk/GrVkDescriptorPool.h b/src/gpu/vk/GrVkDescriptorPool.h
new file mode 100644
index 0000000..ebbf230
--- /dev/null
+++ b/src/gpu/vk/GrVkDescriptorPool.h
@@ -0,0 +1,56 @@
+/*
+* 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 GrVkDescriptorPool_DEFINED
+#define GrVkDescriptorPool_DEFINED
+
+#include "GrVkResource.h"
+
+#include "vulkan/vulkan.h"
+
+class GrVkGpu;
+
+class GrVkDescriptorPool : public GrVkResource {
+public:
+ class DescriptorTypeCounts {
+ public:
+ DescriptorTypeCounts() {
+ memset(fDescriptorTypeCount, 0, sizeof(fDescriptorTypeCount));
+ }
+
+ void setTypeCount(VkDescriptorType type, uint8_t count);
+ uint32_t numPoolSizes() const;
+
+ // Determines if for each i, that.fDescriptorTypeCount[i] <= fDescriptorTypeCount[i];
+ bool isSuperSet(const DescriptorTypeCounts& that) const;
+ private:
+ uint8_t fDescriptorTypeCount[VK_DESCRIPTOR_TYPE_RANGE_SIZE];
+
+ friend class GrVkDescriptorPool;
+ };
+
+ explicit GrVkDescriptorPool(const GrVkGpu* gpu, const DescriptorTypeCounts& typeCounts);
+
+ VkDescriptorPool descPool() const { return fDescPool; }
+
+ void reset(const GrVkGpu* gpu);
+
+ // Returns whether or not this descriptor pool could be used, assuming it gets fully reset and
+ // not in use by another draw, to support the requested typeCounts.
+ bool isCompatible(const DescriptorTypeCounts& typeCounts) const;
+
+private:
+ void freeGPUData(const GrVkGpu* gpu) const override;
+
+ DescriptorTypeCounts fTypeCounts;
+ VkDescriptorPool fDescPool;
+
+ typedef GrVkResource INHERITED;
+};
+
+
+#endif
\ No newline at end of file