diff options
author | Fernando Sahmkow <fsahmkow27@gmail.com> | 2020-01-05 20:54:41 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-05 20:54:41 +0100 |
commit | 56e450a3f7a59d40be142eee781cdb01a88c7821 (patch) | |
tree | a8c8d17aa9227893e595bfb8e6ae5e7ebdab2dbc /src/video_core/renderer_vulkan/vk_descriptor_pool.h | |
parent | Merge pull request #2945 from FernandoS27/fix-bcat (diff) | |
parent | Update src/video_core/renderer_vulkan/vk_descriptor_pool.cpp (diff) | |
download | yuzu-56e450a3f7a59d40be142eee781cdb01a88c7821.tar yuzu-56e450a3f7a59d40be142eee781cdb01a88c7821.tar.gz yuzu-56e450a3f7a59d40be142eee781cdb01a88c7821.tar.bz2 yuzu-56e450a3f7a59d40be142eee781cdb01a88c7821.tar.lz yuzu-56e450a3f7a59d40be142eee781cdb01a88c7821.tar.xz yuzu-56e450a3f7a59d40be142eee781cdb01a88c7821.tar.zst yuzu-56e450a3f7a59d40be142eee781cdb01a88c7821.zip |
Diffstat (limited to 'src/video_core/renderer_vulkan/vk_descriptor_pool.h')
-rw-r--r-- | src/video_core/renderer_vulkan/vk_descriptor_pool.h | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/src/video_core/renderer_vulkan/vk_descriptor_pool.h b/src/video_core/renderer_vulkan/vk_descriptor_pool.h new file mode 100644 index 000000000..a441dbc0f --- /dev/null +++ b/src/video_core/renderer_vulkan/vk_descriptor_pool.h @@ -0,0 +1,56 @@ +// Copyright 2019 yuzu Emulator Project +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#pragma once + +#include <memory> +#include <vector> + +#include "common/common_types.h" +#include "video_core/renderer_vulkan/declarations.h" +#include "video_core/renderer_vulkan/vk_resource_manager.h" + +namespace Vulkan { + +class VKDescriptorPool; + +class DescriptorAllocator final : public VKFencedPool { +public: + explicit DescriptorAllocator(VKDescriptorPool& descriptor_pool, vk::DescriptorSetLayout layout); + ~DescriptorAllocator() override; + + DescriptorAllocator(const DescriptorAllocator&) = delete; + + vk::DescriptorSet Commit(VKFence& fence); + +protected: + void Allocate(std::size_t begin, std::size_t end) override; + +private: + VKDescriptorPool& descriptor_pool; + const vk::DescriptorSetLayout layout; + + std::vector<UniqueDescriptorSet> descriptors; +}; + +class VKDescriptorPool final { + friend DescriptorAllocator; + +public: + explicit VKDescriptorPool(const VKDevice& device); + ~VKDescriptorPool(); + +private: + vk::DescriptorPool AllocateNewPool(); + + std::vector<UniqueDescriptorSet> AllocateDescriptors(vk::DescriptorSetLayout layout, + std::size_t count); + + const VKDevice& device; + + std::vector<UniqueDescriptorPool> pools; + vk::DescriptorPool active_pool; +}; + +} // namespace Vulkan
\ No newline at end of file |