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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeVulkanDescriptorSetLayoutBinding. -
Method Summary
Modifier and TypeMethodDescriptionintbinding()builder()Creates a builder forVulkanDescriptorSetLayoutBinding.copyOf(VulkanDescriptorSetLayoutBindingType instance) Creates an immutable copy of aVulkanDescriptorSetLayoutBindingTypevalue.intbooleanThis instance is equal to all instances ofVulkanDescriptorSetLayoutBindingthat have equal attribute values.inthashCode()Computes a hash code from attributes:binding,descriptorType,descriptorCount,stageFlags,immutableSamplers.of(int binding, VulkanDescriptorType descriptorType, int descriptorCount, Iterable<VulkanShaderStageFlag> stageFlags, Iterable<? extends VulkanSamplerType> immutableSamplers) Construct a new immutableVulkanDescriptorSetLayoutBindinginstance.of(int binding, VulkanDescriptorType descriptorType, int descriptorCount, Set<VulkanShaderStageFlag> stageFlags, List<VulkanSamplerType> immutableSamplers) Construct a new immutableVulkanDescriptorSetLayoutBindinginstance.toString()Prints the immutable valueVulkanDescriptorSetLayoutBindingwith attribute values.withBinding(int value) Copy the current immutable object by setting a value for thebindingattribute.withDescriptorCount(int value) Copy the current immutable object by setting a value for thedescriptorCountattribute.Copy the current immutable object by setting a value for thedescriptorTypeattribute.withImmutableSamplers(VulkanSamplerType... elements) Copy the current immutable object with elements that replace the content ofimmutableSamplers.withImmutableSamplers(Iterable<? extends VulkanSamplerType> elements) Copy the current immutable object with elements that replace the content ofimmutableSamplers.withStageFlags(VulkanShaderStageFlag... elements) Copy the current immutable object with elements that replace the content ofstageFlags.withStageFlags(Iterable<VulkanShaderStageFlag> elements) Copy the current immutable object with elements that replace the content ofstageFlags.
-
Method Details
-
binding
public int binding()- Specified by:
bindingin interfaceVulkanDescriptorSetLayoutBindingType- Returns:
- The binding number of this entry and corresponds to a resource of the same binding number in the shader stages
-
descriptorType
- Specified by:
descriptorTypein interfaceVulkanDescriptorSetLayoutBindingType- Returns:
- A VulkanDescriptorType specifying which type of resource descriptors are used for this binding.
-
descriptorCount
public int descriptorCount()- Specified by:
descriptorCountin interfaceVulkanDescriptorSetLayoutBindingType- 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
- Specified by:
stageFlagsin interfaceVulkanDescriptorSetLayoutBindingType- 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
- Specified by:
immutableSamplersin interfaceVulkanDescriptorSetLayoutBindingType- Returns:
- A set of samplers to be initialized
-
withBinding
Copy the current immutable object by setting a value for thebindingattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for binding- Returns:
- A modified copy of the
thisobject
-
withDescriptorType
Copy the current immutable object by setting a value for thedescriptorTypeattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for descriptorType- Returns:
- A modified copy of the
thisobject
-
withDescriptorCount
Copy the current immutable object by setting a value for thedescriptorCountattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for descriptorCount- Returns:
- A modified copy of the
thisobject
-
withStageFlags
Copy the current immutable object with elements that replace the content ofstageFlags.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withStageFlags
public final VulkanDescriptorSetLayoutBinding withStageFlags(Iterable<VulkanShaderStageFlag> elements) Copy the current immutable object with elements that replace the content ofstageFlags. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of stageFlags elements to set- Returns:
- A modified copy of
thisobject
-
withImmutableSamplers
Copy the current immutable object with elements that replace the content ofimmutableSamplers.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withImmutableSamplers
public final VulkanDescriptorSetLayoutBinding withImmutableSamplers(Iterable<? extends VulkanSamplerType> elements) Copy the current immutable object with elements that replace the content ofimmutableSamplers. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of immutableSamplers elements to set- Returns:
- A modified copy of
thisobject
-
equals
-
hashCode
-
toString
-
of
public static VulkanDescriptorSetLayoutBinding of(int binding, VulkanDescriptorType descriptorType, int descriptorCount, Set<VulkanShaderStageFlag> stageFlags, List<VulkanSamplerType> immutableSamplers) Construct a new immutableVulkanDescriptorSetLayoutBindinginstance.- Parameters:
binding- The value for thebindingattributedescriptorType- The value for thedescriptorTypeattributedescriptorCount- The value for thedescriptorCountattributestageFlags- The value for thestageFlagsattributeimmutableSamplers- The value for theimmutableSamplersattribute- Returns:
- An immutable VulkanDescriptorSetLayoutBinding instance
-
of
public static VulkanDescriptorSetLayoutBinding of(int binding, VulkanDescriptorType descriptorType, int descriptorCount, Iterable<VulkanShaderStageFlag> stageFlags, Iterable<? extends VulkanSamplerType> immutableSamplers) Construct a new immutableVulkanDescriptorSetLayoutBindinginstance.- Parameters:
binding- The value for thebindingattributedescriptorType- The value for thedescriptorTypeattributedescriptorCount- The value for thedescriptorCountattributestageFlags- The value for thestageFlagsattributeimmutableSamplers- The value for theimmutableSamplersattribute- Returns:
- An immutable VulkanDescriptorSetLayoutBinding instance
-
copyOf
public static VulkanDescriptorSetLayoutBinding copyOf(VulkanDescriptorSetLayoutBindingType instance) Creates an immutable copy of aVulkanDescriptorSetLayoutBindingTypevalue. 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 forVulkanDescriptorSetLayoutBinding.VulkanDescriptorSetLayoutBinding.builder() .setBinding(int) // requiredbinding.setDescriptorType(com.io7m.jcoronado.api.VulkanDescriptorType) // requireddescriptorType.setDescriptorCount(int) // requireddescriptorCount.addStageFlags|addAllStageFlags(com.io7m.jcoronado.api.VulkanShaderStageFlag) //stageFlagselements .addImmutableSamplers|addAllImmutableSamplers(com.io7m.jcoronado.api.VulkanSamplerType) //immutableSamplerselements .build();- Returns:
- A new VulkanDescriptorSetLayoutBinding builder
-