Package org.lwjgl.vulkan
Class VkImageMemoryBarrier
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.vulkan.VkImageMemoryBarrier
-
- All Implemented Interfaces:
- java.lang.AutoCloseable, NativeResource, Pointer
public class VkImageMemoryBarrier extends Struct
Khronos Reference Page
Vulkan SpecificationSpecifies an image memory barrier. This type of barrier only applies to memory accesses involving a specific image subresource range of the specified image object. That is, a memory dependency formed from an image memory barrier is scoped to the specified subresources of the image. It is also used to perform a layout transition for an image subresource range, or to transfer ownership of an image subresource range from one queue family to another.
Valid Usage
sTypemust beSTRUCTURE_TYPE_IMAGE_MEMORY_BARRIERpNextmust beNULLsrcAccessMaskmust be a valid combination ofVkAccessFlagBitsvaluesdstAccessMaskmust be a valid combination ofVkAccessFlagBitsvaluesoldLayoutmust be a validVkImageLayoutvaluenewLayoutmust be a validVkImageLayoutvalueimagemust be a validVkImagehandlesubresourceRangemust be a validVkImageSubresourceRangestructureoldLayoutmust beIMAGE_LAYOUT_UNDEFINED,IMAGE_LAYOUT_PREINITIALIZEDor the current layout of the image region affected by the barriernewLayoutmust not beIMAGE_LAYOUT_UNDEFINEDorIMAGE_LAYOUT_PREINITIALIZED- If
imagewas created with a sharing mode ofSHARING_MODE_CONCURRENT,srcQueueFamilyIndexanddstQueueFamilyIndexmust both beQUEUE_FAMILY_IGNORED - If
imagewas created with a sharing mode ofSHARING_MODE_EXCLUSIVE,srcQueueFamilyIndexanddstQueueFamilyIndexmust either both beQUEUE_FAMILY_IGNORED, or both be a valid queue family - If
imagewas created with a sharing mode ofSHARING_MODE_EXCLUSIVE, andsrcQueueFamilyIndexanddstQueueFamilyIndexare valid queue families, at least one of them must be the same as the family of the queue that will execute this barrier subresourceRangemust be a valid image subresource range for the image- If
imagehas a depth/stencil format with both depth and stencil components, thenaspectMaskmember ofsubresourceRangemust include bothIMAGE_ASPECT_DEPTH_BITandIMAGE_ASPECT_STENCIL_BIT - If either
oldLayoutornewLayoutisIMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMALthenimagemust have been created withIMAGE_USAGE_COLOR_ATTACHMENT_BITset - If either
oldLayoutornewLayoutisIMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMALthenimagemust have been created withIMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BITset - If either
oldLayoutornewLayoutisIMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMALthenimagemust have been created withIMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BITset - If either
oldLayoutornewLayoutisIMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMALthenimagemust have been created withIMAGE_USAGE_SAMPLED_BITorIMAGE_USAGE_INPUT_ATTACHMENT_BITset - If either
oldLayoutornewLayoutisIMAGE_LAYOUT_TRANSFER_SRC_OPTIMALthenimagemust have been created withIMAGE_USAGE_TRANSFER_SRC_BITset - If either
oldLayoutornewLayoutisIMAGE_LAYOUT_TRANSFER_DST_OPTIMALthenimagemust have been created withIMAGE_USAGE_TRANSFER_DST_BITset
Member documentation
sType– the type of this structure. Must be:STRUCTURE_TYPE_IMAGE_MEMORY_BARRIERpNext– reserved for use by extensionssrcAccessMask– a bitmask of the classes of memory accesses performed by the first set of commands that will participate in the dependency. One or more of:dstAccessMask– a bitmask of the classes of memory accesses performed by the second set of commands that will participate in the dependencyoldLayout– describes the current layout of the image subresource(s). One of:newLayout– describes the new layout of the image subresource(s)srcQueueFamilyIndex– the queue family that is relinquishing ownership of the image subresource(s) to another queue, orQUEUE_FAMILY_IGNOREDif there is no transfer of ownership)dstQueueFamilyIndex– the queue family that is acquiring ownership of the image subresource(s) from another queue, orQUEUE_FAMILY_IGNOREDif there is no transfer of ownership)image– a handle to the image whose backing memory is affected by the barriersubresourceRange– describes an area of the backing memory for image, as well as the set of image subresources whose image layouts are modified
Layout
struct VkImageMemoryBarrier { VkStructureType sType; const void * pNext; VkAccessFlags srcAccessMask; VkAccessFlags dstAccessMask; VkImageLayout oldLayout; VkImageLayout newLayout; uint32_t srcQueueFamilyIndex; uint32_t dstQueueFamilyIndex; VkImage image;VkImageSubresourceRangesubresourceRange; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static classVkImageMemoryBarrier.BufferAn array ofVkImageMemoryBarrierstructs.-
Nested classes/interfaces inherited from interface org.lwjgl.system.Pointer
Pointer.Default
-
-
Field Summary
Fields Modifier and Type Field and Description static intSIZEOFThe struct size in bytes.-
Fields inherited from interface org.lwjgl.system.Pointer
POINTER_SHIFT, POINTER_SIZE
-
-
Constructor Summary
Constructors Constructor and Description VkImageMemoryBarrier(java.nio.ByteBuffer container)Creates aVkImageMemoryBarrierinstance at the current position of the specifiedByteBuffercontainer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description static VkImageMemoryBarriercalloc()Returns a newVkImageMemoryBarrierinstance allocated withmemCalloc.static VkImageMemoryBarrier.Buffercalloc(int capacity)Returns a newVkImageMemoryBarrier.Bufferinstance allocated withmemCalloc.static VkImageMemoryBarriercallocStack()Returns a newVkImageMemoryBarrierinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static VkImageMemoryBarrier.BuffercallocStack(int capacity)Returns a newVkImageMemoryBarrier.Bufferinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static VkImageMemoryBarrier.BuffercallocStack(int capacity, MemoryStack stack)Returns a newVkImageMemoryBarrier.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static VkImageMemoryBarriercallocStack(MemoryStack stack)Returns a newVkImageMemoryBarrierinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static VkImageMemoryBarriercreate()Returns a newVkImageMemoryBarrierinstance allocated withBufferUtils.static VkImageMemoryBarrier.Buffercreate(int capacity)Returns a newVkImageMemoryBarrier.Bufferinstance allocated withBufferUtils.static VkImageMemoryBarriercreate(long address)Returns a newVkImageMemoryBarrierinstance for the specified memory address ornullif the address isNULL.static VkImageMemoryBarrier.Buffercreate(long address, int capacity)Create aVkImageMemoryBarrier.Bufferinstance at the specified memory.intdstAccessMask()Returns the value of thedstAccessMaskfield.VkImageMemoryBarrierdstAccessMask(int value)Sets the specified value to thedstAccessMaskfield.intdstQueueFamilyIndex()Returns the value of thedstQueueFamilyIndexfield.VkImageMemoryBarrierdstQueueFamilyIndex(int value)Sets the specified value to thedstQueueFamilyIndexfield.longimage()Returns the value of theimagefield.VkImageMemoryBarrierimage(long value)Sets the specified value to theimagefield.static VkImageMemoryBarriermalloc()Returns a newVkImageMemoryBarrierinstance allocated withmemAlloc.static VkImageMemoryBarrier.Buffermalloc(int capacity)Returns a newVkImageMemoryBarrier.Bufferinstance allocated withmemAlloc.static VkImageMemoryBarriermallocStack()Returns a newVkImageMemoryBarrierinstance allocated on the thread-localMemoryStack.static VkImageMemoryBarrier.BuffermallocStack(int capacity)Returns a newVkImageMemoryBarrier.Bufferinstance allocated on the thread-localMemoryStack.static VkImageMemoryBarrier.BuffermallocStack(int capacity, MemoryStack stack)Returns a newVkImageMemoryBarrier.Bufferinstance allocated on the specifiedMemoryStack.static VkImageMemoryBarriermallocStack(MemoryStack stack)Returns a newVkImageMemoryBarrierinstance allocated on the specifiedMemoryStack.intnewLayout()Returns the value of thenewLayoutfield.VkImageMemoryBarriernewLayout(int value)Sets the specified value to thenewLayoutfield.VkImageMemoryBarriernset(long struct)Unsafe version ofset.intoldLayout()Returns the value of theoldLayoutfield.VkImageMemoryBarrieroldLayout(int value)Sets the specified value to theoldLayoutfield.longpNext()Returns the value of thepNextfield.VkImageMemoryBarrierpNext(long value)Sets the specified value to thepNextfield.VkImageMemoryBarrierset(int sType, long pNext, int srcAccessMask, int dstAccessMask, int oldLayout, int newLayout, int srcQueueFamilyIndex, int dstQueueFamilyIndex, long image, VkImageSubresourceRange subresourceRange)Initializes this struct with the specified values.VkImageMemoryBarrierset(VkImageMemoryBarrier src)Copies the specified struct data to this struct.intsizeof()Returns thesizeof(struct).intsrcAccessMask()Returns the value of thesrcAccessMaskfield.VkImageMemoryBarriersrcAccessMask(int value)Sets the specified value to thesrcAccessMaskfield.intsrcQueueFamilyIndex()Returns the value of thesrcQueueFamilyIndexfield.VkImageMemoryBarriersrcQueueFamilyIndex(int value)Sets the specified value to thesrcQueueFamilyIndexfield.intsType()Returns the value of thesTypefield.VkImageMemoryBarriersType(int value)Sets the specified value to thesTypefield.VkImageSubresourceRangesubresourceRange()Returns aVkImageSubresourceRangeview of thesubresourceRangefield.VkImageMemoryBarriersubresourceRange(VkImageSubresourceRange value)Copies the specifiedVkImageSubresourceRangeto thesubresourceRangefield.-
Methods inherited from class org.lwjgl.system.Pointer.Default
address, equals, hashCode, toString
-
Methods inherited from interface org.lwjgl.system.NativeResource
close
-
-
-
-
Constructor Detail
-
VkImageMemoryBarrier
public VkImageMemoryBarrier(java.nio.ByteBuffer container)
Creates aVkImageMemoryBarrierinstance at the current position of the specifiedByteBuffercontainer. Changes to the buffer's content will be visible to the struct instance and vice versa.The created instance holds a strong reference to the container object.
-
-
Method Detail
-
sizeof
public int sizeof()
Description copied from class:StructReturns thesizeof(struct).
-
sType
public int sType()
Returns the value of thesTypefield.
-
pNext
public long pNext()
Returns the value of thepNextfield.
-
srcAccessMask
public int srcAccessMask()
Returns the value of thesrcAccessMaskfield.
-
dstAccessMask
public int dstAccessMask()
Returns the value of thedstAccessMaskfield.
-
oldLayout
public int oldLayout()
Returns the value of theoldLayoutfield.
-
newLayout
public int newLayout()
Returns the value of thenewLayoutfield.
-
srcQueueFamilyIndex
public int srcQueueFamilyIndex()
Returns the value of thesrcQueueFamilyIndexfield.
-
dstQueueFamilyIndex
public int dstQueueFamilyIndex()
Returns the value of thedstQueueFamilyIndexfield.
-
image
public long image()
Returns the value of theimagefield.
-
subresourceRange
public VkImageSubresourceRange subresourceRange()
Returns aVkImageSubresourceRangeview of thesubresourceRangefield.
-
sType
public VkImageMemoryBarrier sType(int value)
Sets the specified value to thesTypefield.
-
pNext
public VkImageMemoryBarrier pNext(long value)
Sets the specified value to thepNextfield.
-
srcAccessMask
public VkImageMemoryBarrier srcAccessMask(int value)
Sets the specified value to thesrcAccessMaskfield.
-
dstAccessMask
public VkImageMemoryBarrier dstAccessMask(int value)
Sets the specified value to thedstAccessMaskfield.
-
oldLayout
public VkImageMemoryBarrier oldLayout(int value)
Sets the specified value to theoldLayoutfield.
-
newLayout
public VkImageMemoryBarrier newLayout(int value)
Sets the specified value to thenewLayoutfield.
-
srcQueueFamilyIndex
public VkImageMemoryBarrier srcQueueFamilyIndex(int value)
Sets the specified value to thesrcQueueFamilyIndexfield.
-
dstQueueFamilyIndex
public VkImageMemoryBarrier dstQueueFamilyIndex(int value)
Sets the specified value to thedstQueueFamilyIndexfield.
-
image
public VkImageMemoryBarrier image(long value)
Sets the specified value to theimagefield.
-
subresourceRange
public VkImageMemoryBarrier subresourceRange(VkImageSubresourceRange value)
Copies the specifiedVkImageSubresourceRangeto thesubresourceRangefield.
-
set
public VkImageMemoryBarrier set(int sType, long pNext, int srcAccessMask, int dstAccessMask, int oldLayout, int newLayout, int srcQueueFamilyIndex, int dstQueueFamilyIndex, long image, VkImageSubresourceRange subresourceRange)
Initializes this struct with the specified values.
-
nset
public VkImageMemoryBarrier nset(long struct)
Unsafe version ofset.
-
set
public VkImageMemoryBarrier set(VkImageMemoryBarrier src)
Copies the specified struct data to this struct.- Parameters:
src- the source struct- Returns:
- this struct
-
malloc
public static VkImageMemoryBarrier malloc()
Returns a newVkImageMemoryBarrierinstance allocated withmemAlloc. The instance must be explicitly freed.
-
calloc
public static VkImageMemoryBarrier calloc()
Returns a newVkImageMemoryBarrierinstance allocated withmemCalloc. The instance must be explicitly freed.
-
create
public static VkImageMemoryBarrier create()
Returns a newVkImageMemoryBarrierinstance allocated withBufferUtils.
-
create
public static VkImageMemoryBarrier create(long address)
Returns a newVkImageMemoryBarrierinstance for the specified memory address ornullif the address isNULL.
-
malloc
public static VkImageMemoryBarrier.Buffer malloc(int capacity)
Returns a newVkImageMemoryBarrier.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
public static VkImageMemoryBarrier.Buffer calloc(int capacity)
Returns a newVkImageMemoryBarrier.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
public static VkImageMemoryBarrier.Buffer create(int capacity)
Returns a newVkImageMemoryBarrier.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
public static VkImageMemoryBarrier.Buffer create(long address, int capacity)
Create aVkImageMemoryBarrier.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
mallocStack
public static VkImageMemoryBarrier mallocStack()
Returns a newVkImageMemoryBarrierinstance allocated on the thread-localMemoryStack.
-
callocStack
public static VkImageMemoryBarrier callocStack()
Returns a newVkImageMemoryBarrierinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.
-
mallocStack
public static VkImageMemoryBarrier mallocStack(MemoryStack stack)
Returns a newVkImageMemoryBarrierinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
callocStack
public static VkImageMemoryBarrier callocStack(MemoryStack stack)
Returns a newVkImageMemoryBarrierinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
mallocStack
public static VkImageMemoryBarrier.Buffer mallocStack(int capacity)
Returns a newVkImageMemoryBarrier.Bufferinstance allocated on the thread-localMemoryStack.- Parameters:
capacity- the buffer capacity
-
callocStack
public static VkImageMemoryBarrier.Buffer callocStack(int capacity)
Returns a newVkImageMemoryBarrier.Bufferinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.- Parameters:
capacity- the buffer capacity
-
mallocStack
public static VkImageMemoryBarrier.Buffer mallocStack(int capacity, MemoryStack stack)
Returns a newVkImageMemoryBarrier.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
callocStack
public static VkImageMemoryBarrier.Buffer callocStack(int capacity, MemoryStack stack)
Returns a newVkImageMemoryBarrier.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
-