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.NativeResource
Structure 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
. IfsrcAccessMask
includesACCESS_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
. IfdstAccessMask
includesACCESS_HOST_WRITE_BIT
orACCESS_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
srcQueueFamilyIndex
is not equal todstQueueFamilyIndex
, andsrcQueueFamilyIndex
is 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 ifdstAccessMask
was 0.If
dstQueueFamilyIndex
is not equal tosrcQueueFamilyIndex
, anddstQueueFamilyIndex
is 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 ifsrcAccessMask
was 0.Valid Usage
offset
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
, at least one ofsrcQueueFamilyIndex
anddstQueueFamilyIndex
must beQUEUE_FAMILY_IGNORED
- If
buffer
was created with a sharing mode ofSHARING_MODE_CONCURRENT
, and one ofsrcQueueFamilyIndex
anddstQueueFamilyIndex
isQUEUE_FAMILY_IGNORED
, the other must beQUEUE_FAMILY_IGNORED
or a special queue family reserved for external memory ownership transfers, as described in Queue Family Ownership Transfer. - If
buffer
was created with a sharing mode ofSHARING_MODE_EXCLUSIVE
andsrcQueueFamilyIndex
isQUEUE_FAMILY_IGNORED
,dstQueueFamilyIndex
must also beQUEUE_FAMILY_IGNORED
- If
buffer
was created with a sharing mode ofSHARING_MODE_EXCLUSIVE
andsrcQueueFamilyIndex
is 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
buffer
was created with a sharing mode ofSHARING_MODE_EXCLUSIVE
anddstQueueFamilyIndex
is 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
buffer
was created with a sharing mode ofSHARING_MODE_EXCLUSIVE
, andsrcQueueFamilyIndex
anddstQueueFamilyIndex
are notQUEUE_FAMILY_IGNORED
, at least one of them must be the same as the family of the queue that will execute this barrier - If
buffer
is non-sparse then it must be bound completely and contiguously to a singleVkDeviceMemory
object
Valid Usage (Implicit)
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
handle
See Also
CmdPipelineBarrier
,CmdWaitEvents
Member documentation
sType
– the type of this structure.pNext
–NULL
or a pointer to an extension-specific structure.srcAccessMask
– a bitmask ofVkAccessFlagBits
specifying a source access mask.dstAccessMask
– a bitmask ofVkAccessFlagBits
specifying 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_SIZE
to use the range fromoffset
to 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 class
VkBufferMemoryBarrier.Buffer
An array ofVkBufferMemoryBarrier
structs.
-
Field Summary
Fields Modifier and Type Field Description static int
ALIGNOF
The struct alignment in bytes.static int
BUFFER
DSTACCESSMASK
DSTQUEUEFAMILYINDEX
OFFSET
PNEXT
SIZEThe struct member offsets.static int
SIZEOF
The struct size in bytes.static int
SRCACCESSMASK
SRCQUEUEFAMILYINDEX
STYPEThe struct member offsets.
-
Constructor Summary
Constructors Constructor 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 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, org.lwjgl.system.MemoryStack stack)
Returns a newVkBufferMemoryBarrier.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static VkBufferMemoryBarrier
callocStack(org.lwjgl.system.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.static VkBufferMemoryBarrier.Buffer
create(long address, int capacity)
Create aVkBufferMemoryBarrier.Buffer
instance at the specified memory.static VkBufferMemoryBarrier
createSafe(long address)
static VkBufferMemoryBarrier.Buffer
createSafe(long address, int capacity)
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, org.lwjgl.system.MemoryStack stack)
Returns a newVkBufferMemoryBarrier.Buffer
instance allocated on the specifiedMemoryStack
.static VkBufferMemoryBarrier
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkBufferMemoryBarrier
instance allocated on the specifiedMemoryStack
.static long
nbuffer(long struct)
Unsafe version ofbuffer()
.static void
nbuffer(long struct, long value)
Unsafe version ofbuffer
.static int
ndstAccessMask(long struct)
Unsafe version ofdstAccessMask()
.static void
ndstAccessMask(long struct, int value)
Unsafe version ofdstAccessMask
.static int
ndstQueueFamilyIndex(long struct)
Unsafe version ofdstQueueFamilyIndex()
.static void
ndstQueueFamilyIndex(long struct, int value)
Unsafe version ofdstQueueFamilyIndex
.static long
noffset(long struct)
Unsafe version ofoffset()
.static void
noffset(long struct, long value)
Unsafe version ofoffset
.static long
npNext(long struct)
Unsafe version ofpNext()
.static void
npNext(long struct, long value)
Unsafe version ofpNext
.static long
nsize(long struct)
Unsafe version ofsize()
.static void
nsize(long struct, long value)
Unsafe version ofsize
.static int
nsrcAccessMask(long struct)
Unsafe version ofsrcAccessMask()
.static void
nsrcAccessMask(long struct, int value)
Unsafe version ofsrcAccessMask
.static int
nsrcQueueFamilyIndex(long struct)
Unsafe version ofsrcQueueFamilyIndex()
.static void
nsrcQueueFamilyIndex(long struct, int value)
Unsafe version ofsrcQueueFamilyIndex
.static int
nsType(long struct)
Unsafe version ofsType()
.static void
nsType(long struct, int value)
Unsafe version ofsType
.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()
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.
-
-
-
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()
- Specified by:
sizeof
in classorg.lwjgl.system.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.
-
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.
-
createSafe
@Nullable public static VkBufferMemoryBarrier createSafe(long address)
-
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
-
createSafe
@Nullable public static VkBufferMemoryBarrier.Buffer createSafe(long address, int 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(org.lwjgl.system.MemoryStack stack)
Returns a newVkBufferMemoryBarrier
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
callocStack
public static VkBufferMemoryBarrier callocStack(org.lwjgl.system.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, org.lwjgl.system.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, org.lwjgl.system.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
-
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
.
-
-