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

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

Issue 1825593002: GrVkGpu initialization cleanup. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Address comments (and rebase to ToT) 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
« no previous file with comments | « gyp/gpu.gypi ('k') | include/gpu/vk/GrVkInterface.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..6d45a2045da69d807338af9938cbc8fe609ef388
--- /dev/null
+++ b/include/gpu/vk/GrVkBackendContext.h
@@ -0,0 +1,41 @@
+/*
+ * 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 QueueFamilyIndex must match the family of the given queue. It is needed for CommandPool
+// creation, and any GrBackendObjects handed to us (e.g., for wrapped textures) need to be created
+// in or transitioned to that family.
+struct GrVkBackendContext : public SkRefCnt {
+ VkInstance fInstance;
+ VkPhysicalDevice fPhysicalDevice;
+ VkDevice fDevice;
+ VkQueue fQueue;
+ uint32_t fQueueFamilyIndex;
+ 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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698