Package org.lwjgl.vulkan
Class VkBufferCreateInfo
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.vulkan.VkBufferCreateInfo
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,org.lwjgl.system.NativeResource
,org.lwjgl.system.Pointer
public class VkBufferCreateInfo extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResource
Structure specifying the parameters of a newly created buffer object.Valid Usage
size
must be greater than 0- If
sharingMode
isSHARING_MODE_CONCURRENT
,pQueueFamilyIndices
must be a valid pointer to an array ofqueueFamilyIndexCount
uint32_t
values - If
sharingMode
isSHARING_MODE_CONCURRENT
,queueFamilyIndexCount
must be greater than 1 - If
sharingMode
isSHARING_MODE_CONCURRENT
, each element ofpQueueFamilyIndices
must be unique and must be less thanpQueueFamilyPropertyCount
returned by eitherGetPhysicalDeviceQueueFamilyProperties
orGetPhysicalDeviceQueueFamilyProperties2
for thephysicalDevice
that was used to createdevice
- If the sparse bindings feature is not enabled,
flags
must not containBUFFER_CREATE_SPARSE_BINDING_BIT
- If the sparse buffer residency feature is not enabled,
flags
must not containBUFFER_CREATE_SPARSE_RESIDENCY_BIT
- If the sparse aliased residency feature is not enabled,
flags
must not containBUFFER_CREATE_SPARSE_ALIASED_BIT
- If
flags
containsBUFFER_CREATE_SPARSE_RESIDENCY_BIT
orBUFFER_CREATE_SPARSE_ALIASED_BIT
, it must also containBUFFER_CREATE_SPARSE_BINDING_BIT
- If the
pNext
chain contains an instance ofVkExternalMemoryBufferCreateInfo
, itshandleTypes
member must only contain bits that are also inVkExternalBufferProperties
::externalMemoryProperties
.compatibleHandleTypes, as returned byGetPhysicalDeviceExternalBufferProperties
withpExternalBufferInfo
->handleType
equal to any one of the handle types specified inVkExternalMemoryBufferCreateInfo
::handleTypes
- If the protected memory feature is not enabled,
flags
must not containBUFFER_CREATE_PROTECTED_BIT
- If any of the bits
BUFFER_CREATE_SPARSE_BINDING_BIT
,BUFFER_CREATE_SPARSE_RESIDENCY_BIT
, orBUFFER_CREATE_SPARSE_ALIASED_BIT
are set,BUFFER_CREATE_PROTECTED_BIT
must not also be set - If the
pNext
chain contains an instance ofVkDedicatedAllocationBufferCreateInfoNV
, and thededicatedAllocation
member of the chained structure isTRUE
, thenflags
must not includeBUFFER_CREATE_SPARSE_BINDING_BIT
,BUFFER_CREATE_SPARSE_RESIDENCY_BIT
, orBUFFER_CREATE_SPARSE_ALIASED_BIT
- If
VkBufferDeviceAddressCreateInfoEXT
::deviceAddress
is not zero,flags
must includeBUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT_EXT
- If
flags
includesBUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT_EXT
, the bufferDeviceAddressCaptureReplay feature must be enabled - If
usage
includesBUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT_EXT
, the bufferDeviceAddress feature must be enabled
Valid Usage (Implicit)
sType
must beSTRUCTURE_TYPE_BUFFER_CREATE_INFO
- Each
pNext
member of any structure (including this one) in thepNext
chain must be eitherNULL
or a pointer to a valid instance ofVkBufferDeviceAddressCreateInfoEXT
,VkDedicatedAllocationBufferCreateInfoNV
, orVkExternalMemoryBufferCreateInfo
- Each
sType
member in thepNext
chain must be unique flags
must be a valid combination ofVkBufferCreateFlagBits
valuesusage
must be a valid combination ofVkBufferUsageFlagBits
valuesusage
must not be 0sharingMode
must be a validVkSharingMode
value
See Also
Member documentation
sType
– the type of this structure.pNext
–NULL
or a pointer to an extension-specific structure.flags
– a bitmask ofVkBufferCreateFlagBits
specifying additional parameters of the buffer.size
– the size in bytes of the buffer to be created.usage
– a bitmask ofVkBufferUsageFlagBits
specifying allowed usages of the buffer.sharingMode
– aVkSharingMode
value specifying the sharing mode of the buffer when it will be accessed by multiple queue families.queueFamilyIndexCount
– the number of entries in thepQueueFamilyIndices
array.pQueueFamilyIndices
– a list of queue families that will access this buffer (ignored ifsharingMode
is notSHARING_MODE_CONCURRENT
).
Layout
struct VkBufferCreateInfo { VkStructureType sType; void const * pNext; VkBufferCreateFlags flags; VkDeviceSize size; VkBufferUsageFlags usage; VkSharingMode sharingMode; uint32_t queueFamilyIndexCount; uint32_t const * pQueueFamilyIndices; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
VkBufferCreateInfo.Buffer
An array ofVkBufferCreateInfo
structs.
-
Field Summary
Fields Modifier and Type Field Description static int
ALIGNOF
The struct alignment in bytes.static int
FLAGS
PNEXT
PQUEUEFAMILYINDICES
QUEUEFAMILYINDEXCOUNT
SHARINGMODE
SIZEThe struct member offsets.static int
SIZEOF
The struct size in bytes.static int
STYPE
USAGEThe struct member offsets.
-
Constructor Summary
Constructors Constructor Description VkBufferCreateInfo(java.nio.ByteBuffer container)
Creates aVkBufferCreateInfo
instance at the current position of the specifiedByteBuffer
container.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static VkBufferCreateInfo
calloc()
Returns a newVkBufferCreateInfo
instance allocated withmemCalloc
.static VkBufferCreateInfo.Buffer
calloc(int capacity)
Returns a newVkBufferCreateInfo.Buffer
instance allocated withmemCalloc
.static VkBufferCreateInfo
callocStack()
Returns a newVkBufferCreateInfo
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static VkBufferCreateInfo.Buffer
callocStack(int capacity)
Returns a newVkBufferCreateInfo.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static VkBufferCreateInfo.Buffer
callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkBufferCreateInfo.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static VkBufferCreateInfo
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkBufferCreateInfo
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static VkBufferCreateInfo
create()
Returns a newVkBufferCreateInfo
instance allocated withBufferUtils
.static VkBufferCreateInfo.Buffer
create(int capacity)
Returns a newVkBufferCreateInfo.Buffer
instance allocated withBufferUtils
.static VkBufferCreateInfo
create(long address)
Returns a newVkBufferCreateInfo
instance for the specified memory address.static VkBufferCreateInfo.Buffer
create(long address, int capacity)
Create aVkBufferCreateInfo.Buffer
instance at the specified memory.static VkBufferCreateInfo
createSafe(long address)
static VkBufferCreateInfo.Buffer
createSafe(long address, int capacity)
int
flags()
Returns the value of theflags
field.VkBufferCreateInfo
flags(int value)
Sets the specified value to theflags
field.static VkBufferCreateInfo
malloc()
Returns a newVkBufferCreateInfo
instance allocated withmemAlloc
.static VkBufferCreateInfo.Buffer
malloc(int capacity)
Returns a newVkBufferCreateInfo.Buffer
instance allocated withmemAlloc
.static VkBufferCreateInfo
mallocStack()
Returns a newVkBufferCreateInfo
instance allocated on the thread-localMemoryStack
.static VkBufferCreateInfo.Buffer
mallocStack(int capacity)
Returns a newVkBufferCreateInfo.Buffer
instance allocated on the thread-localMemoryStack
.static VkBufferCreateInfo.Buffer
mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkBufferCreateInfo.Buffer
instance allocated on the specifiedMemoryStack
.static VkBufferCreateInfo
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkBufferCreateInfo
instance allocated on the specifiedMemoryStack
.static int
nflags(long struct)
Unsafe version offlags()
.static void
nflags(long struct, int value)
Unsafe version offlags
.static long
npNext(long struct)
Unsafe version ofpNext()
.static void
npNext(long struct, long value)
Unsafe version ofpNext
.static java.nio.IntBuffer
npQueueFamilyIndices(long struct)
Unsafe version ofpQueueFamilyIndices
.static void
npQueueFamilyIndices(long struct, java.nio.IntBuffer value)
Unsafe version ofpQueueFamilyIndices
.static int
nqueueFamilyIndexCount(long struct)
Unsafe version ofqueueFamilyIndexCount()
.static void
nqueueFamilyIndexCount(long struct, int value)
Sets the specified value to thequeueFamilyIndexCount
field of the specifiedstruct
.static int
nsharingMode(long struct)
Unsafe version ofsharingMode()
.static void
nsharingMode(long struct, int value)
Unsafe version ofsharingMode
.static long
nsize(long struct)
Unsafe version ofsize()
.static void
nsize(long struct, long value)
Unsafe version ofsize
.static int
nsType(long struct)
Unsafe version ofsType()
.static void
nsType(long struct, int value)
Unsafe version ofsType
.static int
nusage(long struct)
Unsafe version ofusage()
.static void
nusage(long struct, int value)
Unsafe version ofusage
.long
pNext()
Returns the value of thepNext
field.VkBufferCreateInfo
pNext(long value)
Sets the specified value to thepNext
field.java.nio.IntBuffer
pQueueFamilyIndices()
Returns aIntBuffer
view of the data pointed to by thepQueueFamilyIndices
field.VkBufferCreateInfo
pQueueFamilyIndices(java.nio.IntBuffer value)
Sets the address of the specifiedIntBuffer
to thepQueueFamilyIndices
field.int
queueFamilyIndexCount()
Returns the value of thequeueFamilyIndexCount
field.VkBufferCreateInfo
set(int sType, long pNext, int flags, long size, int usage, int sharingMode, java.nio.IntBuffer pQueueFamilyIndices)
Initializes this struct with the specified values.VkBufferCreateInfo
set(VkBufferCreateInfo src)
Copies the specified struct data to this struct.int
sharingMode()
Returns the value of thesharingMode
field.VkBufferCreateInfo
sharingMode(int value)
Sets the specified value to thesharingMode
field.long
size()
Returns the value of thesize
field.VkBufferCreateInfo
size(long value)
Sets the specified value to thesize
field.int
sizeof()
int
sType()
Returns the value of thesType
field.VkBufferCreateInfo
sType(int value)
Sets the specified value to thesType
field.int
usage()
Returns the value of theusage
field.VkBufferCreateInfo
usage(int value)
Sets the specified value to theusage
field.static void
validate(long struct)
Validates pointer members that should not beNULL
.static void
validate(long array, int count)
Callsvalidate(long)
for each struct contained in the specified struct array.
-
-
-
Constructor Detail
-
VkBufferCreateInfo
public VkBufferCreateInfo(java.nio.ByteBuffer container)
Creates aVkBufferCreateInfo
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.
-
flags
public int flags()
Returns the value of theflags
field.
-
size
public long size()
Returns the value of thesize
field.
-
usage
public int usage()
Returns the value of theusage
field.
-
sharingMode
public int sharingMode()
Returns the value of thesharingMode
field.
-
queueFamilyIndexCount
public int queueFamilyIndexCount()
Returns the value of thequeueFamilyIndexCount
field.
-
pQueueFamilyIndices
@Nullable public java.nio.IntBuffer pQueueFamilyIndices()
Returns aIntBuffer
view of the data pointed to by thepQueueFamilyIndices
field.
-
sType
public VkBufferCreateInfo sType(int value)
Sets the specified value to thesType
field.
-
pNext
public VkBufferCreateInfo pNext(long value)
Sets the specified value to thepNext
field.
-
flags
public VkBufferCreateInfo flags(int value)
Sets the specified value to theflags
field.
-
size
public VkBufferCreateInfo size(long value)
Sets the specified value to thesize
field.
-
usage
public VkBufferCreateInfo usage(int value)
Sets the specified value to theusage
field.
-
sharingMode
public VkBufferCreateInfo sharingMode(int value)
Sets the specified value to thesharingMode
field.
-
pQueueFamilyIndices
public VkBufferCreateInfo pQueueFamilyIndices(@Nullable java.nio.IntBuffer value)
Sets the address of the specifiedIntBuffer
to thepQueueFamilyIndices
field.
-
set
public VkBufferCreateInfo set(int sType, long pNext, int flags, long size, int usage, int sharingMode, @Nullable java.nio.IntBuffer pQueueFamilyIndices)
Initializes this struct with the specified values.
-
set
public VkBufferCreateInfo set(VkBufferCreateInfo src)
Copies the specified struct data to this struct.- Parameters:
src
- the source struct- Returns:
- this struct
-
malloc
public static VkBufferCreateInfo malloc()
Returns a newVkBufferCreateInfo
instance allocated withmemAlloc
. The instance must be explicitly freed.
-
calloc
public static VkBufferCreateInfo calloc()
Returns a newVkBufferCreateInfo
instance allocated withmemCalloc
. The instance must be explicitly freed.
-
create
public static VkBufferCreateInfo create()
Returns a newVkBufferCreateInfo
instance allocated withBufferUtils
.
-
create
public static VkBufferCreateInfo create(long address)
Returns a newVkBufferCreateInfo
instance for the specified memory address.
-
createSafe
@Nullable public static VkBufferCreateInfo createSafe(long address)
-
malloc
public static VkBufferCreateInfo.Buffer malloc(int capacity)
Returns a newVkBufferCreateInfo.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
public static VkBufferCreateInfo.Buffer calloc(int capacity)
Returns a newVkBufferCreateInfo.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
public static VkBufferCreateInfo.Buffer create(int capacity)
Returns a newVkBufferCreateInfo.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
public static VkBufferCreateInfo.Buffer create(long address, int capacity)
Create aVkBufferCreateInfo.Buffer
instance at the specified memory.- Parameters:
address
- the memory addresscapacity
- the buffer capacity
-
createSafe
@Nullable public static VkBufferCreateInfo.Buffer createSafe(long address, int capacity)
-
mallocStack
public static VkBufferCreateInfo mallocStack()
Returns a newVkBufferCreateInfo
instance allocated on the thread-localMemoryStack
.
-
callocStack
public static VkBufferCreateInfo callocStack()
Returns a newVkBufferCreateInfo
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.
-
mallocStack
public static VkBufferCreateInfo mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkBufferCreateInfo
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
callocStack
public static VkBufferCreateInfo callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkBufferCreateInfo
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocate
-
mallocStack
public static VkBufferCreateInfo.Buffer mallocStack(int capacity)
Returns a newVkBufferCreateInfo.Buffer
instance allocated on the thread-localMemoryStack
.- Parameters:
capacity
- the buffer capacity
-
callocStack
public static VkBufferCreateInfo.Buffer callocStack(int capacity)
Returns a newVkBufferCreateInfo.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.- Parameters:
capacity
- the buffer capacity
-
mallocStack
public static VkBufferCreateInfo.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkBufferCreateInfo.Buffer
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
callocStack
public static VkBufferCreateInfo.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkBufferCreateInfo.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()
.
-
nflags
public static int nflags(long struct)
Unsafe version offlags()
.
-
nsize
public static long nsize(long struct)
Unsafe version ofsize()
.
-
nusage
public static int nusage(long struct)
Unsafe version ofusage()
.
-
nsharingMode
public static int nsharingMode(long struct)
Unsafe version ofsharingMode()
.
-
nqueueFamilyIndexCount
public static int nqueueFamilyIndexCount(long struct)
Unsafe version ofqueueFamilyIndexCount()
.
-
npQueueFamilyIndices
@Nullable public static java.nio.IntBuffer npQueueFamilyIndices(long struct)
Unsafe version ofpQueueFamilyIndices
.
-
nsType
public static void nsType(long struct, int value)
Unsafe version ofsType
.
-
npNext
public static void npNext(long struct, long value)
Unsafe version ofpNext
.
-
nflags
public static void nflags(long struct, int value)
Unsafe version offlags
.
-
nsize
public static void nsize(long struct, long value)
Unsafe version ofsize
.
-
nusage
public static void nusage(long struct, int value)
Unsafe version ofusage
.
-
nsharingMode
public static void nsharingMode(long struct, int value)
Unsafe version ofsharingMode
.
-
nqueueFamilyIndexCount
public static void nqueueFamilyIndexCount(long struct, int value)
Sets the specified value to thequeueFamilyIndexCount
field of the specifiedstruct
.
-
npQueueFamilyIndices
public static void npQueueFamilyIndices(long struct, @Nullable java.nio.IntBuffer value)
Unsafe version ofpQueueFamilyIndices
.
-
validate
public static void validate(long struct)
Validates pointer members that should not beNULL
.- Parameters:
struct
- the struct to validate
-
validate
public static void validate(long array, int count)
Callsvalidate(long)
for each struct contained in the specified struct array.- Parameters:
array
- the struct array to validatecount
- the number of structs inarray
-
-