DescriptorSetLayoutBuilder

A builder class for constructing a descriptor set layout in Vulkan.

Remarks

Initializes a new instance of the DescriptorSetLayoutBuilder class.

Public Methods

AddBinding

public DescriptorSetLayoutBuilder AddBinding(uint binding, DescriptorType descriptorType, ShaderStageFlags stageFlags, uint count = 1)

Adds a binding to the descriptor set layout builder.

Parameters:

  • binding (uint): The binding number.
  • descriptorType (DescriptorType): The type of descriptor.
  • stageFlags (ShaderStageFlags): Shader stages that can access this binding.
  • count (uint): The number of descriptors in this binding. (Default: 1)

Returns: DescriptorSetLayoutBuilder

  • Returns the updated DescriptorSetLayoutBuilder.

AddBinding

public unsafe DescriptorSetLayoutBuilder AddBinding(uint binding, DescriptorType descriptorType, ShaderStageFlags stageFlags, Sampler sampler, uint count = 1)

Adds a binding with an immutable sampler to the descriptor set layout builder.

Parameters:

  • binding (uint): The binding number.
  • descriptorType (DescriptorType): The type of descriptor.
  • stageFlags (ShaderStageFlags): Shader stages that can access this binding.
  • sampler (Sampler): The immutable sampler for the binding.
  • count (uint): The number of descriptors in this binding. (Default: 1)

Returns: DescriptorSetLayoutBuilder

  • Returns the updated DescriptorSetLayoutBuilder.

Build

public DescriptorSetLayout Build()

Builds the descriptor set layout.

Returns: DescriptorSetLayout

  • The constructed DescriptorSetLayout object.