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.NativeResourceStructure specifying the parameters of a newly created buffer object.Valid Usage
sizemust be greater than 0- If
sharingModeisSHARING_MODE_CONCURRENT,pQueueFamilyIndicesmust be a valid pointer to an array ofqueueFamilyIndexCountuint32_tvalues - If
sharingModeisSHARING_MODE_CONCURRENT,queueFamilyIndexCountmust be greater than 1 - If
sharingModeisSHARING_MODE_CONCURRENT, each element ofpQueueFamilyIndicesmust be unique and must be less thanpQueueFamilyPropertyCountreturned by eitherGetPhysicalDeviceQueueFamilyPropertiesorGetPhysicalDeviceQueueFamilyProperties2for thephysicalDevicethat was used to createdevice - If the sparse bindings feature is not enabled,
flagsmust not containBUFFER_CREATE_SPARSE_BINDING_BIT - If the sparse buffer residency feature is not enabled,
flagsmust not containBUFFER_CREATE_SPARSE_RESIDENCY_BIT - If the sparse aliased residency feature is not enabled,
flagsmust not containBUFFER_CREATE_SPARSE_ALIASED_BIT - If
flagscontainsBUFFER_CREATE_SPARSE_RESIDENCY_BITorBUFFER_CREATE_SPARSE_ALIASED_BIT, it must also containBUFFER_CREATE_SPARSE_BINDING_BIT - If the
pNextchain contains an instance ofVkExternalMemoryBufferCreateInfo, itshandleTypesmember must only contain bits that are also inVkExternalBufferProperties::externalMemoryProperties.compatibleHandleTypes, as returned byGetPhysicalDeviceExternalBufferPropertieswithpExternalBufferInfo->handleTypeequal to any one of the handle types specified inVkExternalMemoryBufferCreateInfo::handleTypes - If the protected memory feature is not enabled,
flagsmust not containBUFFER_CREATE_PROTECTED_BIT - If any of the bits
BUFFER_CREATE_SPARSE_BINDING_BIT,BUFFER_CREATE_SPARSE_RESIDENCY_BIT, orBUFFER_CREATE_SPARSE_ALIASED_BITare set,BUFFER_CREATE_PROTECTED_BITmust not also be set - If the
pNextchain contains an instance ofVkDedicatedAllocationBufferCreateInfoNV, and thededicatedAllocationmember of the chained structure isTRUE, thenflagsmust not includeBUFFER_CREATE_SPARSE_BINDING_BIT,BUFFER_CREATE_SPARSE_RESIDENCY_BIT, orBUFFER_CREATE_SPARSE_ALIASED_BIT - If
VkBufferDeviceAddressCreateInfoEXT::deviceAddressis not zero,flagsmust includeBUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT_EXT - If
flagsincludesBUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT_EXT, the bufferDeviceAddressCaptureReplay feature must be enabled - If
usageincludesBUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT_EXT, the bufferDeviceAddress feature must be enabled
Valid Usage (Implicit)
sTypemust beSTRUCTURE_TYPE_BUFFER_CREATE_INFO- Each
pNextmember of any structure (including this one) in thepNextchain must be eitherNULLor a pointer to a valid instance ofVkBufferDeviceAddressCreateInfoEXT,VkDedicatedAllocationBufferCreateInfoNV, orVkExternalMemoryBufferCreateInfo - Each
sTypemember in thepNextchain must be unique flagsmust be a valid combination ofVkBufferCreateFlagBitsvaluesusagemust be a valid combination ofVkBufferUsageFlagBitsvaluesusagemust not be 0sharingModemust be a validVkSharingModevalue
See Also
Member documentation
sType– the type of this structure.pNext–NULLor a pointer to an extension-specific structure.flags– a bitmask ofVkBufferCreateFlagBitsspecifying additional parameters of the buffer.size– the size in bytes of the buffer to be created.usage– a bitmask ofVkBufferUsageFlagBitsspecifying allowed usages of the buffer.sharingMode– aVkSharingModevalue specifying the sharing mode of the buffer when it will be accessed by multiple queue families.queueFamilyIndexCount– the number of entries in thepQueueFamilyIndicesarray.pQueueFamilyIndices– a list of queue families that will access this buffer (ignored ifsharingModeis 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 classVkBufferCreateInfo.BufferAn array ofVkBufferCreateInfostructs.
-
Field Summary
Fields Modifier and Type Field Description static intALIGNOFThe struct alignment in bytes.static intFLAGS
PNEXT
PQUEUEFAMILYINDICES
QUEUEFAMILYINDEXCOUNT
SHARINGMODE
SIZEThe struct member offsets.static intSIZEOFThe struct size in bytes.static intSTYPE
USAGEThe struct member offsets.
-
Constructor Summary
Constructors Constructor Description VkBufferCreateInfo(java.nio.ByteBuffer container)Creates aVkBufferCreateInfoinstance at the current position of the specifiedByteBuffercontainer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static VkBufferCreateInfocalloc()Returns a newVkBufferCreateInfoinstance allocated withmemCalloc.static VkBufferCreateInfo.Buffercalloc(int capacity)Returns a newVkBufferCreateInfo.Bufferinstance allocated withmemCalloc.static VkBufferCreateInfocallocStack()Returns a newVkBufferCreateInfoinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static VkBufferCreateInfo.BuffercallocStack(int capacity)Returns a newVkBufferCreateInfo.Bufferinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static VkBufferCreateInfo.BuffercallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newVkBufferCreateInfo.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static VkBufferCreateInfocallocStack(org.lwjgl.system.MemoryStack stack)Returns a newVkBufferCreateInfoinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static VkBufferCreateInfocreate()Returns a newVkBufferCreateInfoinstance allocated withBufferUtils.static VkBufferCreateInfo.Buffercreate(int capacity)Returns a newVkBufferCreateInfo.Bufferinstance allocated withBufferUtils.static VkBufferCreateInfocreate(long address)Returns a newVkBufferCreateInfoinstance for the specified memory address.static VkBufferCreateInfo.Buffercreate(long address, int capacity)Create aVkBufferCreateInfo.Bufferinstance at the specified memory.static VkBufferCreateInfocreateSafe(long address)static VkBufferCreateInfo.BuffercreateSafe(long address, int capacity)intflags()Returns the value of theflagsfield.VkBufferCreateInfoflags(int value)Sets the specified value to theflagsfield.static VkBufferCreateInfomalloc()Returns a newVkBufferCreateInfoinstance allocated withmemAlloc.static VkBufferCreateInfo.Buffermalloc(int capacity)Returns a newVkBufferCreateInfo.Bufferinstance allocated withmemAlloc.static VkBufferCreateInfomallocStack()Returns a newVkBufferCreateInfoinstance allocated on the thread-localMemoryStack.static VkBufferCreateInfo.BuffermallocStack(int capacity)Returns a newVkBufferCreateInfo.Bufferinstance allocated on the thread-localMemoryStack.static VkBufferCreateInfo.BuffermallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newVkBufferCreateInfo.Bufferinstance allocated on the specifiedMemoryStack.static VkBufferCreateInfomallocStack(org.lwjgl.system.MemoryStack stack)Returns a newVkBufferCreateInfoinstance allocated on the specifiedMemoryStack.static intnflags(long struct)Unsafe version offlags().static voidnflags(long struct, int value)Unsafe version offlags.static longnpNext(long struct)Unsafe version ofpNext().static voidnpNext(long struct, long value)Unsafe version ofpNext.static java.nio.IntBuffernpQueueFamilyIndices(long struct)Unsafe version ofpQueueFamilyIndices.static voidnpQueueFamilyIndices(long struct, java.nio.IntBuffer value)Unsafe version ofpQueueFamilyIndices.static intnqueueFamilyIndexCount(long struct)Unsafe version ofqueueFamilyIndexCount().static voidnqueueFamilyIndexCount(long struct, int value)Sets the specified value to thequeueFamilyIndexCountfield of the specifiedstruct.static intnsharingMode(long struct)Unsafe version ofsharingMode().static voidnsharingMode(long struct, int value)Unsafe version ofsharingMode.static longnsize(long struct)Unsafe version ofsize().static voidnsize(long struct, long value)Unsafe version ofsize.static intnsType(long struct)Unsafe version ofsType().static voidnsType(long struct, int value)Unsafe version ofsType.static intnusage(long struct)Unsafe version ofusage().static voidnusage(long struct, int value)Unsafe version ofusage.longpNext()Returns the value of thepNextfield.VkBufferCreateInfopNext(long value)Sets the specified value to thepNextfield.java.nio.IntBufferpQueueFamilyIndices()Returns aIntBufferview of the data pointed to by thepQueueFamilyIndicesfield.VkBufferCreateInfopQueueFamilyIndices(java.nio.IntBuffer value)Sets the address of the specifiedIntBufferto thepQueueFamilyIndicesfield.intqueueFamilyIndexCount()Returns the value of thequeueFamilyIndexCountfield.VkBufferCreateInfoset(int sType, long pNext, int flags, long size, int usage, int sharingMode, java.nio.IntBuffer pQueueFamilyIndices)Initializes this struct with the specified values.VkBufferCreateInfoset(VkBufferCreateInfo src)Copies the specified struct data to this struct.intsharingMode()Returns the value of thesharingModefield.VkBufferCreateInfosharingMode(int value)Sets the specified value to thesharingModefield.longsize()Returns the value of thesizefield.VkBufferCreateInfosize(long value)Sets the specified value to thesizefield.intsizeof()intsType()Returns the value of thesTypefield.VkBufferCreateInfosType(int value)Sets the specified value to thesTypefield.intusage()Returns the value of theusagefield.VkBufferCreateInfousage(int value)Sets the specified value to theusagefield.static voidvalidate(long struct)Validates pointer members that should not beNULL.static voidvalidate(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 aVkBufferCreateInfoinstance 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.
-
flags
public int flags()
Returns the value of theflagsfield.
-
size
public long size()
Returns the value of thesizefield.
-
usage
public int usage()
Returns the value of theusagefield.
-
sharingMode
public int sharingMode()
Returns the value of thesharingModefield.
-
queueFamilyIndexCount
public int queueFamilyIndexCount()
Returns the value of thequeueFamilyIndexCountfield.
-
pQueueFamilyIndices
@Nullable public java.nio.IntBuffer pQueueFamilyIndices()
Returns aIntBufferview of the data pointed to by thepQueueFamilyIndicesfield.
-
sType
public VkBufferCreateInfo sType(int value)
Sets the specified value to thesTypefield.
-
pNext
public VkBufferCreateInfo pNext(long value)
Sets the specified value to thepNextfield.
-
flags
public VkBufferCreateInfo flags(int value)
Sets the specified value to theflagsfield.
-
size
public VkBufferCreateInfo size(long value)
Sets the specified value to thesizefield.
-
usage
public VkBufferCreateInfo usage(int value)
Sets the specified value to theusagefield.
-
sharingMode
public VkBufferCreateInfo sharingMode(int value)
Sets the specified value to thesharingModefield.
-
pQueueFamilyIndices
public VkBufferCreateInfo pQueueFamilyIndices(@Nullable java.nio.IntBuffer value)
Sets the address of the specifiedIntBufferto thepQueueFamilyIndicesfield.
-
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 newVkBufferCreateInfoinstance allocated withmemAlloc. The instance must be explicitly freed.
-
calloc
public static VkBufferCreateInfo calloc()
Returns a newVkBufferCreateInfoinstance allocated withmemCalloc. The instance must be explicitly freed.
-
create
public static VkBufferCreateInfo create()
Returns a newVkBufferCreateInfoinstance allocated withBufferUtils.
-
create
public static VkBufferCreateInfo create(long address)
Returns a newVkBufferCreateInfoinstance for the specified memory address.
-
createSafe
@Nullable public static VkBufferCreateInfo createSafe(long address)
-
malloc
public static VkBufferCreateInfo.Buffer malloc(int capacity)
Returns a newVkBufferCreateInfo.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
public static VkBufferCreateInfo.Buffer calloc(int capacity)
Returns a newVkBufferCreateInfo.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
public static VkBufferCreateInfo.Buffer create(int capacity)
Returns a newVkBufferCreateInfo.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
public static VkBufferCreateInfo.Buffer create(long address, int capacity)
Create aVkBufferCreateInfo.Bufferinstance 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 newVkBufferCreateInfoinstance allocated on the thread-localMemoryStack.
-
callocStack
public static VkBufferCreateInfo callocStack()
Returns a newVkBufferCreateInfoinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.
-
mallocStack
public static VkBufferCreateInfo mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkBufferCreateInfoinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
callocStack
public static VkBufferCreateInfo callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkBufferCreateInfoinstance allocated on the specifiedMemoryStackand 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.Bufferinstance allocated on the thread-localMemoryStack.- Parameters:
capacity- the buffer capacity
-
callocStack
public static VkBufferCreateInfo.Buffer callocStack(int capacity)
Returns a newVkBufferCreateInfo.Bufferinstance allocated on the thread-localMemoryStackand 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.Bufferinstance 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.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().
-
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 thequeueFamilyIndexCountfield 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
-
-