- java.lang.Object
-
- com.io7m.jcoronado.api.VulkanDescriptorSetLayoutBinding
-
- All Implemented Interfaces:
VulkanDescriptorSetLayoutBindingType
public final class VulkanDescriptorSetLayoutBinding extends java.lang.Object implements VulkanDescriptorSetLayoutBindingType
Structure specifying a descriptor set layout binding.- See Also:
- "VkDescriptorSetLayoutBinding"
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
VulkanDescriptorSetLayoutBinding.Builder
Builds instances of typeVulkanDescriptorSetLayoutBinding
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
binding()
static VulkanDescriptorSetLayoutBinding.Builder
builder()
Creates a builder forVulkanDescriptorSetLayoutBinding
.static VulkanDescriptorSetLayoutBinding
copyOf(VulkanDescriptorSetLayoutBindingType instance)
Creates an immutable copy of aVulkanDescriptorSetLayoutBindingType
value.int
descriptorCount()
VulkanDescriptorType
descriptorType()
boolean
equals(java.lang.Object another)
This instance is equal to all instances ofVulkanDescriptorSetLayoutBinding
that have equal attribute values.int
hashCode()
Computes a hash code from attributes:binding
,descriptorType
,descriptorCount
,stageFlags
,immutableSamplers
.java.util.List<VulkanSamplerType>
immutableSamplers()
static VulkanDescriptorSetLayoutBinding
of(int binding, VulkanDescriptorType descriptorType, int descriptorCount, java.lang.Iterable<VulkanShaderStageFlag> stageFlags, java.lang.Iterable<? extends VulkanSamplerType> immutableSamplers)
Construct a new immutableVulkanDescriptorSetLayoutBinding
instance.static VulkanDescriptorSetLayoutBinding
of(int binding, VulkanDescriptorType descriptorType, int descriptorCount, java.util.Set<VulkanShaderStageFlag> stageFlags, java.util.List<VulkanSamplerType> immutableSamplers)
Construct a new immutableVulkanDescriptorSetLayoutBinding
instance.java.util.Set<VulkanShaderStageFlag>
stageFlags()
java.lang.String
toString()
Prints the immutable valueVulkanDescriptorSetLayoutBinding
with attribute values.VulkanDescriptorSetLayoutBinding
withBinding(int value)
Copy the current immutable object by setting a value for thebinding
attribute.VulkanDescriptorSetLayoutBinding
withDescriptorCount(int value)
Copy the current immutable object by setting a value for thedescriptorCount
attribute.VulkanDescriptorSetLayoutBinding
withDescriptorType(VulkanDescriptorType value)
Copy the current immutable object by setting a value for thedescriptorType
attribute.VulkanDescriptorSetLayoutBinding
withImmutableSamplers(VulkanSamplerType... elements)
Copy the current immutable object with elements that replace the content ofimmutableSamplers
.VulkanDescriptorSetLayoutBinding
withImmutableSamplers(java.lang.Iterable<? extends VulkanSamplerType> elements)
Copy the current immutable object with elements that replace the content ofimmutableSamplers
.VulkanDescriptorSetLayoutBinding
withStageFlags(VulkanShaderStageFlag... elements)
Copy the current immutable object with elements that replace the content ofstageFlags
.VulkanDescriptorSetLayoutBinding
withStageFlags(java.lang.Iterable<VulkanShaderStageFlag> elements)
Copy the current immutable object with elements that replace the content ofstageFlags
.
-
-
-
Method Detail
-
binding
public int binding()
- Specified by:
binding
in interfaceVulkanDescriptorSetLayoutBindingType
- 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 interfaceVulkanDescriptorSetLayoutBindingType
- Returns:
- A VulkanDescriptorType specifying which type of resource descriptors are used for this binding.
-
descriptorCount
public int descriptorCount()
- Specified by:
descriptorCount
in 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
public java.util.Set<VulkanShaderStageFlag> stageFlags()
- Specified by:
stageFlags
in 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
public java.util.List<VulkanSamplerType> immutableSamplers()
- Specified by:
immutableSamplers
in interfaceVulkanDescriptorSetLayoutBindingType
- 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 thebinding
attribute. 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
this
object
-
withDescriptorType
public final VulkanDescriptorSetLayoutBinding withDescriptorType(VulkanDescriptorType value)
Copy the current immutable object by setting a value for thedescriptorType
attribute. 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
this
object
-
withDescriptorCount
public final VulkanDescriptorSetLayoutBinding withDescriptorCount(int value)
Copy the current immutable object by setting a value for thedescriptorCount
attribute. 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
this
object
-
withStageFlags
public final VulkanDescriptorSetLayoutBinding withStageFlags(VulkanShaderStageFlag... elements)
Copy the current immutable object with elements that replace the content ofstageFlags
.- Parameters:
elements
- The elements to set- Returns:
- A modified copy of
this
object
-
withStageFlags
public final VulkanDescriptorSetLayoutBinding withStageFlags(java.lang.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
this
object
-
withImmutableSamplers
public final VulkanDescriptorSetLayoutBinding withImmutableSamplers(VulkanSamplerType... elements)
Copy the current immutable object with elements that replace the content ofimmutableSamplers
.- Parameters:
elements
- The elements to set- Returns:
- A modified copy of
this
object
-
withImmutableSamplers
public final VulkanDescriptorSetLayoutBinding withImmutableSamplers(java.lang.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
this
object
-
equals
public boolean equals(java.lang.Object another)
This instance is equal to all instances ofVulkanDescriptorSetLayoutBinding
that have equal attribute values.- Overrides:
equals
in classjava.lang.Object
- Returns:
true
ifthis
is equal toanother
instance
-
hashCode
public int hashCode()
Computes a hash code from attributes:binding
,descriptorType
,descriptorCount
,stageFlags
,immutableSamplers
.- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- hashCode value
-
toString
public java.lang.String toString()
Prints the immutable valueVulkanDescriptorSetLayoutBinding
with attribute values.- Overrides:
toString
in classjava.lang.Object
- Returns:
- A string representation of the value
-
of
public static VulkanDescriptorSetLayoutBinding of(int binding, VulkanDescriptorType descriptorType, int descriptorCount, java.util.Set<VulkanShaderStageFlag> stageFlags, java.util.List<VulkanSamplerType> immutableSamplers)
Construct a new immutableVulkanDescriptorSetLayoutBinding
instance.- Parameters:
binding
- The value for thebinding
attributedescriptorType
- The value for thedescriptorType
attributedescriptorCount
- The value for thedescriptorCount
attributestageFlags
- The value for thestageFlags
attributeimmutableSamplers
- The value for theimmutableSamplers
attribute- Returns:
- An immutable VulkanDescriptorSetLayoutBinding instance
-
of
public static VulkanDescriptorSetLayoutBinding of(int binding, VulkanDescriptorType descriptorType, int descriptorCount, java.lang.Iterable<VulkanShaderStageFlag> stageFlags, java.lang.Iterable<? extends VulkanSamplerType> immutableSamplers)
Construct a new immutableVulkanDescriptorSetLayoutBinding
instance.- Parameters:
binding
- The value for thebinding
attributedescriptorType
- The value for thedescriptorType
attributedescriptorCount
- The value for thedescriptorCount
attributestageFlags
- The value for thestageFlags
attributeimmutableSamplers
- The value for theimmutableSamplers
attribute- Returns:
- An immutable VulkanDescriptorSetLayoutBinding instance
-
copyOf
public static VulkanDescriptorSetLayoutBinding copyOf(VulkanDescriptorSetLayoutBindingType instance)
Creates an immutable copy of aVulkanDescriptorSetLayoutBindingType
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
public static VulkanDescriptorSetLayoutBinding.Builder builder()
Creates a builder forVulkanDescriptorSetLayoutBinding
.- Returns:
- A new VulkanDescriptorSetLayoutBinding builder
-
-