Class VulkanBufferMemoryBarrier

java.lang.Object
com.io7m.jcoronado.api.VulkanBufferMemoryBarrier
All Implemented Interfaces:
VulkanBufferMemoryBarrierType

public final class VulkanBufferMemoryBarrier extends Object implements VulkanBufferMemoryBarrierType
Structure specifying the parameters of a buffer memory barrier.
See Also:
  • "VkBufferMemoryBarrier"
  • Method Details

    • sourceAccessMask

      public Set<VulkanAccessFlag> sourceAccessMask()
      Specified by:
      sourceAccessMask in interface VulkanBufferMemoryBarrierType
      Returns:
      The source access mask
    • targetAccessMask

      public Set<VulkanAccessFlag> targetAccessMask()
      Specified by:
      targetAccessMask in interface VulkanBufferMemoryBarrierType
      Returns:
      The target access mask
    • sourceQueueFamilyIndex

      public VulkanQueueFamilyIndex sourceQueueFamilyIndex()
      Specified by:
      sourceQueueFamilyIndex in interface VulkanBufferMemoryBarrierType
      Returns:
      The source queue family for a queue family ownership transfer.
    • targetQueueFamilyIndex

      public VulkanQueueFamilyIndex targetQueueFamilyIndex()
      Specified by:
      targetQueueFamilyIndex in interface VulkanBufferMemoryBarrierType
      Returns:
      The target queue family for a queue family ownership transfer.
    • buffer

      public VulkanBufferType buffer()
      Specified by:
      buffer in interface VulkanBufferMemoryBarrierType
      Returns:
      The buffer affected by this barrier.
    • offset

      public long offset()
      Specified by:
      offset in interface VulkanBufferMemoryBarrierType
      Returns:
      An offset in bytes into the backing memory for buffer; this is relative to the base offset as bound to the buffer
    • size

      public long size()
      Specified by:
      size in interface VulkanBufferMemoryBarrierType
      Returns:
      A size in bytes of the affected area of backing memory for buffer, or VK_WHOLE_SIZE to use the range from offset to the end of the buffer.
    • withSourceAccessMask

      public final VulkanBufferMemoryBarrier withSourceAccessMask(VulkanAccessFlag... elements)
      Copy the current immutable object with elements that replace the content of sourceAccessMask.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withSourceAccessMask

      public final VulkanBufferMemoryBarrier withSourceAccessMask(Iterable<VulkanAccessFlag> elements)
      Copy the current immutable object with elements that replace the content of sourceAccessMask. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of sourceAccessMask elements to set
      Returns:
      A modified copy of this object
    • withTargetAccessMask

      public final VulkanBufferMemoryBarrier withTargetAccessMask(VulkanAccessFlag... elements)
      Copy the current immutable object with elements that replace the content of targetAccessMask.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withTargetAccessMask

      public final VulkanBufferMemoryBarrier withTargetAccessMask(Iterable<VulkanAccessFlag> elements)
      Copy the current immutable object with elements that replace the content of targetAccessMask. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of targetAccessMask elements to set
      Returns:
      A modified copy of this object
    • withSourceQueueFamilyIndex

      public final VulkanBufferMemoryBarrier withSourceQueueFamilyIndex(VulkanQueueFamilyIndex value)
      Copy the current immutable object by setting a value for the sourceQueueFamilyIndex attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for sourceQueueFamilyIndex
      Returns:
      A modified copy of the this object
    • withTargetQueueFamilyIndex

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

      public final VulkanBufferMemoryBarrier 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
    • withOffset

      public final VulkanBufferMemoryBarrier 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 VulkanBufferMemoryBarrier 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
    • equals

      public boolean equals(Object another)
      This instance is equal to all instances of VulkanBufferMemoryBarrier 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: sourceAccessMask, targetAccessMask, sourceQueueFamilyIndex, targetQueueFamilyIndex, buffer, offset, size.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

      public static VulkanBufferMemoryBarrier of(Set<VulkanAccessFlag> sourceAccessMask, Set<VulkanAccessFlag> targetAccessMask, VulkanQueueFamilyIndex sourceQueueFamilyIndex, VulkanQueueFamilyIndex targetQueueFamilyIndex, VulkanBufferType buffer, long offset, long size)
      Construct a new immutable VulkanBufferMemoryBarrier instance.
      Parameters:
      sourceAccessMask - The value for the sourceAccessMask attribute
      targetAccessMask - The value for the targetAccessMask attribute
      sourceQueueFamilyIndex - The value for the sourceQueueFamilyIndex attribute
      targetQueueFamilyIndex - The value for the targetQueueFamilyIndex attribute
      buffer - The value for the buffer attribute
      offset - The value for the offset attribute
      size - The value for the size attribute
      Returns:
      An immutable VulkanBufferMemoryBarrier instance
    • of

      public static VulkanBufferMemoryBarrier of(Iterable<VulkanAccessFlag> sourceAccessMask, Iterable<VulkanAccessFlag> targetAccessMask, VulkanQueueFamilyIndex sourceQueueFamilyIndex, VulkanQueueFamilyIndex targetQueueFamilyIndex, VulkanBufferType buffer, long offset, long size)
      Construct a new immutable VulkanBufferMemoryBarrier instance.
      Parameters:
      sourceAccessMask - The value for the sourceAccessMask attribute
      targetAccessMask - The value for the targetAccessMask attribute
      sourceQueueFamilyIndex - The value for the sourceQueueFamilyIndex attribute
      targetQueueFamilyIndex - The value for the targetQueueFamilyIndex attribute
      buffer - The value for the buffer attribute
      offset - The value for the offset attribute
      size - The value for the size attribute
      Returns:
      An immutable VulkanBufferMemoryBarrier instance
    • copyOf

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

      public static VulkanBufferMemoryBarrier.Builder builder()
      Creates a builder for VulkanBufferMemoryBarrier.
       VulkanBufferMemoryBarrier.builder()
          .addSourceAccessMask|addAllSourceAccessMask(com.io7m.jcoronado.api.VulkanAccessFlag) // sourceAccessMask elements
          .addTargetAccessMask|addAllTargetAccessMask(com.io7m.jcoronado.api.VulkanAccessFlag) // targetAccessMask elements
          .setSourceQueueFamilyIndex(com.io7m.jcoronado.api.VulkanQueueFamilyIndex) // required sourceQueueFamilyIndex
          .setTargetQueueFamilyIndex(com.io7m.jcoronado.api.VulkanQueueFamilyIndex) // required targetQueueFamilyIndex
          .setBuffer(com.io7m.jcoronado.api.VulkanBufferType) // required buffer
          .setOffset(long) // required offset
          .setSize(long) // required size
          .build();
       
      Returns:
      A new VulkanBufferMemoryBarrier builder