Add initial support for shader binding sets (WIP)

This commit is contained in:
Jérôme Leclercq
2021-06-14 22:35:05 +02:00
parent 815a7b0c62
commit f22b501e25
53 changed files with 885 additions and 511 deletions

View File

@@ -31,20 +31,19 @@ namespace Nz
VulkanRenderPipelineLayout() = default;
~VulkanRenderPipelineLayout();
ShaderBindingPtr AllocateShaderBinding() override;
ShaderBindingPtr AllocateShaderBinding(UInt32 setIndex) override;
bool Create(Vk::Device& device, RenderPipelineLayoutInfo layoutInfo);
inline Vk::Device* GetDevice() const;
inline const Vk::DescriptorSetLayout& GetDescriptorSetLayout() const;
inline const Vk::PipelineLayout& GetPipelineLayout() const;
private:
struct DescriptorPool;
DescriptorPool& AllocatePool();
ShaderBindingPtr AllocateFromPool(std::size_t poolIndex);
ShaderBindingPtr AllocateFromPool(std::size_t poolIndex, UInt32 setIndex);
void Release(ShaderBinding& binding);
inline void TryToShrink();
@@ -59,7 +58,7 @@ namespace Nz
MovablePtr<Vk::Device> m_device;
std::vector<DescriptorPool> m_descriptorPools;
Vk::DescriptorSetLayout m_descriptorSetLayout;
std::vector<const Vk::DescriptorSetLayout*> m_descriptorSetLayouts;
Vk::PipelineLayout m_pipelineLayout;
RenderPipelineLayoutInfo m_layoutInfo;
};