Package org.lwjgl.vulkan
Class VkBufferMemoryBarrier
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.vulkan.VkBufferMemoryBarrier
-
- All Implemented Interfaces:
- java.lang.AutoCloseable, NativeResource, Pointer
public class VkBufferMemoryBarrier extends Struct
Khronos Reference Page
Vulkan SpecificationSpecifies a buffer memory barrier. This type of barrier only applies to memory accesses involving a specific range of the specified buffer object. That is, a memory dependency formed from a buffer memory barrier is scoped to the specified range of the buffer. It is also used to transfer ownership of a buffer range from one queue family to another.
Valid Usage
sType
must beSTRUCTURE_TYPE_BUFFER_MEMORY_BARRIER
pNext
must beNULL
srcAccessMask
must be a valid combination ofVkAccessFlagBits
valuesdstAccessMask
must be a valid combination ofVkAccessFlagBits
valuesbuffer
must be a validVkBuffer
handleoffset
must be less than the size ofbuffer
- If
size
is not equal toWHOLE_SIZE
,size
must be greater than 0 - If
size
is not equal toWHOLE_SIZE
,size
must be less than or equal to than the size ofbuffer
minusoffset
- If
buffer
was created with a sharing mode ofSHARING_MODE_CONCURRENT
,srcQueueFamilyIndex
anddstQueueFamilyIndex
must both beQUEUE_FAMILY_IGNORED
- If
buffer
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
buffer
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
Member documentation
sType
– the type of this structure. Must be:STRUCTURE_TYPE_BUFFER_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 dependencysrcQueueFamilyIndex
– the queue family that is relinquishing ownership of the range of buffer to another queue, orQUEUE_FAMILY_IGNORED
if there is no transfer of ownershipdstQueueFamilyIndex
– the queue family that is acquiring ownership of the range of buffer from another queue, orQUEUE_FAMILY_IGNORED
if there is no transfer of ownershipbuffer
– a handle to the buffer whose backing memory is affected by the barrieroffset
– an offset in bytes into the backing memory for buffer; this is relative to the base offset as bound to the buffersize
– a size in bytes of the affected area of backing memory for buffer, orWHOLE_SIZE
to use the range from offset to the end of the buffer
Layout
struct VkBufferMemoryBarrier { VkStructureType sType; const void * pNext; VkAccessFlags srcAccessMask; VkAccessFlags dstAccessMask; uint32_t srcQueueFamilyIndex; uint32_t dstQueueFamilyIndex; VkBuffer buffer; VkDeviceSize offset; VkDeviceSize size; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static class
VkBufferMemoryBarrier.Buffer
An array ofVkBufferMemoryBarrier
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 VkBufferMemoryBarrier(java.nio.ByteBuffer container)
Creates aVkBufferMemoryBarrier
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 long
buffer()
Returns the value of thebuffer
field.VkBufferMemoryBarrier
buffer(long value)
Sets the specified value to thebuffer
field.static VkBufferMemoryBarrier
calloc()
Returns a newVkBufferMemoryBarrier
instance allocated withmemCalloc
.static VkBufferMemoryBarrier.Buffer
calloc(int capacity)
Returns a newVkBufferMemoryBarrier.Buffer
instance allocated withmemCalloc
.static VkBufferMemoryBarrier
callocStack()
Returns a newVkBufferMemoryBarrier
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static VkBufferMemoryBarrier.Buffer
callocStack(int capacity)
Returns a newVkBufferMemoryBarrier.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static VkBufferMemoryBarrier.Buffer
callocStack(int capacity, MemoryStack stack)
Returns a newVkBufferMemoryBarrier.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static VkBufferMemoryBarrier
callocStack(MemoryStack stack)
Returns a newVkBufferMemoryBarrier
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static VkBufferMemoryBarrier
create()
Returns a newVkBufferMemoryBarrier
instance allocated withBufferUtils
.static VkBufferMemoryBarrier.Buffer
create(int capacity)
Returns a newVkBufferMemoryBarrier.Buffer
instance allocated withBufferUtils
.static VkBufferMemoryBarrier
create(long address)
Returns a newVkBufferMemoryBarrier
instance for the specified memory address ornull
if the address isNULL
.static VkBufferMemoryBarrier.Buffer
create(long address, int capacity)
Create aVkBufferMemoryBarrier.Buffer
instance at the specified memory.int
dstAccessMask()
Returns the value of thedstAccessMask
field.VkBufferMemoryBarrier
dstAccessMask(int value)
Sets the specified value to thedstAccessMask
field.int
dstQueueFamilyIndex()
Returns the value of thedstQueueFamilyIndex
field.VkBufferMemoryBarrier
dstQueueFamilyIndex(int value)
Sets the specified value to thedstQueueFamilyIndex
field.static VkBufferMemoryBarrier
malloc()
Returns a newVkBufferMemoryBarrier
instance allocated withmemAlloc
.static VkBufferMemoryBarrier.Buffer
malloc(int capacity)
Returns a newVkBufferMemoryBarrier.Buffer
instance allocated withmemAlloc
.static VkBufferMemoryBarrier
mallocStack()
Returns a newVkBufferMemoryBarrier
instance allocated on the thread-localMemoryStack
.static VkBufferMemoryBarrier.Buffer
mallocStack(int capacity)
Returns a newVkBufferMemoryBarrier.Buffer
instance allocated on the thread-localMemoryStack
.static VkBufferMemoryBarrier.Buffer
mallocStack(int capacity, MemoryStack stack)
Returns a newVkBufferMemoryBarrier.Buffer
instance allocated on the specifiedMemoryStack
.static VkBufferMemoryBarrier
mallocStack(MemoryStack stack)
Returns a newVkBufferMemoryBarrier
instance allocated on the specifiedMemoryStack
.VkBufferMemoryBarrier
nset(long struct)
Unsafe version ofset
.long
offset()
Returns the value of theoffset
field.VkBufferMemoryBarrier
offset(long value)
Sets the specified value to theoffset
field.long
pNext()
Returns the value of thepNext
field.VkBufferMemoryBarrier
pNext(long value)
Sets the specified value to thepNext
field.VkBufferMemoryBarrier
set(int sType, long pNext, int srcAccessMask, int dstAccessMask, int srcQueueFamilyIndex, int dstQueueFamilyIndex, long buffer, long offset, long size)
Initializes this struct with the specified values.VkBufferMemoryBarrier
set(VkBufferMemoryBarrier src)
Copies the specified struct data to this struct.long
size()
Returns the value of thesize
field.VkBufferMemoryBarrier
size(long value)
Sets the specified value to thesize
field.int
sizeof()
Returns thesizeof(struct)
.int
srcAccessMask()
Returns the value of thesrcAccessMask
field.VkBufferMemoryBarrier
srcAccessMask(int value)
Sets the specified value to thesrcAccessMask
field.int
srcQueueFamilyIndex()
Returns the value of thesrcQueueFamilyIndex
field.VkBufferMemoryBarrier
srcQueueFamilyIndex(int value)
Sets the specified value to thesrcQueueFamilyIndex
field.int
sType()
Returns the value of thesType
field.VkBufferMemoryBarrier
sType(int value)
Sets the specified value to thesType
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
-
VkBufferMemoryBarrier
public VkBufferMemoryBarrier(java.nio.ByteBuffer container)
Creates aVkBufferMemoryBarrier
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.
-
srcQueueFamilyIndex
public int srcQueueFamilyIndex()
Returns the value of thesrcQueueFamilyIndex
field.
-
dstQueueFamilyIndex
public int dstQueueFamilyIndex()
Returns the value of thedstQueueFamilyIndex
field.
-
buffer
public long buffer()
Returns the value of thebuffer
field.
-
offset
public long offset()
Returns the value of theoffset
field.
-
size
public long size()
Returns the value of thesize
field.
-
sType
public VkBufferMemoryBarrier sType(int value)
Sets the specified value to thesType
field.
-
pNext
public VkBufferMemoryBarrier pNext(long value)
Sets the specified value to thepNext
field.
-
srcAccessMask
public VkBufferMemoryBarrier srcAccessMask(int value)
Sets the specified value to thesrcAccessMask
field.
-
dstAccessMask
public VkBufferMemoryBarrier dstAccessMask(int value)
Sets the specified value to thedstAccessMask
field.
-
srcQueueFamilyIndex
public VkBufferMemoryBarrier srcQueueFamilyIndex(int value)
Sets the specified value to thesrcQueueFamilyIndex
field.
-
dstQueueFamilyIndex
public VkBufferMemoryBarrier dstQueueFamilyIndex(int value)
Sets the specified value to thedstQueueFamilyIndex
field.
-
buffer
public VkBufferMemoryBarrier buffer(long value)
Sets the specified value to thebuffer
field.
-
offset
public VkBufferMemoryBarrier offset(long value)
Sets the specified value to theoffset
field.
-
size
public VkBufferMemoryBarrier size(long value)
Sets the specified value to thesize
field.
-
set
public VkBufferMemoryBarrier set(int sType, long pNext, int srcAccessMask, int dstAccessMask, int srcQueueFamilyIndex, int dstQueueFamilyIndex, long buffer, long offset, long size)
Initializes this struct with the specified values.
-
nset
public VkBufferMemoryBarrier nset(long struct)
Unsafe version ofset
.
-
set
public VkBufferMemoryBarrier set(VkBufferMemoryBarrier src)
Copies the specified struct data to this struct.- Parameters:
src
- the source struct- Returns:
- this struct
-
malloc
public static VkBufferMemoryBarrier malloc()
Returns a newVkBufferMemoryBarrier
instance allocated withmemAlloc
. The instance must be explicitly freed.
-
calloc
public static VkBufferMemoryBarrier calloc()
Returns a newVkBufferMemoryBarrier
instance allocated withmemCalloc
. The instance must be explicitly freed.
-
create
public static VkBufferMemoryBarrier create()
Returns a newVkBufferMemoryBarrier
instance allocated withBufferUtils
.
-
create
public static VkBufferMemoryBarrier create(long address)
Returns a newVkBufferMemoryBarrier
instance for the specified memory address ornull
if the address isNULL
.
-
malloc
public static VkBufferMemoryBarrier.Buffer malloc(int capacity)
Returns a newVkBufferMemoryBarrier.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
public static VkBufferMemoryBarrier.Buffer calloc(int capacity)
Returns a newVkBufferMemoryBarrier.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
public static VkBufferMemoryBarrier.Buffer create(int capacity)
Returns a newVkBufferMemoryBarrier.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
public static VkBufferMemoryBarrier.Buffer create(long address, int capacity)
Create aVkBufferMemoryBarrier.Buffer
instance at the specified memory.- Parameters:
address
- the memory addresscapacity
- the buffer capacity
-
mallocStack
public static VkBufferMemoryBarrier mallocStack()
Returns a newVkBufferMemoryBarrier
instance allocated on the thread-localMemoryStack
.
-
callocStack
public static VkBufferMemoryBarrier callocStack()
Returns a newVkBufferMemoryBarrier
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.
-
mallocStack
public static VkBufferMemoryBarrier mallocStack(MemoryStack stack)
Returns a newVkBufferMemoryBarrier
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
callocStack
public static VkBufferMemoryBarrier callocStack(MemoryStack stack)
Returns a newVkBufferMemoryBarrier
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocate
-
mallocStack
public static VkBufferMemoryBarrier.Buffer mallocStack(int capacity)
Returns a newVkBufferMemoryBarrier.Buffer
instance allocated on the thread-localMemoryStack
.- Parameters:
capacity
- the buffer capacity
-
callocStack
public static VkBufferMemoryBarrier.Buffer callocStack(int capacity)
Returns a newVkBufferMemoryBarrier.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.- Parameters:
capacity
- the buffer capacity
-
mallocStack
public static VkBufferMemoryBarrier.Buffer mallocStack(int capacity, MemoryStack stack)
Returns a newVkBufferMemoryBarrier.Buffer
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
callocStack
public static VkBufferMemoryBarrier.Buffer callocStack(int capacity, MemoryStack stack)
Returns a newVkBufferMemoryBarrier.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
-