Index: include/gpu/vk/GrVkBackendContext.h |
diff --git a/include/gpu/vk/GrVkBackendContext.h b/include/gpu/vk/GrVkBackendContext.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..7bfa02aab09e69d3b6b9c7199ebee79aeb3fbe78 |
--- /dev/null |
+++ b/include/gpu/vk/GrVkBackendContext.h |
@@ -0,0 +1,39 @@ |
+/* |
+ * 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 GrVkBackendContext_DEFINED |
+#define GrVkBackendContext_DEFINED |
+ |
+#include "SkRefCnt.h" |
+ |
+#include "vulkan/vulkan.h" |
+ |
+#ifdef SK_DEBUG |
+#define ENABLE_VK_LAYERS |
+#endif |
+ |
+struct GrVkInterface; |
+ |
+// The BackendContext contains all of the base Vulkan objects needed by the GrVkGpu. The assumption |
+// is that the client will set these up and pass them to the GrVkGpu constructor. The VkDevice |
+// created must support at least one graphics queue, which is passed in as well. The client may |
+// create more than one queue (reserving one for swap chain presentation, for example). |
+struct GrVkBackendContext : public SkRefCnt { |
egdaniel
2016/03/23 14:51:57
Does the comment about more than one queue add any
jvanverth1
2016/03/23 15:44:13
Done.
|
+ VkInstance fInstance; |
+ VkPhysicalDevice fPhysicalDevice; |
+ VkDevice fDevice; |
+ VkQueue fQueue; |
+ uint32_t fQueueFamilyIndex; |
egdaniel
2016/03/23 14:51:57
The fact that we pass in this queue family index h
jvanverth1
2016/03/23 15:44:13
As discussed, the contract with the client will be
|
+ SkAutoTUnref<const GrVkInterface> fInterface; |
+ |
+ // Helper function to create the default Vulkan objects needed by the GrVkGpu object |
+ static const GrVkBackendContext* Create(); |
+ |
+ ~GrVkBackendContext() override; |
+}; |
+ |
+#endif |