Package org.lwjgl.vulkan
Class VkBufferViewCreateInfo
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.vulkan.VkBufferViewCreateInfo
-
- All Implemented Interfaces:
java.lang.AutoCloseable,org.lwjgl.system.NativeResource,org.lwjgl.system.Pointer
public class VkBufferViewCreateInfo extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResourceStructure specifying parameters of a newly created buffer view.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
bufferwas created withusagecontainingBUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT,formatmust be supported for uniform texel buffers, as specified by theFORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BITflag inVkFormatProperties::bufferFeaturesreturned byGetPhysicalDeviceFormatProperties - If
bufferwas created withusagecontainingBUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT,formatmust be supported for storage texel buffers, as specified by theFORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BITflag inVkFormatProperties::bufferFeaturesreturned byGetPhysicalDeviceFormatProperties - If
bufferis non-sparse then it must be bound completely and contiguously to a singleVkDeviceMemoryobject - If the texelBufferAlignment feature is not enabled,
offsetmust be a multiple ofVkPhysicalDeviceLimits::minTexelBufferOffsetAlignment - If the texelBufferAlignment feature is enabled and if
bufferwas 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 texelBufferAlignment feature is enabled and if
bufferwas 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
Valid Usage (Implicit)
sTypemust beSTRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFOpNextmust beNULLflagsmust be 0buffermust be a validVkBufferhandleformatmust be a validVkFormatvalue
See Also
Layout
struct VkBufferViewCreateInfo { VkStructureTypesType(); void const *pNext(); VkBufferViewCreateFlagsflags(); VkBufferbuffer(); VkFormatformat(); VkDeviceSizeoffset(); VkDeviceSizerange(); }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classVkBufferViewCreateInfo.BufferAn array ofVkBufferViewCreateInfostructs.
-
Constructor Summary
Constructors Constructor Description VkBufferViewCreateInfo(java.nio.ByteBuffer container)Creates aVkBufferViewCreateInfoinstance at the current position of the specifiedByteBuffercontainer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description longbuffer()aVkBufferon which the view will be created.VkBufferViewCreateInfobuffer(long value)Sets the specified value to thebuffer()field.static VkBufferViewCreateInfocalloc()Returns a newVkBufferViewCreateInfoinstance allocated withmemCalloc.static VkBufferViewCreateInfo.Buffercalloc(int capacity)Returns a newVkBufferViewCreateInfo.Bufferinstance allocated withmemCalloc.static VkBufferViewCreateInfo.Buffercalloc(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 VkBufferViewCreateInfocallocStack()Deprecated.static VkBufferViewCreateInfo.BuffercallocStack(int capacity)Deprecated.static VkBufferViewCreateInfo.BuffercallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Deprecated.static VkBufferViewCreateInfocallocStack(org.lwjgl.system.MemoryStack stack)Deprecated.static VkBufferViewCreateInfocreate()Returns a newVkBufferViewCreateInfoinstance allocated withBufferUtils.static VkBufferViewCreateInfo.Buffercreate(int capacity)Returns a newVkBufferViewCreateInfo.Bufferinstance allocated withBufferUtils.static VkBufferViewCreateInfocreate(long address)Returns a newVkBufferViewCreateInfoinstance for the specified memory address.static VkBufferViewCreateInfo.Buffercreate(long address, int capacity)Create aVkBufferViewCreateInfo.Bufferinstance at the specified memory.static VkBufferViewCreateInfocreateSafe(long address)static VkBufferViewCreateInfo.BuffercreateSafe(long address, int capacity)intflags()reserved for future use.VkBufferViewCreateInfoflags(int value)Sets the specified value to theflags()field.intformat()aVkFormatdescribing the format of the data elements in the buffer.VkBufferViewCreateInfoformat(int value)Sets the specified value to theformat()field.static VkBufferViewCreateInfomalloc()Returns a newVkBufferViewCreateInfoinstance allocated withmemAlloc.static VkBufferViewCreateInfo.Buffermalloc(int capacity)Returns a newVkBufferViewCreateInfo.Bufferinstance allocated withmemAlloc.static VkBufferViewCreateInfo.Buffermalloc(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 VkBufferViewCreateInfomallocStack()Deprecated.static VkBufferViewCreateInfo.BuffermallocStack(int capacity)Deprecated.static VkBufferViewCreateInfo.BuffermallocStack(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.VkBufferViewCreateInfooffset(long value)Sets the specified value to theoffset()field.longpNext()NULLor a pointer to a structure extending this structure.VkBufferViewCreateInfopNext(long value)Sets the specified value to thepNext()field.longrange()a size in bytes of the buffer view.VkBufferViewCreateInforange(long value)Sets the specified value to therange()field.VkBufferViewCreateInfoset(int sType, long pNext, int flags, long buffer, int format, long offset, long range)Initializes this struct with the specified values.VkBufferViewCreateInfoset(VkBufferViewCreateInfo src)Copies the specified struct data to this struct.intsizeof()intsType()the type of this structure.VkBufferViewCreateInfosType(int value)Sets the specified value to thesType()field.VkBufferViewCreateInfosType$Default()Sets theSTRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFOvalue to thesType()field.
-
-
-
Constructor Detail
-
VkBufferViewCreateInfo
public VkBufferViewCreateInfo(java.nio.ByteBuffer container)
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 Detail
-
sizeof
public int sizeof()
- Specified by:
sizeofin classorg.lwjgl.system.Struct
-
sType
public int sType()
the type of 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
public VkBufferViewCreateInfo sType(int value)
Sets the specified value to thesType()field.
-
sType$Default
public VkBufferViewCreateInfo sType$Default()
Sets theSTRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFOvalue to thesType()field.
-
pNext
public VkBufferViewCreateInfo pNext(long value)
Sets the specified value to thepNext()field.
-
flags
public VkBufferViewCreateInfo flags(int value)
Sets the specified value to theflags()field.
-
buffer
public VkBufferViewCreateInfo buffer(long value)
Sets the specified value to thebuffer()field.
-
format
public VkBufferViewCreateInfo format(int value)
Sets the specified value to theformat()field.
-
offset
public VkBufferViewCreateInfo offset(long value)
Sets the specified value to theoffset()field.
-
range
public VkBufferViewCreateInfo range(long value)
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
public VkBufferViewCreateInfo set(VkBufferViewCreateInfo src)
Copies the specified struct data to this struct.- Parameters:
src- the source struct- Returns:
- this struct
-
malloc
public static VkBufferViewCreateInfo malloc()
Returns a newVkBufferViewCreateInfoinstance allocated withmemAlloc. The instance must be explicitly freed.
-
calloc
public static VkBufferViewCreateInfo calloc()
Returns a newVkBufferViewCreateInfoinstance allocated withmemCalloc. The instance must be explicitly freed.
-
create
public static VkBufferViewCreateInfo create()
Returns a newVkBufferViewCreateInfoinstance allocated withBufferUtils.
-
create
public static VkBufferViewCreateInfo create(long address)
Returns a newVkBufferViewCreateInfoinstance for the specified memory address.
-
createSafe
@Nullable public static VkBufferViewCreateInfo createSafe(long address)
-
malloc
public static VkBufferViewCreateInfo.Buffer malloc(int capacity)
Returns a newVkBufferViewCreateInfo.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
public static VkBufferViewCreateInfo.Buffer calloc(int capacity)
Returns a newVkBufferViewCreateInfo.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
public static VkBufferViewCreateInfo.Buffer create(int capacity)
Returns a newVkBufferViewCreateInfo.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
public static VkBufferViewCreateInfo.Buffer create(long address, int capacity)
Create aVkBufferViewCreateInfo.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
@Nullable public static VkBufferViewCreateInfo.Buffer createSafe(long address, int capacity)
-
mallocStack
@Deprecated public static VkBufferViewCreateInfo mallocStack()
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)instead.
-
callocStack
@Deprecated public static VkBufferViewCreateInfo callocStack()
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)instead.
-
mallocStack
@Deprecated public static VkBufferViewCreateInfo mallocStack(org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)instead.
-
callocStack
@Deprecated public static VkBufferViewCreateInfo callocStack(org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)instead.
-
mallocStack
@Deprecated public static VkBufferViewCreateInfo.Buffer mallocStack(int capacity)
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(int, MemoryStack)instead.
-
callocStack
@Deprecated public static VkBufferViewCreateInfo.Buffer callocStack(int capacity)
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
public static VkBufferViewCreateInfo malloc(org.lwjgl.system.MemoryStack stack)
Returns a newVkBufferViewCreateInfoinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
public static VkBufferViewCreateInfo calloc(org.lwjgl.system.MemoryStack stack)
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:
stack- the stack from which to allocatecapacity- the buffer capacity
-
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:
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().
-
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.
-
-