Class DescriptorBuilder¶
Defined in File descriptor_builder.hpp
Class Documentation¶
-
class DescriptorBuilder¶
Public Functions
-
explicit DescriptorBuilder(const Device &device)¶
Constructs the descriptor builder.
- Parameters
device – The const reference to a device RAII wrapper instance.
-
DescriptorBuilder(const DescriptorBuilder&) = delete¶
-
DescriptorBuilder(DescriptorBuilder&&) = delete¶
-
~DescriptorBuilder() = default¶
-
DescriptorBuilder &operator=(const DescriptorBuilder&) = delete¶
-
DescriptorBuilder &operator=(DescriptorBuilder&&) = delete¶
-
template<typename T>
DescriptorBuilder &add_uniform_buffer(VkBuffer uniform_buffer, std::uint32_t binding, VkShaderStageFlagBits shader_stage = VK_SHADER_STAGE_VERTEX_BIT)¶ Adds a uniform buffer to the descriptor container.
- Template Parameters
T – The type of the uniform buffer.
- Parameters
uniform_buffer – The uniform buffer which contains the data which will be accessed by the shader.
binding – The binding index which will be used in the SPIR-V shader.
shader_stage – The shader stage the uniform buffer will be used in, most likely the vertex shader.
- Returns
A const reference to this DescriptorBuilder instance.
-
DescriptorBuilder &add_combined_image_sampler(VkSampler image_sampler, VkImageView image_view, std::uint32_t binding, VkShaderStageFlagBits shader_stage = VK_SHADER_STAGE_FRAGMENT_BIT)¶
Adds a combined image sampler to the descriptor container.
- Parameters
image_sampler – The pointer to the combined image sampler.
image_view – The pointer to the image view.
binding – The binding index which will be used in the SPIR-V shader.
shader_stage – The shader stage the uniform buffer will be used in, most likely the fragment shader.
- Returns
A const reference to this DescriptorBuilder instance.
-
ResourceDescriptor build(std::string name)¶
Builds the resource descriptor.
- Parameters
name – The internal name of the resource descriptor.
- Returns
The resource descriptor which was created by the builder.
-
explicit DescriptorBuilder(const Device &device)¶