Class VulkanBufferViewCreateInfo

java.lang.Object
com.io7m.jcoronado.api.VulkanBufferViewCreateInfo
All Implemented Interfaces:
VulkanBufferViewCreateInfoType

public final class VulkanBufferViewCreateInfo extends Object implements VulkanBufferViewCreateInfoType
Information required to create a buffer.
See Also:
  • "VkBufferViewCreateInfo"
  • Method Details

    • flags

      Specified by:
      flags in interface VulkanBufferViewCreateInfoType
      Returns:
      A set of flags specifying additional parameters of the buffer view.
    • buffer

      public VulkanBufferType buffer()
      Specified by:
      buffer in interface VulkanBufferViewCreateInfoType
      Returns:
      The buffer on which the view will be created
    • format

      public VulkanFormat format()
      Specified by:
      format in interface VulkanBufferViewCreateInfoType
      Returns:
      The format of the data elements in the buffer
    • offset

      public long offset()
      Specified by:
      offset in interface VulkanBufferViewCreateInfoType
      Returns:
      An offset in bytes from the base address of the buffer. Accesses to the buffer view from shaders use addressing that is relative to this starting offset.
    • range

      public long range()
      Specified by:
      range in interface VulkanBufferViewCreateInfoType
      Returns:
      A size in bytes of the buffer view. If range is equal to VK_WHOLE_SIZE, the range from offset to the end of the buffer is used. If VK_WHOLE_SIZE is used and the remaining size of the buffer is not a multiple of the texel block size of format, the nearest smaller multiple is used.
    • withFlags

      public final VulkanBufferViewCreateInfo withFlags(VulkanBufferViewCreateFlag... elements)
      Copy the current immutable object with elements that replace the content of flags.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withFlags

      Copy the current immutable object with elements that replace the content of flags. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of flags elements to set
      Returns:
      A modified copy of this object
    • withBuffer

      public final VulkanBufferViewCreateInfo withBuffer(VulkanBufferType value)
      Copy the current immutable object by setting a value for the buffer attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for buffer
      Returns:
      A modified copy of the this object
    • withFormat

      public final VulkanBufferViewCreateInfo withFormat(VulkanFormat value)
      Copy the current immutable object by setting a value for the format attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for format
      Returns:
      A modified copy of the this object
    • withOffset

      public final VulkanBufferViewCreateInfo withOffset(long value)
      Copy the current immutable object by setting a value for the offset attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for offset
      Returns:
      A modified copy of the this object
    • withRange

      public final VulkanBufferViewCreateInfo withRange(long value)
      Copy the current immutable object by setting a value for the range attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for range
      Returns:
      A modified copy of the this object
    • equals

      public boolean equals(Object another)
      This instance is equal to all instances of VulkanBufferViewCreateInfo 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: flags, buffer, format, offset, range.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

      public static VulkanBufferViewCreateInfo of(Set<VulkanBufferViewCreateFlag> flags, VulkanBufferType buffer, VulkanFormat format, long offset, long range)
      Construct a new immutable VulkanBufferViewCreateInfo instance.
      Parameters:
      flags - The value for the flags attribute
      buffer - The value for the buffer attribute
      format - The value for the format attribute
      offset - The value for the offset attribute
      range - The value for the range attribute
      Returns:
      An immutable VulkanBufferViewCreateInfo instance
    • of

      public static VulkanBufferViewCreateInfo of(Iterable<VulkanBufferViewCreateFlag> flags, VulkanBufferType buffer, VulkanFormat format, long offset, long range)
      Construct a new immutable VulkanBufferViewCreateInfo instance.
      Parameters:
      flags - The value for the flags attribute
      buffer - The value for the buffer attribute
      format - The value for the format attribute
      offset - The value for the offset attribute
      range - The value for the range attribute
      Returns:
      An immutable VulkanBufferViewCreateInfo instance
    • copyOf

      Creates an immutable copy of a VulkanBufferViewCreateInfoType 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 VulkanBufferViewCreateInfo instance
    • builder

      public static VulkanBufferViewCreateInfo.Builder builder()
      Creates a builder for VulkanBufferViewCreateInfo.
       VulkanBufferViewCreateInfo.builder()
          .addFlags|addAllFlags(com.io7m.jcoronado.api.VulkanBufferViewCreateFlag) // flags elements
          .setBuffer(com.io7m.jcoronado.api.VulkanBufferType) // required buffer
          .setFormat(com.io7m.jcoronado.api.VulkanFormat) // required format
          .setOffset(long) // required offset
          .setRange(long) // required range
          .build();
       
      Returns:
      A new VulkanBufferViewCreateInfo builder