Class VulkanMemoryRequirements

java.lang.Object
com.io7m.jcoronado.api.VulkanMemoryRequirements
All Implemented Interfaces:
VulkanMemoryRequirementsType

public final class VulkanMemoryRequirements extends Object implements VulkanMemoryRequirementsType
See Also:
  • "VkMemoryRequirements"
  • Method Details

    • size

      public long size()
      Specified by:
      size in interface VulkanMemoryRequirementsType
      Returns:
      The size, in bytes, of the memory allocation required for the resource.
    • alignment

      public long alignment()
      Specified by:
      alignment in interface VulkanMemoryRequirementsType
      Returns:
      The alignment, in bytes, of the offset within the allocation required for the resource.
    • memoryTypeBits

      public int memoryTypeBits()
      Specified by:
      memoryTypeBits in interface VulkanMemoryRequirementsType
      Returns:
      A bitmask that contains one bit set for every supported memory type for the resource. Bit i is set if and only if the memory type i in the VkPhysicalDeviceMemoryProperties structure for the physical device is supported for the resource.
    • withSize

      public final VulkanMemoryRequirements 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
    • withAlignment

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

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

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

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

      public static VulkanMemoryRequirements of(long size, long alignment, int memoryTypeBits)
      Construct a new immutable VulkanMemoryRequirements instance.
      Parameters:
      size - The value for the size attribute
      alignment - The value for the alignment attribute
      memoryTypeBits - The value for the memoryTypeBits attribute
      Returns:
      An immutable VulkanMemoryRequirements instance
    • copyOf

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

      public static VulkanMemoryRequirements.Builder builder()
      Creates a builder for VulkanMemoryRequirements.
       VulkanMemoryRequirements.builder()
          .setSize(long) // required size
          .setAlignment(long) // required alignment
          .setMemoryTypeBits(int) // required memoryTypeBits
          .build();
       
      Returns:
      A new VulkanMemoryRequirements builder