Class VulkanSubresourceLayout

java.lang.Object
com.io7m.jcoronado.api.VulkanSubresourceLayout
All Implemented Interfaces:
VulkanSubresourceLayoutType

public final class VulkanSubresourceLayout extends Object implements VulkanSubresourceLayoutType
Structure specifying subresource layout.
See Also:
  • "VkSubresourceLayout"
  • Method Details

    • offset

      public long offset()
      Specified by:
      offset in interface VulkanSubresourceLayoutType
      Returns:
      The byte offset from the start of the image or the plane where the image subresource begins.
    • size

      public long size()
      Specified by:
      size in interface VulkanSubresourceLayoutType
      Returns:
      The size in bytes of the image subresource. size includes any extra memory that is required based on rowPitch.
    • rowPitch

      public long rowPitch()
      Specified by:
      rowPitch in interface VulkanSubresourceLayoutType
      Returns:
      The number of bytes between each row of texels in an image.
    • arrayPitch

      public long arrayPitch()
      Specified by:
      arrayPitch in interface VulkanSubresourceLayoutType
      Returns:
      The number of bytes between each array layer of an image.
    • depthPitch

      public long depthPitch()
      Specified by:
      depthPitch in interface VulkanSubresourceLayoutType
      Returns:
      The number of bytes between each slice of 3D image.
    • withOffset

      public final VulkanSubresourceLayout 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
    • withSize

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

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

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

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

      public boolean equals(Object another)
      This instance is equal to all instances of VulkanSubresourceLayout 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: offset, size, rowPitch, arrayPitch, depthPitch.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

      public static VulkanSubresourceLayout of(long offset, long size, long rowPitch, long arrayPitch, long depthPitch)
      Construct a new immutable VulkanSubresourceLayout instance.
      Parameters:
      offset - The value for the offset attribute
      size - The value for the size attribute
      rowPitch - The value for the rowPitch attribute
      arrayPitch - The value for the arrayPitch attribute
      depthPitch - The value for the depthPitch attribute
      Returns:
      An immutable VulkanSubresourceLayout instance
    • copyOf

      public static VulkanSubresourceLayout copyOf(VulkanSubresourceLayoutType instance)
      Creates an immutable copy of a VulkanSubresourceLayoutType 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 VulkanSubresourceLayout instance
    • builder

      public static VulkanSubresourceLayout.Builder builder()
      Creates a builder for VulkanSubresourceLayout.
       VulkanSubresourceLayout.builder()
          .setOffset(long) // required offset
          .setSize(long) // required size
          .setRowPitch(long) // required rowPitch
          .setArrayPitch(long) // required arrayPitch
          .setDepthPitch(long) // required depthPitch
          .build();
       
      Returns:
      A new VulkanSubresourceLayout builder