Package org.lwjgl.vulkan
Class VkBufferViewCreateInfo
java.lang.Object
org.lwjgl.system.Pointer.Default
org.lwjgl.system.Struct<VkBufferViewCreateInfo>
org.lwjgl.vulkan.VkBufferViewCreateInfo
- All Implemented Interfaces:
AutoCloseable,org.lwjgl.system.NativeResource,org.lwjgl.system.Pointer
public class VkBufferViewCreateInfo
extends org.lwjgl.system.Struct<VkBufferViewCreateInfo>
implements org.lwjgl.system.NativeResource
Structure specifying parameters of a newly created buffer view.
Description
The buffer view has a buffer view usage identifying which descriptor types can be created from it. This usage can be defined by including the VkBufferUsageFlags2CreateInfo structure in the pNext chain, and specifying the usage value there. If this structure is not included, it is equal to the VkBufferCreateInfo::usage value used to create buffer.
Valid Usage
offsetmust be less than the size ofbuffer- If
rangeis not equal toWHOLE_SIZE,rangemust be greater than 0 - If
rangeis not equal toWHOLE_SIZE,rangemust be an integer multiple of the texel block size offormat - If
rangeis not equal toWHOLE_SIZE, the number of texel buffer elements given by(⌊range / (texel block size)⌋ × (texels per block))where texel block size and texels per block are as defined in the Compatible Formats table forformat, must be less than or equal toVkPhysicalDeviceLimits::maxTexelBufferElements - If
rangeis not equal toWHOLE_SIZE, the sum ofoffsetandrangemust be less than or equal to the size ofbuffer - If
rangeis equal toWHOLE_SIZE, the number of texel buffer elements given by(⌊(size - offset) / (texel block size)⌋ × (texels per block))where size is the size ofbuffer, and texel block size and texels per block are as defined in the Compatible Formats table forformat, must be less than or equal toVkPhysicalDeviceLimits::maxTexelBufferElements buffermust have been created with ausagevalue containing at least one ofBUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BITorBUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT- If the buffer view usage contains
BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT, then format features offormatmust containFORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT - If the buffer view usage contains
BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT, then format features offormatmust containFORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT - If
bufferis non-sparse then it must be bound completely and contiguously to a singleVkDeviceMemoryobject - If the
texelBufferAlignmentfeature is not enabled,offsetmust be a multiple ofVkPhysicalDeviceLimits::minTexelBufferOffsetAlignment - If the
texelBufferAlignmentfeature is enabled and ifbufferwas created withusagecontainingBUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT,offsetmust be a multiple of the lesser ofVkPhysicalDeviceTexelBufferAlignmentProperties::storageTexelBufferOffsetAlignmentBytesor, ifVkPhysicalDeviceTexelBufferAlignmentProperties::storageTexelBufferOffsetSingleTexelAlignmentisTRUE, the size of a texel of the requestedformat. If the size of a texel is a multiple of three bytes, then the size of a single component offormatis used instead - If the
texelBufferAlignmentfeature is enabled and ifbufferwas created withusagecontainingBUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT,offsetmust be a multiple of the lesser ofVkPhysicalDeviceTexelBufferAlignmentProperties::uniformTexelBufferOffsetAlignmentBytesor, ifVkPhysicalDeviceTexelBufferAlignmentProperties::uniformTexelBufferOffsetSingleTexelAlignmentisTRUE, the size of a texel of the requestedformat. If the size of a texel is a multiple of three bytes, then the size of a single component offormatis used instead - If the
pNextchain includes aVkExportMetalObjectCreateInfoEXTstructure, itsexportObjectTypemember must beEXPORT_METAL_OBJECT_TYPE_METAL_TEXTURE_BIT_EXT - If the
pNextchain includes aVkBufferUsageFlags2CreateInfo, itsusagemust not contain any other bit thanBUFFER_USAGE_2_UNIFORM_TEXEL_BUFFER_BITorBUFFER_USAGE_2_STORAGE_TEXEL_BUFFER_BIT - If the
pNextchain includes aVkBufferUsageFlags2CreateInfo, itsusagemust be a subset of theVkBufferCreateInfo::usagespecified orVkBufferUsageFlags2CreateInfo::usagefromVkBufferCreateInfo::pNextwhen creatingbuffer
Valid Usage (Implicit)
sTypemust beSTRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO- Each
pNextmember of any structure (including this one) in thepNextchain must be eitherNULLor a pointer to a valid instance ofVkBufferUsageFlags2CreateInfoorVkExportMetalObjectCreateInfoEXT - The
sTypevalue of each struct in thepNextchain must be unique, with the exception of structures of typeVkExportMetalObjectCreateInfoEXT flagsmust be 0buffermust be a validVkBufferhandleformatmust be a validVkFormatvalue
See Also
Layout
struct VkBufferViewCreateInfo {
VkStructureType sType();
void const * pNext();
VkBufferViewCreateFlags flags();
VkBuffer buffer();
VkFormat format();
VkDeviceSize offset();
VkDeviceSize range();
}-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.lwjgl.system.Struct
org.lwjgl.system.Struct.StructValidationNested classes/interfaces inherited from interface org.lwjgl.system.Pointer
org.lwjgl.system.Pointer.Default -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe struct alignment in bytes.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct size in bytes.static final intThe struct member offsets.Fields inherited from interface org.lwjgl.system.Pointer
BITS32, BITS64, CLONG_SHIFT, CLONG_SIZE, POINTER_SHIFT, POINTER_SIZE -
Constructor Summary
ConstructorsConstructorDescriptionVkBufferViewCreateInfo(ByteBuffer container) Creates aVkBufferViewCreateInfoinstance at the current position of the specifiedByteBuffercontainer. -
Method Summary
Modifier and TypeMethodDescriptionlongbuffer()aVkBufferon which the view will be created.buffer(long value) Sets the specified value to thebuffer()field.static VkBufferViewCreateInfocalloc()Returns a newVkBufferViewCreateInfoinstance allocated withmemCalloc.calloc(int capacity) Returns a newVkBufferViewCreateInfo.Bufferinstance allocated withmemCalloc.calloc(int capacity, org.lwjgl.system.MemoryStack stack) Returns a newVkBufferViewCreateInfo.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static VkBufferViewCreateInfocalloc(org.lwjgl.system.MemoryStack stack) Returns a newVkBufferViewCreateInfoinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static VkBufferViewCreateInfoDeprecated.callocStack(int capacity) Deprecated.callocStack(int capacity, org.lwjgl.system.MemoryStack stack) Deprecated.static VkBufferViewCreateInfocallocStack(org.lwjgl.system.MemoryStack stack) Deprecated.static VkBufferViewCreateInfocreate()Returns a newVkBufferViewCreateInfoinstance allocated withBufferUtils.create(int capacity) Returns a newVkBufferViewCreateInfo.Bufferinstance allocated withBufferUtils.static VkBufferViewCreateInfocreate(long address) Returns a newVkBufferViewCreateInfoinstance for the specified memory address.create(long address, int capacity) Create aVkBufferViewCreateInfo.Bufferinstance at the specified memory.static @Nullable VkBufferViewCreateInfocreateSafe(long address) static @Nullable VkBufferViewCreateInfo.BuffercreateSafe(long address, int capacity) intflags()reserved for future use.flags(int value) Sets the specified value to theflags()field.intformat()aVkFormatdescribing the format of the data elements in the buffer.format(int value) Sets the specified value to theformat()field.static VkBufferViewCreateInfomalloc()Returns a newVkBufferViewCreateInfoinstance allocated withmemAlloc.malloc(int capacity) Returns a newVkBufferViewCreateInfo.Bufferinstance allocated withmemAlloc.malloc(int capacity, org.lwjgl.system.MemoryStack stack) Returns a newVkBufferViewCreateInfo.Bufferinstance allocated on the specifiedMemoryStack.static VkBufferViewCreateInfomalloc(org.lwjgl.system.MemoryStack stack) Returns a newVkBufferViewCreateInfoinstance allocated on the specifiedMemoryStack.static VkBufferViewCreateInfoDeprecated.mallocStack(int capacity) Deprecated.mallocStack(int capacity, org.lwjgl.system.MemoryStack stack) Deprecated.static VkBufferViewCreateInfomallocStack(org.lwjgl.system.MemoryStack stack) Deprecated.static longnbuffer(long struct) Unsafe version ofbuffer().static voidnbuffer(long struct, long value) Unsafe version ofbuffer.static intnflags(long struct) Unsafe version offlags().static voidnflags(long struct, int value) Unsafe version offlags.static intnformat(long struct) Unsafe version offormat().static voidnformat(long struct, int value) Unsafe version offormat.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 longnrange(long struct) Unsafe version ofrange().static voidnrange(long struct, long value) Unsafe version ofrange.static intnsType(long struct) Unsafe version ofsType().static voidnsType(long struct, int value) Unsafe version ofsType.longoffset()an offset in bytes from the base address of the buffer.offset(long value) Sets the specified value to theoffset()field.longpNext()NULLor a pointer to a structure extending this structure.pNext(long value) Sets the specified value to thepNext()field.Prepends the specifiedVkBufferUsageFlags2CreateInfovalue to thepNextchain.Prepends the specifiedVkBufferUsageFlags2CreateInfoKHRvalue to thepNextchain.Prepends the specifiedVkExportMetalObjectCreateInfoEXTvalue to thepNextchain.longrange()a size in bytes of the buffer view.range(long value) Sets the specified value to therange()field.set(int sType, long pNext, int flags, long buffer, int format, long offset, long range) Initializes this struct with the specified values.Copies the specified struct data to this struct.intsizeof()intsType()aVkStructureTypevalue identifying this structure.sType(int value) Sets the specified value to thesType()field.Sets theSTRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFOvalue to thesType()field.Methods inherited from class org.lwjgl.system.Struct
clear, free, isNull, validate, validateMethods inherited from class org.lwjgl.system.Pointer.Default
address, equals, hashCode, toStringMethods inherited from interface org.lwjgl.system.NativeResource
close, free
-
Field Details
-
SIZEOF
public static final int SIZEOFThe struct size in bytes. -
ALIGNOF
public static final int ALIGNOFThe struct alignment in bytes. -
STYPE
public static final int STYPEThe struct member offsets. -
PNEXT
public static final int PNEXTThe struct member offsets. -
FLAGS
public static final int FLAGSThe struct member offsets. -
BUFFER
public static final int BUFFERThe struct member offsets. -
FORMAT
public static final int FORMATThe struct member offsets. -
OFFSET
public static final int OFFSETThe struct member offsets. -
RANGE
public static final int RANGEThe struct member offsets.
-
-
Constructor Details
-
VkBufferViewCreateInfo
Creates aVkBufferViewCreateInfoinstance 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 Details
-
sizeof
public int sizeof()- Specified by:
sizeofin classorg.lwjgl.system.Struct<VkBufferViewCreateInfo>
-
sType
public int sType()aVkStructureTypevalue identifying this structure. -
pNext
public long pNext()NULLor a pointer to a structure extending this structure. -
flags
public int flags()reserved for future use. -
buffer
public long buffer()aVkBufferon which the view will be created. -
format
public int format()aVkFormatdescribing the format of the data elements in the buffer. -
offset
public long offset()an offset in bytes from the base address of the buffer. Accesses to the buffer view from shaders use addressing that is relative to this starting offset. -
range
public long range()a size in bytes of the buffer view. Ifrangeis equal toWHOLE_SIZE, the range fromoffsetto the end of the buffer is used. IfWHOLE_SIZEis used and the remaining size of the buffer is not a multiple of the texel block size offormat, the nearest smaller multiple is used. -
sType
Sets the specified value to thesType()field. -
sType$Default
Sets theSTRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFOvalue to thesType()field. -
pNext
Sets the specified value to thepNext()field. -
pNext
Prepends the specifiedVkBufferUsageFlags2CreateInfovalue to thepNextchain. -
pNext
Prepends the specifiedVkBufferUsageFlags2CreateInfoKHRvalue to thepNextchain. -
pNext
Prepends the specifiedVkExportMetalObjectCreateInfoEXTvalue to thepNextchain. -
flags
Sets the specified value to theflags()field. -
buffer
Sets the specified value to thebuffer()field. -
format
Sets the specified value to theformat()field. -
offset
Sets the specified value to theoffset()field. -
range
Sets the specified value to therange()field. -
set
public VkBufferViewCreateInfo set(int sType, long pNext, int flags, long buffer, int format, long offset, long range) Initializes this struct with the specified values. -
set
Copies the specified struct data to this struct.- Parameters:
src- the source struct- Returns:
- this struct
-
malloc
Returns a newVkBufferViewCreateInfoinstance allocated withmemAlloc. The instance must be explicitly freed. -
calloc
Returns a newVkBufferViewCreateInfoinstance allocated withmemCalloc. The instance must be explicitly freed. -
create
Returns a newVkBufferViewCreateInfoinstance allocated withBufferUtils. -
create
Returns a newVkBufferViewCreateInfoinstance for the specified memory address. -
createSafe
-
malloc
Returns a newVkBufferViewCreateInfo.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
Returns a newVkBufferViewCreateInfo.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
Returns a newVkBufferViewCreateInfo.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
Create aVkBufferViewCreateInfo.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
-
mallocStack
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)instead. -
callocStack
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)instead. -
mallocStack
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)instead. -
callocStack
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)instead. -
mallocStack
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(int, MemoryStack)instead. -
callocStack
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(int, MemoryStack)instead. -
mallocStack
@Deprecated public static VkBufferViewCreateInfo.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack) Deprecated.Deprecated for removal in 3.4.0. Usemalloc(int, MemoryStack)instead. -
callocStack
@Deprecated public static VkBufferViewCreateInfo.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack) Deprecated.Deprecated for removal in 3.4.0. Usecalloc(int, MemoryStack)instead. -
malloc
Returns a newVkBufferViewCreateInfoinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
Returns a newVkBufferViewCreateInfoinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
malloc
public static VkBufferViewCreateInfo.Buffer malloc(int capacity, org.lwjgl.system.MemoryStack stack) Returns a newVkBufferViewCreateInfo.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
capacity- the buffer capacitystack- the stack from which to allocate
-
calloc
public static VkBufferViewCreateInfo.Buffer calloc(int capacity, org.lwjgl.system.MemoryStack stack) Returns a newVkBufferViewCreateInfo.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
capacity- the buffer capacitystack- the stack from which to allocate
-
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(). -
nbuffer
public static long nbuffer(long struct) Unsafe version ofbuffer(). -
nformat
public static int nformat(long struct) Unsafe version offormat(). -
noffset
public static long noffset(long struct) Unsafe version ofoffset(). -
nrange
public static long nrange(long struct) Unsafe version ofrange(). -
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. -
nbuffer
public static void nbuffer(long struct, long value) Unsafe version ofbuffer. -
nformat
public static void nformat(long struct, int value) Unsafe version offormat. -
noffset
public static void noffset(long struct, long value) Unsafe version ofoffset. -
nrange
public static void nrange(long struct, long value) Unsafe version ofrange.
-