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
sType
must beSTRUCTURE_TYPE_IMAGE_MEMORY_BARRIER
pNext
must beNULL
srcAccessMask
must be a valid combination ofVkAccessFlagBits
valuesdstAccessMask
must be a valid combination ofVkAccessFlagBits
valuesoldLayout
must be a validVkImageLayout
valuenewLayout
must be a validVkImageLayout
valueimage
must be a validVkImage
handlesubresourceRange
must be a validVkImageSubresourceRange
structureoldLayout
must beIMAGE_LAYOUT_UNDEFINED
,IMAGE_LAYOUT_PREINITIALIZED
or the current layout of the image region affected by the barriernewLayout
must not beIMAGE_LAYOUT_UNDEFINED
orIMAGE_LAYOUT_PREINITIALIZED
- If
image
was created with a sharing mode ofSHARING_MODE_CONCURRENT
,srcQueueFamilyIndex
anddstQueueFamilyIndex
must both beQUEUE_FAMILY_IGNORED
- If
image
was created with a sharing mode ofSHARING_MODE_EXCLUSIVE
,srcQueueFamilyIndex
anddstQueueFamilyIndex
must either both beQUEUE_FAMILY_IGNORED
, or both be a valid queue family - If
image
was created with a sharing mode ofSHARING_MODE_EXCLUSIVE
, andsrcQueueFamilyIndex
anddstQueueFamilyIndex
are valid queue families, at least one of them must be the same as the family of the queue that will execute this barrier subresourceRange
must be a valid image subresource range for the image- If
image
has a depth/stencil format with both depth and stencil components, thenaspectMask
member ofsubresourceRange
must include bothIMAGE_ASPECT_DEPTH_BIT
andIMAGE_ASPECT_STENCIL_BIT
- If either
oldLayout
ornewLayout
isIMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL
thenimage
must have been created withIMAGE_USAGE_COLOR_ATTACHMENT_BIT
set - If either
oldLayout
ornewLayout
isIMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL
thenimage
must have been created withIMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT
set - If either
oldLayout
ornewLayout
isIMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL
thenimage
must have been created withIMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT
set - If either
oldLayout
ornewLayout
isIMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL
thenimage
must have been created withIMAGE_USAGE_SAMPLED_BIT
orIMAGE_USAGE_INPUT_ATTACHMENT_BIT
set - If either
oldLayout
ornewLayout
isIMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL
thenimage
must have been created withIMAGE_USAGE_TRANSFER_SRC_BIT
set - If either
oldLayout
ornewLayout
isIMAGE_LAYOUT_TRANSFER_DST_OPTIMAL
thenimage
must have been created withIMAGE_USAGE_TRANSFER_DST_BIT
set
Member documentation
sType
– the type of this structure. Must be:STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER
pNext
– 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_IGNORED
if there is no transfer of ownership)dstQueueFamilyIndex
– the queue family that is acquiring ownership of the image subresource(s) from another queue, orQUEUE_FAMILY_IGNORED
if 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;
VkImageSubresourceRange
subresourceRange; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static class
VkImageMemoryBarrier.Buffer
An array ofVkImageMemoryBarrier
structs.-
Nested classes/interfaces inherited from interface org.lwjgl.system.Pointer
Pointer.Default
-
-
Field Summary
Fields Modifier and Type Field and Description static int
SIZEOF
The 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 aVkImageMemoryBarrier
instance at the current position of the specifiedByteBuffer
container.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description static VkImageMemoryBarrier
calloc()
Returns a newVkImageMemoryBarrier
instance allocated withmemCalloc
.static VkImageMemoryBarrier.Buffer
calloc(int capacity)
Returns a newVkImageMemoryBarrier.Buffer
instance allocated withmemCalloc
.static VkImageMemoryBarrier
callocStack()
Returns a newVkImageMemoryBarrier
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static VkImageMemoryBarrier.Buffer
callocStack(int capacity)
Returns a newVkImageMemoryBarrier.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static VkImageMemoryBarrier.Buffer
callocStack(int capacity, MemoryStack stack)
Returns a newVkImageMemoryBarrier.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static VkImageMemoryBarrier
callocStack(MemoryStack stack)
Returns a newVkImageMemoryBarrier
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static VkImageMemoryBarrier
create()
Returns a newVkImageMemoryBarrier
instance allocated withBufferUtils
.static VkImageMemoryBarrier.Buffer
create(int capacity)
Returns a newVkImageMemoryBarrier.Buffer
instance allocated withBufferUtils
.static VkImageMemoryBarrier
create(long address)
Returns a newVkImageMemoryBarrier
instance for the specified memory address ornull
if the address isNULL
.static VkImageMemoryBarrier.Buffer
create(long address, int capacity)
Create aVkImageMemoryBarrier.Buffer
instance at the specified memory.int
dstAccessMask()
Returns the value of thedstAccessMask
field.VkImageMemoryBarrier
dstAccessMask(int value)
Sets the specified value to thedstAccessMask
field.int
dstQueueFamilyIndex()
Returns the value of thedstQueueFamilyIndex
field.VkImageMemoryBarrier
dstQueueFamilyIndex(int value)
Sets the specified value to thedstQueueFamilyIndex
field.long
image()
Returns the value of theimage
field.VkImageMemoryBarrier
image(long value)
Sets the specified value to theimage
field.static VkImageMemoryBarrier
malloc()
Returns a newVkImageMemoryBarrier
instance allocated withmemAlloc
.static VkImageMemoryBarrier.Buffer
malloc(int capacity)
Returns a newVkImageMemoryBarrier.Buffer
instance allocated withmemAlloc
.static VkImageMemoryBarrier
mallocStack()
Returns a newVkImageMemoryBarrier
instance allocated on the thread-localMemoryStack
.static VkImageMemoryBarrier.Buffer
mallocStack(int capacity)
Returns a newVkImageMemoryBarrier.Buffer
instance allocated on the thread-localMemoryStack
.static VkImageMemoryBarrier.Buffer
mallocStack(int capacity, MemoryStack stack)
Returns a newVkImageMemoryBarrier.Buffer
instance allocated on the specifiedMemoryStack
.static VkImageMemoryBarrier
mallocStack(MemoryStack stack)
Returns a newVkImageMemoryBarrier
instance allocated on the specifiedMemoryStack
.int
newLayout()
Returns the value of thenewLayout
field.VkImageMemoryBarrier
newLayout(int value)
Sets the specified value to thenewLayout
field.VkImageMemoryBarrier
nset(long struct)
Unsafe version ofset
.int
oldLayout()
Returns the value of theoldLayout
field.VkImageMemoryBarrier
oldLayout(int value)
Sets the specified value to theoldLayout
field.long
pNext()
Returns the value of thepNext
field.VkImageMemoryBarrier
pNext(long value)
Sets the specified value to thepNext
field.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.VkImageMemoryBarrier
set(VkImageMemoryBarrier src)
Copies the specified struct data to this struct.int
sizeof()
Returns thesizeof(struct)
.int
srcAccessMask()
Returns the value of thesrcAccessMask
field.VkImageMemoryBarrier
srcAccessMask(int value)
Sets the specified value to thesrcAccessMask
field.int
srcQueueFamilyIndex()
Returns the value of thesrcQueueFamilyIndex
field.VkImageMemoryBarrier
srcQueueFamilyIndex(int value)
Sets the specified value to thesrcQueueFamilyIndex
field.int
sType()
Returns the value of thesType
field.VkImageMemoryBarrier
sType(int value)
Sets the specified value to thesType
field.VkImageSubresourceRange
subresourceRange()
Returns aVkImageSubresourceRange
view of thesubresourceRange
field.VkImageMemoryBarrier
subresourceRange(VkImageSubresourceRange value)
Copies the specifiedVkImageSubresourceRange
to thesubresourceRange
field.-
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 aVkImageMemoryBarrier
instance at the current position of the specifiedByteBuffer
container. 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:Struct
Returns thesizeof(struct)
.
-
sType
public int sType()
Returns the value of thesType
field.
-
pNext
public long pNext()
Returns the value of thepNext
field.
-
srcAccessMask
public int srcAccessMask()
Returns the value of thesrcAccessMask
field.
-
dstAccessMask
public int dstAccessMask()
Returns the value of thedstAccessMask
field.
-
oldLayout
public int oldLayout()
Returns the value of theoldLayout
field.
-
newLayout
public int newLayout()
Returns the value of thenewLayout
field.
-
srcQueueFamilyIndex
public int srcQueueFamilyIndex()
Returns the value of thesrcQueueFamilyIndex
field.
-
dstQueueFamilyIndex
public int dstQueueFamilyIndex()
Returns the value of thedstQueueFamilyIndex
field.
-
image
public long image()
Returns the value of theimage
field.
-
subresourceRange
public VkImageSubresourceRange subresourceRange()
Returns aVkImageSubresourceRange
view of thesubresourceRange
field.
-
sType
public VkImageMemoryBarrier sType(int value)
Sets the specified value to thesType
field.
-
pNext
public VkImageMemoryBarrier pNext(long value)
Sets the specified value to thepNext
field.
-
srcAccessMask
public VkImageMemoryBarrier srcAccessMask(int value)
Sets the specified value to thesrcAccessMask
field.
-
dstAccessMask
public VkImageMemoryBarrier dstAccessMask(int value)
Sets the specified value to thedstAccessMask
field.
-
oldLayout
public VkImageMemoryBarrier oldLayout(int value)
Sets the specified value to theoldLayout
field.
-
newLayout
public VkImageMemoryBarrier newLayout(int value)
Sets the specified value to thenewLayout
field.
-
srcQueueFamilyIndex
public VkImageMemoryBarrier srcQueueFamilyIndex(int value)
Sets the specified value to thesrcQueueFamilyIndex
field.
-
dstQueueFamilyIndex
public VkImageMemoryBarrier dstQueueFamilyIndex(int value)
Sets the specified value to thedstQueueFamilyIndex
field.
-
image
public VkImageMemoryBarrier image(long value)
Sets the specified value to theimage
field.
-
subresourceRange
public VkImageMemoryBarrier subresourceRange(VkImageSubresourceRange value)
Copies the specifiedVkImageSubresourceRange
to thesubresourceRange
field.
-
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 newVkImageMemoryBarrier
instance allocated withmemAlloc
. The instance must be explicitly freed.
-
calloc
public static VkImageMemoryBarrier calloc()
Returns a newVkImageMemoryBarrier
instance allocated withmemCalloc
. The instance must be explicitly freed.
-
create
public static VkImageMemoryBarrier create()
Returns a newVkImageMemoryBarrier
instance allocated withBufferUtils
.
-
create
public static VkImageMemoryBarrier create(long address)
Returns a newVkImageMemoryBarrier
instance for the specified memory address ornull
if the address isNULL
.
-
malloc
public static VkImageMemoryBarrier.Buffer malloc(int capacity)
Returns a newVkImageMemoryBarrier.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
public static VkImageMemoryBarrier.Buffer calloc(int capacity)
Returns a newVkImageMemoryBarrier.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
public static VkImageMemoryBarrier.Buffer create(int capacity)
Returns a newVkImageMemoryBarrier.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
public static VkImageMemoryBarrier.Buffer create(long address, int capacity)
Create aVkImageMemoryBarrier.Buffer
instance at the specified memory.- Parameters:
address
- the memory addresscapacity
- the buffer capacity
-
mallocStack
public static VkImageMemoryBarrier mallocStack()
Returns a newVkImageMemoryBarrier
instance allocated on the thread-localMemoryStack
.
-
callocStack
public static VkImageMemoryBarrier callocStack()
Returns a newVkImageMemoryBarrier
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.
-
mallocStack
public static VkImageMemoryBarrier mallocStack(MemoryStack stack)
Returns a newVkImageMemoryBarrier
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
callocStack
public static VkImageMemoryBarrier callocStack(MemoryStack stack)
Returns a newVkImageMemoryBarrier
instance allocated on the specifiedMemoryStack
and 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.Buffer
instance allocated on the thread-localMemoryStack
.- Parameters:
capacity
- the buffer capacity
-
callocStack
public static VkImageMemoryBarrier.Buffer callocStack(int capacity)
Returns a newVkImageMemoryBarrier.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.- Parameters:
capacity
- the buffer capacity
-
mallocStack
public static VkImageMemoryBarrier.Buffer mallocStack(int capacity, MemoryStack stack)
Returns a newVkImageMemoryBarrier.Buffer
instance 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.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
-