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

Unified Diff: gpu/vulkan/vulkan_device_queue.h

Issue 1829163003: Added initial implementation of the Vulkan Context Provider. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@vk_surface_patch
Patch Set: Block off vulkan_cc with enable_vulkan (not relevant in future patch) 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 | « gpu/vulkan/vulkan_command_pool.cc ('k') | gpu/vulkan/vulkan_device_queue.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/vulkan/vulkan_device_queue.h
diff --git a/gpu/vulkan/vulkan_device_queue.h b/gpu/vulkan/vulkan_device_queue.h
new file mode 100644
index 0000000000000000000000000000000000000000..59d3e96039fe78f7f164f3abf2ab87d5a282c325
--- /dev/null
+++ b/gpu/vulkan/vulkan_device_queue.h
@@ -0,0 +1,63 @@
+// Copyright (c) 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef GPU_VULKAN_VULKAN_DEVICE_QUEUE_H_
+#define GPU_VULKAN_VULKAN_DEVICE_QUEUE_H_
+
+#include <vulkan/vulkan.h>
+
+#include "base/logging.h"
+#include "base/macros.h"
+#include "base/memory/scoped_ptr.h"
+#include "gpu/vulkan/vulkan_export.h"
+
+namespace gpu {
+
+class VulkanCommandPool;
+
+class VULKAN_EXPORT VulkanDeviceQueue {
+ public:
+ enum DeviceQueueOption {
+ GRAPHICS_QUEUE_FLAG = 0x01,
+ PRESENTATION_SUPPORT_QUEUE_FLAG = 0x02,
+ };
+
+ VulkanDeviceQueue();
+ ~VulkanDeviceQueue();
+
+ bool Initialize(uint32_t option);
+ void Destroy();
+
+ VkPhysicalDevice GetVulkanPhysicalDevice() const {
+ DCHECK_NE(static_cast<VkPhysicalDevice>(VK_NULL_HANDLE),
+ vk_physical_device_);
+ return vk_physical_device_;
+ }
+
+ VkDevice GetVulkanDevice() const {
+ DCHECK_NE(static_cast<VkDevice>(VK_NULL_HANDLE), vk_device_);
+ return vk_device_;
+ }
+
+ VkQueue GetVulkanQueue() const {
+ DCHECK_NE(static_cast<VkQueue>(VK_NULL_HANDLE), vk_queue_);
+ return vk_queue_;
+ }
+
+ uint32_t GetVulkanQueueIndex() const { return vk_queue_index_; }
+
+ scoped_ptr<gpu::VulkanCommandPool> CreateCommandPool();
+
+ private:
+ VkPhysicalDevice vk_physical_device_ = VK_NULL_HANDLE;
+ VkDevice vk_device_ = VK_NULL_HANDLE;
+ VkQueue vk_queue_ = VK_NULL_HANDLE;
+ uint32_t vk_queue_index_ = 0;
+
+ DISALLOW_COPY_AND_ASSIGN(VulkanDeviceQueue);
+};
+
+} // namespace gpu
+
+#endif // GPU_VULKAN_VULKAN_DEVICE_QUEUE_H_
« no previous file with comments | « gpu/vulkan/vulkan_command_pool.cc ('k') | gpu/vulkan/vulkan_device_queue.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698