SPARK  0.1.0
A general purpose game engine written in C++.
Loading...
Searching...
No Matches
VulkanDescriptorLayout.h
1#pragma once
2
3#include "spark/render/DescriptorSet.h"
4#include "spark/render/vk/Export.h"
5#include "spark/render/vk/VulkanSampler.h"
6
7#include <memory>
8
9namespace spark::render::vk
10{
11 class IVulkanSampler;
12
16 class SPARK_RENDER_VK_EXPORT VulkanDescriptorLayout final : public IDescriptorLayout
17 {
18 public:
26 explicit VulkanDescriptorLayout(DescriptorType type, unsigned int binding, std::size_t element_size, unsigned int descriptors = 1);
27
33 explicit VulkanDescriptorLayout(std::unique_ptr<IVulkanSampler>&& static_sampler, unsigned int binding);
34 ~VulkanDescriptorLayout() noexcept override;
35
37 VulkanDescriptorLayout(VulkanDescriptorLayout&& other) noexcept = delete;
38 VulkanDescriptorLayout& operator=(const VulkanDescriptorLayout& other) = delete;
39 VulkanDescriptorLayout& operator=(VulkanDescriptorLayout&& other) noexcept = delete;
40
42 [[nodiscard]] std::size_t elementSize() const noexcept override;
43
45 [[nodiscard]] unsigned binding() const noexcept override;
46
48 [[nodiscard]] BufferType type() const noexcept override;
49
51 [[nodiscard]] DescriptorType descriptorType() const noexcept override;
52
54 [[nodiscard]] unsigned descriptors() const noexcept override;
55
57 [[nodiscard]] const IVulkanSampler* staticSampler() const noexcept override;
58
59 private:
60 struct Impl;
61 std::unique_ptr<Impl> m_impl;
62 };
63}
Describes a the layout of a single descriptor within a DescriptorSet.
Definition DescriptorSet.h:74
Interface for Vulkan sampler.
Definition VulkanSampler.h:22
Implements a Vulkan IDescriptorLayout.
Definition VulkanDescriptorLayout.h:17
VulkanDescriptorLayout(std::unique_ptr< IVulkanSampler > &&static_sampler, unsigned int binding)
Initializes a new Vulkan descriptor layout for a static sampler.
VulkanDescriptorLayout(DescriptorType type, unsigned int binding, std::size_t element_size, unsigned int descriptors=1)
Initializes a new Vulkan descriptor layout.
Definition VulkanDescriptorLayout.cpp:8