Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Unified Diff: include/gpu/vk/GrVkBackendContext.h

Issue 1825593002: GrVkGpu initialization cleanup. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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
« no previous file with comments | « gyp/gpu.gypi ('k') | include/gpu/vk/GrVkInterface.h » ('j') | src/gpu/vk/GrVkExtensions.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698