OLD | NEW |
(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_ |
OLD | NEW |