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

Unified Diff: gpu/vulkan/vulkan_descriptor_pool.h

Issue 1989013002: Added Vulkan Descriptor Sets and Samplers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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
Index: gpu/vulkan/vulkan_descriptor_pool.h
diff --git a/gpu/vulkan/vulkan_descriptor_pool.h b/gpu/vulkan/vulkan_descriptor_pool.h
new file mode 100644
index 0000000000000000000000000000000000000000..6d194602b95990af38c94fc0f761af36b8197216
--- /dev/null
+++ b/gpu/vulkan/vulkan_descriptor_pool.h
@@ -0,0 +1,49 @@
+// 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_DESCRIPTOR_POOL_H_
+#define GPU_VULKAN_VULKAN_DESCRIPTOR_POOL_H_
+
+#include <vulkan/vulkan.h>
+
+#include <memory>
+#include <vector>
+
+#include "base/macros.h"
+
+namespace gpu {
+
+class VulkanDescriptorSet;
+class VulkanDeviceQueue;
+
+class VulkanDescriptorPool {
+ public:
+ explicit VulkanDescriptorPool(VulkanDeviceQueue* device_queue);
+ ~VulkanDescriptorPool();
+
+ bool Initialize(uint32_t max_descriptor_sets,
+ const std::vector<VkDescriptorPoolSize>& pool_sizes);
+ void Destroy();
+
+ std::unique_ptr<VulkanDescriptorSet> CreateDescriptorSet(
+ const std::vector<VkDescriptorSetLayoutBinding>& layout);
+ VkDescriptorPool handle() { return handle_; }
+
+ private:
+ friend class VulkanDescriptorSet;
+
+ void IncrementDescriptorSetCount();
+ void DecrementDescriptorSetCount();
+
+ VulkanDeviceQueue* device_queue_ = nullptr;
+ VkDescriptorPool handle_ = VK_NULL_HANDLE;
+ uint32_t max_descriptor_sets_ = 0;
+ uint32_t descriptor_count_ = 0;
+
+ DISALLOW_COPY_AND_ASSIGN(VulkanDescriptorPool);
+};
+
+} // namespace gpu
+
+#endif // GPU_VULKAN_VULKAN_DESCRIPTOR_POOL_H_

Powered by Google App Engine
This is Rietveld 408576698