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

Side by Side 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, 8 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef GPU_VULKAN_VULKAN_DEVICE_QUEUE_H_
6 #define GPU_VULKAN_VULKAN_DEVICE_QUEUE_H_
7
8 #include <vulkan/vulkan.h>
9
10 #include "base/logging.h"
11 #include "base/macros.h"
12 #include "base/memory/scoped_ptr.h"
13 #include "gpu/vulkan/vulkan_export.h"
14
15 namespace gpu {
16
17 class VulkanCommandPool;
18
19 class VULKAN_EXPORT VulkanDeviceQueue {
20 public:
21 enum DeviceQueueOption {
22 GRAPHICS_QUEUE_FLAG = 0x01,
23 PRESENTATION_SUPPORT_QUEUE_FLAG = 0x02,
24 };
25
26 VulkanDeviceQueue();
27 ~VulkanDeviceQueue();
28
29 bool Initialize(uint32_t option);
30 void Destroy();
31
32 VkPhysicalDevice GetVulkanPhysicalDevice() const {
33 DCHECK_NE(static_cast<VkPhysicalDevice>(VK_NULL_HANDLE),
34 vk_physical_device_);
35 return vk_physical_device_;
36 }
37
38 VkDevice GetVulkanDevice() const {
39 DCHECK_NE(static_cast<VkDevice>(VK_NULL_HANDLE), vk_device_);
40 return vk_device_;
41 }
42
43 VkQueue GetVulkanQueue() const {
44 DCHECK_NE(static_cast<VkQueue>(VK_NULL_HANDLE), vk_queue_);
45 return vk_queue_;
46 }
47
48 uint32_t GetVulkanQueueIndex() const { return vk_queue_index_; }
49
50 scoped_ptr<gpu::VulkanCommandPool> CreateCommandPool();
51
52 private:
53 VkPhysicalDevice vk_physical_device_ = VK_NULL_HANDLE;
54 VkDevice vk_device_ = VK_NULL_HANDLE;
55 VkQueue vk_queue_ = VK_NULL_HANDLE;
56 uint32_t vk_queue_index_ = 0;
57
58 DISALLOW_COPY_AND_ASSIGN(VulkanDeviceQueue);
59 };
60
61 } // namespace gpu
62
63 #endif // GPU_VULKAN_VULKAN_DEVICE_QUEUE_H_
OLDNEW
« 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