Index: gpu/vulkan/vulkan_command_pool.h |
diff --git a/gpu/vulkan/vulkan_command_pool.h b/gpu/vulkan/vulkan_command_pool.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..091fd4efb3b04e885e849199655e0f54e84a5eb7 |
--- /dev/null |
+++ b/gpu/vulkan/vulkan_command_pool.h |
@@ -0,0 +1,46 @@ |
+// 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_COMMAND_POOL_H_ |
+#define GPU_VULKAN_VULKAN_COMMAND_POOL_H_ |
+ |
+#include <vulkan/vulkan.h> |
+ |
+#include "base/macros.h" |
+#include "base/memory/scoped_ptr.h" |
+ |
+namespace gpu { |
+ |
+class VulkanCommandBuffer; |
+ |
+class VulkanCommandPool { |
+ public: |
+ VulkanCommandPool(VkDevice device, uint32_t queue_index); |
+ ~VulkanCommandPool(); |
+ |
+ bool Initialize(); |
+ void Destroy(); |
+ |
+ scoped_ptr<VulkanCommandBuffer> CreatePrimaryCommandBuffer(); |
+ scoped_ptr<VulkanCommandBuffer> CreateSecondaryCommandBuffer(); |
+ |
+ VkCommandPool handle() { return handle_; } |
+ |
+ private: |
+ friend class VulkanCommandBuffer; |
+ |
+ void IncrementCommandBufferCount(); |
+ void DecrementCommandBufferCount(); |
+ |
+ VkDevice device_ = VK_NULL_HANDLE; |
+ uint32_t queue_index_ = 0; |
+ VkCommandPool handle_ = VK_NULL_HANDLE; |
+ uint32_t command_buffer_count_ = 0; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(VulkanCommandPool); |
+}; |
+ |
+} // namespace gpu |
+ |
+#endif // GPU_VULKAN_VULKAN_COMMAND_POOL_H_ |