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.NativeResource
Structure specifying parameters of a newly created buffer view.Valid Usage
offset
must be less than the size ofbuffer
- If the texelBufferAlignment feature is not enabled,
offset
must be a multiple ofVkPhysicalDeviceLimits
::minTexelBufferOffsetAlignment
- If
range
is not equal toWHOLE_SIZE
,range
must be greater than 0 - If
range
is not equal toWHOLE_SIZE
,range
must be an integer multiple of the texel block size offormat
- If
range
is not equal toWHOLE_SIZE
,range
divided 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
range
is not equal toWHOLE_SIZE
, the sum ofoffset
andrange
must be less than or equal to the size ofbuffer
buffer
must have been created with ausage
value containing at least one ofBUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT
orBUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT
- If
buffer
was created withusage
containingBUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT
,format
must be supported for uniform texel buffers, as specified by theFORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT
flag inVkFormatProperties
::bufferFeatures
returned byvkGetPhysicalDeviceFormatProperties
- If
buffer
was created withusage
containingBUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT
,format
must be supported for storage texel buffers, as specified by theFORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT
flag inVkFormatProperties
::bufferFeatures
returned byvkGetPhysicalDeviceFormatProperties
- If
buffer
is non-sparse then it must be bound completely and contiguously to a singleVkDeviceMemory
object - If the texelBufferAlignment feature is enabled and if
buffer
was created withusage
containingBUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT
,offset
must be a multiple of the lesser ofVkPhysicalDeviceTexelBufferAlignmentPropertiesEXT
::storageTexelBufferOffsetAlignmentBytes
or, ifVkPhysicalDeviceTexelBufferAlignmentPropertiesEXT
::storageTexelBufferOffsetSingleTexelAlignment
isTRUE
, 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 offormat
is used instead - If the texelBufferAlignment feature is enabled and if
buffer
was created withusage
containingBUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT
,offset
must be a multiple of the lesser ofVkPhysicalDeviceTexelBufferAlignmentPropertiesEXT
::uniformTexelBufferOffsetAlignmentBytes
or, ifVkPhysicalDeviceTexelBufferAlignmentPropertiesEXT
::uniformTexelBufferOffsetSingleTexelAlignment
isTRUE
, 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 offormat
is used instead
Valid Usage (Implicit)
sType
must beSTRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO
pNext
must beNULL
flags
must be 0buffer
must be a validVkBuffer
handleformat
must be a validVkFormat
value
See Also
Member documentation
sType
– the type of this structure.pNext
–NULL
or a pointer to an extension-specific structure.flags
– reserved for future use.buffer
– aVkBuffer
on which the view will be created.format
– aVkFormat
describing 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. Ifrange
is equal toWHOLE_SIZE
, the range fromoffset
to the end of the buffer is used. IfWHOLE_SIZE
is 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 class
VkBufferViewCreateInfo.Buffer
An array ofVkBufferViewCreateInfo
structs.
-
Constructor Summary
Constructors Constructor Description VkBufferViewCreateInfo(java.nio.ByteBuffer container)
Creates aVkBufferViewCreateInfo
instance at the current position of the specifiedByteBuffer
container.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description long
buffer()
Returns the value of thebuffer
field.VkBufferViewCreateInfo
buffer(long value)
Sets the specified value to thebuffer
field.static VkBufferViewCreateInfo
calloc()
Returns a newVkBufferViewCreateInfo
instance allocated withmemCalloc
.static VkBufferViewCreateInfo.Buffer
calloc(int capacity)
Returns a newVkBufferViewCreateInfo.Buffer
instance allocated withmemCalloc
.static VkBufferViewCreateInfo
callocStack()
Returns a newVkBufferViewCreateInfo
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static VkBufferViewCreateInfo.Buffer
callocStack(int capacity)
Returns a newVkBufferViewCreateInfo.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static VkBufferViewCreateInfo.Buffer
callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkBufferViewCreateInfo.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static VkBufferViewCreateInfo
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkBufferViewCreateInfo
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static VkBufferViewCreateInfo
create()
Returns a newVkBufferViewCreateInfo
instance allocated withBufferUtils
.static VkBufferViewCreateInfo.Buffer
create(int capacity)
Returns a newVkBufferViewCreateInfo.Buffer
instance allocated withBufferUtils
.static VkBufferViewCreateInfo
create(long address)
Returns a newVkBufferViewCreateInfo
instance for the specified memory address.static VkBufferViewCreateInfo.Buffer
create(long address, int capacity)
Create aVkBufferViewCreateInfo.Buffer
instance at the specified memory.static VkBufferViewCreateInfo
createSafe(long address)
static VkBufferViewCreateInfo.Buffer
createSafe(long address, int capacity)
int
flags()
Returns the value of theflags
field.VkBufferViewCreateInfo
flags(int value)
Sets the specified value to theflags
field.int
format()
Returns the value of theformat
field.VkBufferViewCreateInfo
format(int value)
Sets the specified value to theformat
field.static VkBufferViewCreateInfo
malloc()
Returns a newVkBufferViewCreateInfo
instance allocated withmemAlloc
.static VkBufferViewCreateInfo.Buffer
malloc(int capacity)
Returns a newVkBufferViewCreateInfo.Buffer
instance allocated withmemAlloc
.static VkBufferViewCreateInfo
mallocStack()
Returns a newVkBufferViewCreateInfo
instance allocated on the thread-localMemoryStack
.static VkBufferViewCreateInfo.Buffer
mallocStack(int capacity)
Returns a newVkBufferViewCreateInfo.Buffer
instance allocated on the thread-localMemoryStack
.static VkBufferViewCreateInfo.Buffer
mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkBufferViewCreateInfo.Buffer
instance allocated on the specifiedMemoryStack
.static VkBufferViewCreateInfo
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkBufferViewCreateInfo
instance allocated on the specifiedMemoryStack
.static long
nbuffer(long struct)
Unsafe version ofbuffer()
.static void
nbuffer(long struct, long value)
Unsafe version ofbuffer
.static int
nflags(long struct)
Unsafe version offlags()
.static void
nflags(long struct, int value)
Unsafe version offlags
.static int
nformat(long struct)
Unsafe version offormat()
.static void
nformat(long struct, int value)
Unsafe version offormat
.static long
noffset(long struct)
Unsafe version ofoffset()
.static void
noffset(long struct, long value)
Unsafe version ofoffset
.static long
npNext(long struct)
Unsafe version ofpNext()
.static void
npNext(long struct, long value)
Unsafe version ofpNext
.static long
nrange(long struct)
Unsafe version ofrange()
.static void
nrange(long struct, long value)
Unsafe version ofrange
.static int
nsType(long struct)
Unsafe version ofsType()
.static void
nsType(long struct, int value)
Unsafe version ofsType
.long
offset()
Returns the value of theoffset
field.VkBufferViewCreateInfo
offset(long value)
Sets the specified value to theoffset
field.long
pNext()
Returns the value of thepNext
field.VkBufferViewCreateInfo
pNext(long value)
Sets the specified value to thepNext
field.long
range()
Returns the value of therange
field.VkBufferViewCreateInfo
range(long value)
Sets the specified value to therange
field.VkBufferViewCreateInfo
set(int sType, long pNext, int flags, long buffer, int format, long offset, long range)
Initializes this struct with the specified values.VkBufferViewCreateInfo
set(VkBufferViewCreateInfo src)
Copies the specified struct data to this struct.int
sizeof()
int
sType()
Returns the value of thesType
field.VkBufferViewCreateInfo
sType(int value)
Sets the specified value to thesType
field.
-
-
-
Constructor Detail
-
VkBufferViewCreateInfo
public VkBufferViewCreateInfo(java.nio.ByteBuffer container)
Creates aVkBufferViewCreateInfo
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.
-
buffer
public long buffer()
Returns the value of thebuffer
field.
-
format
public int format()
Returns the value of theformat
field.
-
offset
public long offset()
Returns the value of theoffset
field.
-
range
public long range()
Returns the value of therange
field.
-
sType
public VkBufferViewCreateInfo sType(int value)
Sets the specified value 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 newVkBufferViewCreateInfo
instance allocated withmemAlloc
. The instance must be explicitly freed.
-
calloc
public static VkBufferViewCreateInfo calloc()
Returns a newVkBufferViewCreateInfo
instance allocated withmemCalloc
. The instance must be explicitly freed.
-
create
public static VkBufferViewCreateInfo create()
Returns a newVkBufferViewCreateInfo
instance allocated withBufferUtils
.
-
create
public static VkBufferViewCreateInfo create(long address)
Returns a newVkBufferViewCreateInfo
instance for the specified memory address.
-
createSafe
@Nullable public static VkBufferViewCreateInfo createSafe(long address)
-
malloc
public static VkBufferViewCreateInfo.Buffer malloc(int capacity)
Returns a newVkBufferViewCreateInfo.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
public static VkBufferViewCreateInfo.Buffer calloc(int capacity)
Returns a newVkBufferViewCreateInfo.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
public static VkBufferViewCreateInfo.Buffer create(int capacity)
Returns a newVkBufferViewCreateInfo.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
public static VkBufferViewCreateInfo.Buffer create(long address, int capacity)
Create aVkBufferViewCreateInfo.Buffer
instance 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 newVkBufferViewCreateInfo
instance allocated on the thread-localMemoryStack
.
-
callocStack
public static VkBufferViewCreateInfo callocStack()
Returns a newVkBufferViewCreateInfo
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.
-
mallocStack
public static VkBufferViewCreateInfo mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkBufferViewCreateInfo
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
callocStack
public static VkBufferViewCreateInfo callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkBufferViewCreateInfo
instance allocated on the specifiedMemoryStack
and 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.Buffer
instance allocated on the thread-localMemoryStack
.- Parameters:
capacity
- the buffer capacity
-
callocStack
public static VkBufferViewCreateInfo.Buffer callocStack(int capacity)
Returns a newVkBufferViewCreateInfo.Buffer
instance allocated on the thread-localMemoryStack
and 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.Buffer
instance 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.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()
.
-
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
.
-
-