Class VulkanDescriptorSetLayoutBinding

java.lang.Object
com.io7m.jcoronado.api.VulkanDescriptorSetLayoutBinding
All Implemented Interfaces:
VulkanDescriptorSetLayoutBindingType

public final class VulkanDescriptorSetLayoutBinding extends Object implements VulkanDescriptorSetLayoutBindingType
Structure specifying a descriptor set layout binding.
See Also:
  • "VkDescriptorSetLayoutBinding"
  • Method Details

    • binding

      public int binding()
      Specified by:
      binding in interface VulkanDescriptorSetLayoutBindingType
      Returns:
      The binding number of this entry and corresponds to a resource of the same binding number in the shader stages
    • descriptorType

      public VulkanDescriptorType descriptorType()
      Specified by:
      descriptorType in interface VulkanDescriptorSetLayoutBindingType
      Returns:
      A VulkanDescriptorType specifying which type of resource descriptors are used for this binding.
    • descriptorCount

      public int descriptorCount()
      Specified by:
      descriptorCount in interface VulkanDescriptorSetLayoutBindingType
      Returns:
      The number of descriptors contained in the binding, accessed in a shader as an array , except if descriptorType is VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT in which case descriptorCount is the size in bytes of the inline uniform block . If descriptorCount is zero this binding entry is reserved and the resource must not be accessed from any stage via this binding within any pipeline using the set layout.
    • stageFlags

      public Set<VulkanShaderStageFlag> stageFlags()
      Specified by:
      stageFlags in interface VulkanDescriptorSetLayoutBindingType
      Returns:
      A set of VulkanShaderStageFlag values specifying which pipeline shader stages can access a resource for this binding. VK_SHADER_STAGE_ALL is a shorthand specifying that all defined shader stages, including any additional stages defined by extensions, can access the resource.
    • immutableSamplers

      public List<VulkanSamplerType> immutableSamplers()
      Specified by:
      immutableSamplers in interface VulkanDescriptorSetLayoutBindingType
      Returns:
      A set of samplers to be initialized
    • withBinding

      public final VulkanDescriptorSetLayoutBinding withBinding(int value)
      Copy the current immutable object by setting a value for the binding attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for binding
      Returns:
      A modified copy or the this object
    • withDescriptorType

      public final VulkanDescriptorSetLayoutBinding withDescriptorType(VulkanDescriptorType value)
      Copy the current immutable object by setting a value for the descriptorType attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for descriptorType
      Returns:
      A modified copy or the this object
    • withDescriptorCount

      public final VulkanDescriptorSetLayoutBinding withDescriptorCount(int value)
      Copy the current immutable object by setting a value for the descriptorCount attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for descriptorCount
      Returns:
      A modified copy or the this object
    • withStageFlags

      public final VulkanDescriptorSetLayoutBinding withStageFlags(VulkanShaderStageFlag... elements)
      Copy the current immutable object with elements that replace the content of stageFlags.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withStageFlags

      public final VulkanDescriptorSetLayoutBinding withStageFlags(Iterable<VulkanShaderStageFlag> elements)
      Copy the current immutable object with elements that replace the content of stageFlags. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of stageFlags elements to set
      Returns:
      A modified copy or this if not changed
    • withImmutableSamplers

      public final VulkanDescriptorSetLayoutBinding withImmutableSamplers(VulkanSamplerType... elements)
      Copy the current immutable object with elements that replace the content of immutableSamplers.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withImmutableSamplers

      public final VulkanDescriptorSetLayoutBinding withImmutableSamplers(Iterable<? extends VulkanSamplerType> elements)
      Copy the current immutable object with elements that replace the content of immutableSamplers. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of immutableSamplers elements to set
      Returns:
      A modified copy or this if not changed
    • equals

      public boolean equals(Object another)
      This instance is equal to all instances of VulkanDescriptorSetLayoutBinding that have equal attribute values.
      Overrides:
      equals in class Object
      Returns:
      true if this is equal to another instance
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: binding, descriptorType, descriptorCount, stageFlags, immutableSamplers.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

      public String toString()
      Prints the immutable value VulkanDescriptorSetLayoutBinding with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • copyOf

      Creates an immutable copy of a VulkanDescriptorSetLayoutBindingType value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.
      Parameters:
      instance - The instance to copy
      Returns:
      A copied immutable VulkanDescriptorSetLayoutBinding instance
    • builder

      Creates a builder for VulkanDescriptorSetLayoutBinding.
      VulkanDescriptorSetLayoutBinding.builder()
         .setBinding(int) // required binding
         .setDescriptorType(com.io7m.jcoronado.api.VulkanDescriptorType) // required descriptorType
         .setDescriptorCount(int) // optional descriptorCount
         .addStageFlags|addAllStageFlags(com.io7m.jcoronado.api.VulkanShaderStageFlag) // stageFlags elements
         .addImmutableSamplers|addAllImmutableSamplers(com.io7m.jcoronado.api.VulkanSamplerType) // immutableSamplers elements
         .build();
      
      Returns:
      A new VulkanDescriptorSetLayoutBinding builder