Class VkBufferMemoryBarrier
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.vulkan.VkBufferMemoryBarrier
-
- All Implemented Interfaces:
java.lang.AutoCloseable,org.lwjgl.system.NativeResource,org.lwjgl.system.Pointer
public class VkBufferMemoryBarrier extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResourceStructure specifying a buffer memory barrier.Description
The first access scope is limited to access to memory through the specified buffer range, via access types in the source access mask specified by
srcAccessMask. IfsrcAccessMaskincludesACCESS_HOST_WRITE_BIT, memory writes performed by that access type are also made visible, as that access type is not performed through a resource.The second access scope is limited to access to memory through the specified buffer range, via access types in the destination access mask. specified by
dstAccessMask. IfdstAccessMaskincludesACCESS_HOST_WRITE_BITorACCESS_HOST_READ_BIT, available memory writes are also made visible to accesses of those types, as those access types are not performed through a resource.If
srcQueueFamilyIndexis not equal todstQueueFamilyIndex, andsrcQueueFamilyIndexis equal to the current queue family, then the memory barrier defines a queue family release operation for the specified buffer range, and the second access scope includes no access, as ifdstAccessMaskwas 0.If
dstQueueFamilyIndexis not equal tosrcQueueFamilyIndex, anddstQueueFamilyIndexis equal to the current queue family, then the memory barrier defines a queue family acquire operation for the specified buffer range, and the first access scope includes no access, as ifsrcAccessMaskwas 0.Valid Usage
offsetmust be less than the size ofbuffer- If
sizeis not equal toWHOLE_SIZE,sizemust be greater than 0 - If
sizeis not equal toWHOLE_SIZE,sizemust be less than or equal to than the size ofbufferminusoffset - If
bufferwas created with a sharing mode ofSHARING_MODE_CONCURRENT, at least one ofsrcQueueFamilyIndexanddstQueueFamilyIndexmust beQUEUE_FAMILY_IGNORED - If
bufferwas created with a sharing mode ofSHARING_MODE_CONCURRENT, and one ofsrcQueueFamilyIndexanddstQueueFamilyIndexisQUEUE_FAMILY_IGNORED, the other must beQUEUE_FAMILY_IGNOREDor a special queue family reserved for external memory ownership transfers, as described in Queue Family Ownership Transfer. - If
bufferwas created with a sharing mode ofSHARING_MODE_EXCLUSIVEandsrcQueueFamilyIndexisQUEUE_FAMILY_IGNORED,dstQueueFamilyIndexmust also beQUEUE_FAMILY_IGNORED - If
bufferwas created with a sharing mode ofSHARING_MODE_EXCLUSIVEandsrcQueueFamilyIndexis notQUEUE_FAMILY_IGNORED, it must be a valid queue family or a special queue family reserved for external memory transfers, as described in Queue Family Ownership Transfer. - If
bufferwas created with a sharing mode ofSHARING_MODE_EXCLUSIVEanddstQueueFamilyIndexis notQUEUE_FAMILY_IGNORED, it must be a valid queue family or a special queue family reserved for external memory transfers, as described in Queue Family Ownership Transfer. - If
bufferwas created with a sharing mode ofSHARING_MODE_EXCLUSIVE, andsrcQueueFamilyIndexanddstQueueFamilyIndexare notQUEUE_FAMILY_IGNORED, at least one of them must be the same as the family of the queue that will execute this barrier - If
bufferis non-sparse then it must be bound completely and contiguously to a singleVkDeviceMemoryobject
Valid Usage (Implicit)
sTypemust beSTRUCTURE_TYPE_BUFFER_MEMORY_BARRIERpNextmust beNULLsrcAccessMaskmust be a valid combination ofVkAccessFlagBitsvaluesdstAccessMaskmust be a valid combination ofVkAccessFlagBitsvaluesbuffermust be a validVkBufferhandle
See Also
CmdPipelineBarrier,CmdWaitEventsMember documentation
sType– the type of this structure.pNext–NULLor a pointer to an extension-specific structure.srcAccessMask– a bitmask ofVkAccessFlagBitsspecifying a source access mask.dstAccessMask– a bitmask ofVkAccessFlagBitsspecifying a destination access mask.srcQueueFamilyIndex– the source queue family for a queue family ownership transfer.dstQueueFamilyIndex– the destination queue family for a queue family ownership transfer.buffer– a handle to the buffer whose backing memory is affected by the barrier.offset– an offset in bytes into the backing memory forbuffer; this is relative to the base offset as bound to the buffer (seeBindBufferMemory).size– a size in bytes of the affected area of backing memory forbuffer, orWHOLE_SIZEto use the range fromoffsetto the end of the buffer.
Layout
struct VkBufferMemoryBarrier { VkStructureType sType; void const * 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 Description static classVkBufferMemoryBarrier.BufferAn array ofVkBufferMemoryBarrierstructs.
-
Field Summary
Fields Modifier and Type Field Description static intALIGNOFThe struct alignment in bytes.static intBUFFER
DSTACCESSMASK
DSTQUEUEFAMILYINDEX
OFFSET
PNEXT
SIZEThe struct member offsets.static intSIZEOFThe struct size in bytes.static intSRCACCESSMASK
SRCQUEUEFAMILYINDEX
STYPEThe struct member offsets.
-
Constructor Summary
Constructors Constructor Description VkBufferMemoryBarrier(java.nio.ByteBuffer container)Creates aVkBufferMemoryBarrierinstance at the current position of the specifiedByteBuffercontainer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description longbuffer()Returns the value of thebufferfield.VkBufferMemoryBarrierbuffer(long value)Sets the specified value to thebufferfield.static VkBufferMemoryBarriercalloc()Returns a newVkBufferMemoryBarrierinstance allocated withmemCalloc.static VkBufferMemoryBarrier.Buffercalloc(int capacity)Returns a newVkBufferMemoryBarrier.Bufferinstance allocated withmemCalloc.static VkBufferMemoryBarriercallocStack()Returns a newVkBufferMemoryBarrierinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static VkBufferMemoryBarrier.BuffercallocStack(int capacity)Returns a newVkBufferMemoryBarrier.Bufferinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static VkBufferMemoryBarrier.BuffercallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newVkBufferMemoryBarrier.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static VkBufferMemoryBarriercallocStack(org.lwjgl.system.MemoryStack stack)Returns a newVkBufferMemoryBarrierinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static VkBufferMemoryBarriercreate()Returns a newVkBufferMemoryBarrierinstance allocated withBufferUtils.static VkBufferMemoryBarrier.Buffercreate(int capacity)Returns a newVkBufferMemoryBarrier.Bufferinstance allocated withBufferUtils.static VkBufferMemoryBarriercreate(long address)Returns a newVkBufferMemoryBarrierinstance for the specified memory address.static VkBufferMemoryBarrier.Buffercreate(long address, int capacity)Create aVkBufferMemoryBarrier.Bufferinstance at the specified memory.static VkBufferMemoryBarriercreateSafe(long address)static VkBufferMemoryBarrier.BuffercreateSafe(long address, int capacity)intdstAccessMask()Returns the value of thedstAccessMaskfield.VkBufferMemoryBarrierdstAccessMask(int value)Sets the specified value to thedstAccessMaskfield.intdstQueueFamilyIndex()Returns the value of thedstQueueFamilyIndexfield.VkBufferMemoryBarrierdstQueueFamilyIndex(int value)Sets the specified value to thedstQueueFamilyIndexfield.static VkBufferMemoryBarriermalloc()Returns a newVkBufferMemoryBarrierinstance allocated withmemAlloc.static VkBufferMemoryBarrier.Buffermalloc(int capacity)Returns a newVkBufferMemoryBarrier.Bufferinstance allocated withmemAlloc.static VkBufferMemoryBarriermallocStack()Returns a newVkBufferMemoryBarrierinstance allocated on the thread-localMemoryStack.static VkBufferMemoryBarrier.BuffermallocStack(int capacity)Returns a newVkBufferMemoryBarrier.Bufferinstance allocated on the thread-localMemoryStack.static VkBufferMemoryBarrier.BuffermallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newVkBufferMemoryBarrier.Bufferinstance allocated on the specifiedMemoryStack.static VkBufferMemoryBarriermallocStack(org.lwjgl.system.MemoryStack stack)Returns a newVkBufferMemoryBarrierinstance allocated on the specifiedMemoryStack.static longnbuffer(long struct)Unsafe version ofbuffer().static voidnbuffer(long struct, long value)Unsafe version ofbuffer.static intndstAccessMask(long struct)Unsafe version ofdstAccessMask().static voidndstAccessMask(long struct, int value)Unsafe version ofdstAccessMask.static intndstQueueFamilyIndex(long struct)Unsafe version ofdstQueueFamilyIndex().static voidndstQueueFamilyIndex(long struct, int value)Unsafe version ofdstQueueFamilyIndex.static longnoffset(long struct)Unsafe version ofoffset().static voidnoffset(long struct, long value)Unsafe version ofoffset.static longnpNext(long struct)Unsafe version ofpNext().static voidnpNext(long struct, long value)Unsafe version ofpNext.static longnsize(long struct)Unsafe version ofsize().static voidnsize(long struct, long value)Unsafe version ofsize.static intnsrcAccessMask(long struct)Unsafe version ofsrcAccessMask().static voidnsrcAccessMask(long struct, int value)Unsafe version ofsrcAccessMask.static intnsrcQueueFamilyIndex(long struct)Unsafe version ofsrcQueueFamilyIndex().static voidnsrcQueueFamilyIndex(long struct, int value)Unsafe version ofsrcQueueFamilyIndex.static intnsType(long struct)Unsafe version ofsType().static voidnsType(long struct, int value)Unsafe version ofsType.longoffset()Returns the value of theoffsetfield.VkBufferMemoryBarrieroffset(long value)Sets the specified value to theoffsetfield.longpNext()Returns the value of thepNextfield.VkBufferMemoryBarrierpNext(long value)Sets the specified value to thepNextfield.VkBufferMemoryBarrierset(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.VkBufferMemoryBarrierset(VkBufferMemoryBarrier src)Copies the specified struct data to this struct.longsize()Returns the value of thesizefield.VkBufferMemoryBarriersize(long value)Sets the specified value to thesizefield.intsizeof()intsrcAccessMask()Returns the value of thesrcAccessMaskfield.VkBufferMemoryBarriersrcAccessMask(int value)Sets the specified value to thesrcAccessMaskfield.intsrcQueueFamilyIndex()Returns the value of thesrcQueueFamilyIndexfield.VkBufferMemoryBarriersrcQueueFamilyIndex(int value)Sets the specified value to thesrcQueueFamilyIndexfield.intsType()Returns the value of thesTypefield.VkBufferMemoryBarriersType(int value)Sets the specified value to thesTypefield.
-
-
-
Constructor Detail
-
VkBufferMemoryBarrier
public VkBufferMemoryBarrier(java.nio.ByteBuffer container)
Creates aVkBufferMemoryBarrierinstance 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()
- Specified by:
sizeofin classorg.lwjgl.system.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.
-
srcQueueFamilyIndex
public int srcQueueFamilyIndex()
Returns the value of thesrcQueueFamilyIndexfield.
-
dstQueueFamilyIndex
public int dstQueueFamilyIndex()
Returns the value of thedstQueueFamilyIndexfield.
-
buffer
public long buffer()
Returns the value of thebufferfield.
-
offset
public long offset()
Returns the value of theoffsetfield.
-
size
public long size()
Returns the value of thesizefield.
-
sType
public VkBufferMemoryBarrier sType(int value)
Sets the specified value to thesTypefield.
-
pNext
public VkBufferMemoryBarrier pNext(long value)
Sets the specified value to thepNextfield.
-
srcAccessMask
public VkBufferMemoryBarrier srcAccessMask(int value)
Sets the specified value to thesrcAccessMaskfield.
-
dstAccessMask
public VkBufferMemoryBarrier dstAccessMask(int value)
Sets the specified value to thedstAccessMaskfield.
-
srcQueueFamilyIndex
public VkBufferMemoryBarrier srcQueueFamilyIndex(int value)
Sets the specified value to thesrcQueueFamilyIndexfield.
-
dstQueueFamilyIndex
public VkBufferMemoryBarrier dstQueueFamilyIndex(int value)
Sets the specified value to thedstQueueFamilyIndexfield.
-
buffer
public VkBufferMemoryBarrier buffer(long value)
Sets the specified value to thebufferfield.
-
offset
public VkBufferMemoryBarrier offset(long value)
Sets the specified value to theoffsetfield.
-
size
public VkBufferMemoryBarrier size(long value)
Sets the specified value to thesizefield.
-
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.
-
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 newVkBufferMemoryBarrierinstance allocated withmemAlloc. The instance must be explicitly freed.
-
calloc
public static VkBufferMemoryBarrier calloc()
Returns a newVkBufferMemoryBarrierinstance allocated withmemCalloc. The instance must be explicitly freed.
-
create
public static VkBufferMemoryBarrier create()
Returns a newVkBufferMemoryBarrierinstance allocated withBufferUtils.
-
create
public static VkBufferMemoryBarrier create(long address)
Returns a newVkBufferMemoryBarrierinstance for the specified memory address.
-
createSafe
@Nullable public static VkBufferMemoryBarrier createSafe(long address)
-
malloc
public static VkBufferMemoryBarrier.Buffer malloc(int capacity)
Returns a newVkBufferMemoryBarrier.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
public static VkBufferMemoryBarrier.Buffer calloc(int capacity)
Returns a newVkBufferMemoryBarrier.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
public static VkBufferMemoryBarrier.Buffer create(int capacity)
Returns a newVkBufferMemoryBarrier.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
public static VkBufferMemoryBarrier.Buffer create(long address, int capacity)
Create aVkBufferMemoryBarrier.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
@Nullable public static VkBufferMemoryBarrier.Buffer createSafe(long address, int capacity)
-
mallocStack
public static VkBufferMemoryBarrier mallocStack()
Returns a newVkBufferMemoryBarrierinstance allocated on the thread-localMemoryStack.
-
callocStack
public static VkBufferMemoryBarrier callocStack()
Returns a newVkBufferMemoryBarrierinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.
-
mallocStack
public static VkBufferMemoryBarrier mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkBufferMemoryBarrierinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
callocStack
public static VkBufferMemoryBarrier callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkBufferMemoryBarrierinstance allocated on the specifiedMemoryStackand 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.Bufferinstance allocated on the thread-localMemoryStack.- Parameters:
capacity- the buffer capacity
-
callocStack
public static VkBufferMemoryBarrier.Buffer callocStack(int capacity)
Returns a newVkBufferMemoryBarrier.Bufferinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.- Parameters:
capacity- the buffer capacity
-
mallocStack
public static VkBufferMemoryBarrier.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkBufferMemoryBarrier.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
callocStack
public static VkBufferMemoryBarrier.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkBufferMemoryBarrier.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
nsType
public static int nsType(long struct)
Unsafe version ofsType().
-
npNext
public static long npNext(long struct)
Unsafe version ofpNext().
-
nsrcAccessMask
public static int nsrcAccessMask(long struct)
Unsafe version ofsrcAccessMask().
-
ndstAccessMask
public static int ndstAccessMask(long struct)
Unsafe version ofdstAccessMask().
-
nsrcQueueFamilyIndex
public static int nsrcQueueFamilyIndex(long struct)
Unsafe version ofsrcQueueFamilyIndex().
-
ndstQueueFamilyIndex
public static int ndstQueueFamilyIndex(long struct)
Unsafe version ofdstQueueFamilyIndex().
-
nbuffer
public static long nbuffer(long struct)
Unsafe version ofbuffer().
-
noffset
public static long noffset(long struct)
Unsafe version ofoffset().
-
nsize
public static long nsize(long struct)
Unsafe version ofsize().
-
nsType
public static void nsType(long struct, int value)Unsafe version ofsType.
-
npNext
public static void npNext(long struct, long value)Unsafe version ofpNext.
-
nsrcAccessMask
public static void nsrcAccessMask(long struct, int value)Unsafe version ofsrcAccessMask.
-
ndstAccessMask
public static void ndstAccessMask(long struct, int value)Unsafe version ofdstAccessMask.
-
nsrcQueueFamilyIndex
public static void nsrcQueueFamilyIndex(long struct, int value)Unsafe version ofsrcQueueFamilyIndex.
-
ndstQueueFamilyIndex
public static void ndstQueueFamilyIndex(long struct, int value)Unsafe version ofdstQueueFamilyIndex.
-
nbuffer
public static void nbuffer(long struct, long value)Unsafe version ofbuffer.
-
noffset
public static void noffset(long struct, long value)Unsafe version ofoffset.
-
nsize
public static void nsize(long struct, long value)Unsafe version ofsize.
-
-