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 the texelBufferAlignment feature is not enabled,
offsetmust be a multiple ofVkPhysicalDeviceLimits::minTexelBufferOffsetAlignment - 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,rangedivided by the texel block size offormat, multiplied by the number of texels per texel block for that format (as defined in the Compatible Formats table), 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 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 byvkGetPhysicalDeviceFormatProperties - 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 byvkGetPhysicalDeviceFormatProperties - If
bufferis non-sparse then it must be bound completely and contiguously to a singleVkDeviceMemoryobject - If the texelBufferAlignment feature is enabled and if
bufferwas created withusagecontainingBUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT,offsetmust be a multiple of the lesser ofVkPhysicalDeviceTexelBufferAlignmentPropertiesEXT::storageTexelBufferOffsetAlignmentBytesor, ifVkPhysicalDeviceTexelBufferAlignmentPropertiesEXT::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 ofVkPhysicalDeviceTexelBufferAlignmentPropertiesEXT::uniformTexelBufferOffsetAlignmentBytesor, ifVkPhysicalDeviceTexelBufferAlignmentPropertiesEXT::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
Member documentation
sType– the type of this structure.pNext–NULLor a pointer to an extension-specific structure.flags– reserved for future use.buffer– aVkBufferon which the view will be created.format– aVkFormatdescribing the format of the data elements in the buffer.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– 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.
Layout
struct VkBufferViewCreateInfo { VkStructureType sType; void const * pNext; VkBufferViewCreateFlags flags; VkBuffer buffer; VkFormat format; VkDeviceSize offset; VkDeviceSize range; }
-
-
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 Modifier and Type Method Description longbuffer()Returns the value of thebufferfield.VkBufferViewCreateInfobuffer(long value)Sets the specified value to thebufferfield.static VkBufferViewCreateInfocalloc()Returns a newVkBufferViewCreateInfoinstance allocated withmemCalloc.static VkBufferViewCreateInfo.Buffercalloc(int capacity)Returns a newVkBufferViewCreateInfo.Bufferinstance allocated withmemCalloc.static VkBufferViewCreateInfocallocStack()Returns a newVkBufferViewCreateInfoinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static VkBufferViewCreateInfo.BuffercallocStack(int capacity)Returns a newVkBufferViewCreateInfo.Bufferinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static VkBufferViewCreateInfo.BuffercallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newVkBufferViewCreateInfo.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static VkBufferViewCreateInfocallocStack(org.lwjgl.system.MemoryStack stack)Returns a newVkBufferViewCreateInfoinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.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()Returns the value of theflagsfield.VkBufferViewCreateInfoflags(int value)Sets the specified value to theflagsfield.intformat()Returns the value of theformatfield.VkBufferViewCreateInfoformat(int value)Sets the specified value to theformatfield.static VkBufferViewCreateInfomalloc()Returns a newVkBufferViewCreateInfoinstance allocated withmemAlloc.static VkBufferViewCreateInfo.Buffermalloc(int capacity)Returns a newVkBufferViewCreateInfo.Bufferinstance allocated withmemAlloc.static VkBufferViewCreateInfomallocStack()Returns a newVkBufferViewCreateInfoinstance allocated on the thread-localMemoryStack.static VkBufferViewCreateInfo.BuffermallocStack(int capacity)Returns a newVkBufferViewCreateInfo.Bufferinstance allocated on the thread-localMemoryStack.static VkBufferViewCreateInfo.BuffermallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newVkBufferViewCreateInfo.Bufferinstance allocated on the specifiedMemoryStack.static VkBufferViewCreateInfomallocStack(org.lwjgl.system.MemoryStack stack)Returns a newVkBufferViewCreateInfoinstance allocated on the specifiedMemoryStack.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()Returns the value of theoffsetfield.VkBufferViewCreateInfooffset(long value)Sets the specified value to theoffsetfield.longpNext()Returns the value of thepNextfield.VkBufferViewCreateInfopNext(long value)Sets the specified value to thepNextfield.longrange()Returns the value of therangefield.VkBufferViewCreateInforange(long value)Sets the specified value to therangefield.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()Returns the value of thesTypefield.VkBufferViewCreateInfosType(int value)Sets the specified value to thesTypefield.
-
-
-
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()
Returns the value of thesTypefield.
-
pNext
public long pNext()
Returns the value of thepNextfield.
-
flags
public int flags()
Returns the value of theflagsfield.
-
buffer
public long buffer()
Returns the value of thebufferfield.
-
format
public int format()
Returns the value of theformatfield.
-
offset
public long offset()
Returns the value of theoffsetfield.
-
range
public long range()
Returns the value of therangefield.
-
sType
public VkBufferViewCreateInfo sType(int value)
Sets the specified value to thesTypefield.
-
pNext
public VkBufferViewCreateInfo pNext(long value)
Sets the specified value to thepNextfield.
-
flags
public VkBufferViewCreateInfo flags(int value)
Sets the specified value to theflagsfield.
-
buffer
public VkBufferViewCreateInfo buffer(long value)
Sets the specified value to thebufferfield.
-
format
public VkBufferViewCreateInfo format(int value)
Sets the specified value to theformatfield.
-
offset
public VkBufferViewCreateInfo offset(long value)
Sets the specified value to theoffsetfield.
-
range
public VkBufferViewCreateInfo range(long value)
Sets the specified value to therangefield.
-
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
public static VkBufferViewCreateInfo mallocStack()
Returns a newVkBufferViewCreateInfoinstance allocated on the thread-localMemoryStack.
-
callocStack
public static VkBufferViewCreateInfo callocStack()
Returns a newVkBufferViewCreateInfoinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.
-
mallocStack
public static VkBufferViewCreateInfo mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkBufferViewCreateInfoinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
callocStack
public static VkBufferViewCreateInfo callocStack(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
-
mallocStack
public static VkBufferViewCreateInfo.Buffer mallocStack(int capacity)
Returns a newVkBufferViewCreateInfo.Bufferinstance allocated on the thread-localMemoryStack.- Parameters:
capacity- the buffer capacity
-
callocStack
public static VkBufferViewCreateInfo.Buffer callocStack(int capacity)
Returns a newVkBufferViewCreateInfo.Bufferinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.- Parameters:
capacity- the buffer capacity
-
mallocStack
public static VkBufferViewCreateInfo.Buffer mallocStack(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
-
callocStack
public static VkBufferViewCreateInfo.Buffer callocStack(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.
-
-