Class VkWriteDescriptorSet
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.vulkan.VkWriteDescriptorSet
-
- All Implemented Interfaces:
- java.lang.AutoCloseable, org.lwjgl.system.NativeResource, org.lwjgl.system.Pointer
public class VkWriteDescriptorSet extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResource
Structure specifying the parameters of a descriptor set write operation.Description
Only one of
pImageInfo
,pBufferInfo
, orpTexelBufferView
members is used according to the descriptor type specified in thedescriptorType
member of the containingVkWriteDescriptorSet
structure, as specified below.If the
dstBinding
has fewer thandescriptorCount
array elements remaining starting fromdstArrayElement
, then the remainder will be used to update the subsequent binding -dstBinding
+1 starting at array element zero. If a binding has adescriptorCount
of zero, it is skipped. This behavior applies recursively, with the update affecting consecutive bindings as needed to update alldescriptorCount
descriptors.Valid Usage
dstBinding
must be less than or equal to the maximum value ofbinding
of allVkDescriptorSetLayoutBinding
structures specified whendstSet
’s descriptor set layout was createddstBinding
must be a binding with a non-zerodescriptorCount
- All consecutive bindings updated via a single
VkWriteDescriptorSet
structure, except those with adescriptorCount
of zero, must have identicaldescriptorType
andstageFlags
. - All consecutive bindings updated via a single
VkWriteDescriptorSet
structure, except those with adescriptorCount
of zero, must all either use immutable samplers or must all not use immutable samplers. descriptorType
must match the type ofdstBinding
withindstSet
dstSet
must be a validVkDescriptorSet
handle- The sum of
dstArrayElement
anddescriptorCount
must be less than or equal to the number of array elements in the descriptor set binding specified bydstBinding
, and all applicable consecutive bindings, as described by the “consecutive binding updates” section - If
descriptorType
isDESCRIPTOR_TYPE_SAMPLER
,DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER
,DESCRIPTOR_TYPE_SAMPLED_IMAGE
,DESCRIPTOR_TYPE_STORAGE_IMAGE
, orDESCRIPTOR_TYPE_INPUT_ATTACHMENT
,pImageInfo
must be a pointer to an array ofdescriptorCount
validVkDescriptorImageInfo
structures - If
descriptorType
isDESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER
orDESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER
,pTexelBufferView
must be a pointer to an array ofdescriptorCount
validVkBufferView
handles - If
descriptorType
isDESCRIPTOR_TYPE_UNIFORM_BUFFER
,DESCRIPTOR_TYPE_STORAGE_BUFFER
,DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC
, orDESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC
,pBufferInfo
must be a pointer to an array ofdescriptorCount
validVkDescriptorBufferInfo
structures - If
descriptorType
isDESCRIPTOR_TYPE_SAMPLER
orDESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER
, anddstSet
was not allocated with a layout that included immutable samplers fordstBinding
withdescriptorType
, thesampler
member of any given element ofpImageInfo
must be a validVkSampler
object - If
descriptorType
isDESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER
,DESCRIPTOR_TYPE_SAMPLED_IMAGE
,DESCRIPTOR_TYPE_STORAGE_IMAGE
, orDESCRIPTOR_TYPE_INPUT_ATTACHMENT
, theimageView
andimageLayout
members of any given element ofpImageInfo
must be a validVkImageView
andVkImageLayout
, respectively - If
descriptorType
isDESCRIPTOR_TYPE_UNIFORM_BUFFER
orDESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC
, theoffset
member of any given element ofpBufferInfo
must be a multiple ofVkPhysicalDeviceLimits
::minUniformBufferOffsetAlignment
- If
descriptorType
isDESCRIPTOR_TYPE_STORAGE_BUFFER
orDESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC
, theoffset
member of any given element ofpBufferInfo
must be a multiple ofVkPhysicalDeviceLimits
::minStorageBufferOffsetAlignment
- If
descriptorType
isDESCRIPTOR_TYPE_UNIFORM_BUFFER
,DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC
,DESCRIPTOR_TYPE_STORAGE_BUFFER
, orDESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC
, thebuffer
member of any given element ofpBufferInfo
that is non-sparse must be bound completely and contiguously to a singleVkDeviceMemory
object - If
descriptorType
isDESCRIPTOR_TYPE_UNIFORM_BUFFER
orDESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC
, thebuffer
member of any given element ofpBufferInfo
must have been created withBUFFER_USAGE_UNIFORM_BUFFER_BIT
set - If
descriptorType
isDESCRIPTOR_TYPE_STORAGE_BUFFER
orDESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC
, thebuffer
member of any given element ofpBufferInfo
must have been created withBUFFER_USAGE_STORAGE_BUFFER_BIT
set - If
descriptorType
isDESCRIPTOR_TYPE_UNIFORM_BUFFER
orDESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC
, therange
member of any given element ofpBufferInfo
, or the effective range ifrange
isWHOLE_SIZE
, must be less than or equal toVkPhysicalDeviceLimits
::maxUniformBufferRange
- If
descriptorType
isDESCRIPTOR_TYPE_STORAGE_BUFFER
orDESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC
, therange
member of any given element ofpBufferInfo
, or the effective range ifrange
isWHOLE_SIZE
, must be less than or equal toVkPhysicalDeviceLimits
::maxStorageBufferRange
- If
descriptorType
isDESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER
, theVkBuffer
that any given element ofpTexelBufferView
was created from must have been created withBUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT
set - If
descriptorType
isDESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER
, theVkBuffer
that any given element ofpTexelBufferView
was created from must have been created withBUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT
set - If
descriptorType
isDESCRIPTOR_TYPE_STORAGE_IMAGE
orDESCRIPTOR_TYPE_INPUT_ATTACHMENT
, theimageView
member of any given element ofpImageInfo
must have been created with the identity swizzle - If
descriptorType
isDESCRIPTOR_TYPE_SAMPLED_IMAGE
orDESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER
, theimageView
member of any given element ofpImageInfo
must have been created withIMAGE_USAGE_SAMPLED_BIT
set - If
descriptorType
isDESCRIPTOR_TYPE_INPUT_ATTACHMENT
, theimageView
member of any given element ofpImageInfo
must have been created withIMAGE_USAGE_INPUT_ATTACHMENT_BIT
set - If
descriptorType
isDESCRIPTOR_TYPE_STORAGE_IMAGE
, theimageView
member of any given element ofpImageInfo
must have been created withIMAGE_USAGE_STORAGE_BIT
set
Valid Usage (Implicit)
sType
must beSTRUCTURE_TYPE_WRITE_DESCRIPTOR_SET
pNext
must beNULL
descriptorType
must be a validVkDescriptorType
valuedescriptorCount
must be greater than 0- Both of
dstSet
, and the elements ofpTexelBufferView
that are valid handles must have been created, allocated, or retrieved from the sameVkDevice
See Also
VkDescriptorBufferInfo
,VkDescriptorImageInfo
,CmdPushDescriptorSetKHR
,UpdateDescriptorSets
Member documentation
sType
– the type of this structure.pNext
–NULL
or a pointer to an extension-specific structure.dstSet
– the destination descriptor set to update.dstBinding
– the descriptor binding within that set.dstArrayElement
– the starting element in that array.descriptorCount
– the number of descriptors to update (the number of elements inpImageInfo
,pBufferInfo
, orpTexelBufferView
).descriptorType
– aVkDescriptorType
specifying the type of each descriptor inpImageInfo
,pBufferInfo
, orpTexelBufferView
, as described below. It must be the same type as that specified inVkDescriptorSetLayoutBinding
fordstSet
atdstBinding
. The type of the descriptor also controls which array the descriptors are taken from.pImageInfo
– points to an array ofVkDescriptorImageInfo
structures or is ignored, as described below.pBufferInfo
– points to an array ofVkDescriptorBufferInfo
structures or is ignored, as described below.pTexelBufferView
– points to an array ofVkBufferView
handles as described in the Buffer Views section or is ignored, as described below.
Layout
struct VkWriteDescriptorSet { VkStructureType sType; const void * pNext; VkDescriptorSet dstSet; uint32_t dstBinding; uint32_t dstArrayElement; uint32_t descriptorCount; VkDescriptorType descriptorType; const
VkDescriptorImageInfo
* pImageInfo; constVkDescriptorBufferInfo
* pBufferInfo; const VkBufferView * pTexelBufferView; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static class
VkWriteDescriptorSet.Buffer
An array ofVkWriteDescriptorSet
structs.
-
Field Summary
Fields Modifier and Type Field and Description static int
SIZEOF
The struct size in bytes.
-
Constructor Summary
Constructors Constructor and Description VkWriteDescriptorSet(java.nio.ByteBuffer container)
Creates aVkWriteDescriptorSet
instance at the current position of the specifiedByteBuffer
container.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description static VkWriteDescriptorSet
calloc()
Returns a newVkWriteDescriptorSet
instance allocated withmemCalloc
.static VkWriteDescriptorSet.Buffer
calloc(int capacity)
Returns a newVkWriteDescriptorSet.Buffer
instance allocated withmemCalloc
.static VkWriteDescriptorSet
callocStack()
Returns a newVkWriteDescriptorSet
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static VkWriteDescriptorSet.Buffer
callocStack(int capacity)
Returns a newVkWriteDescriptorSet.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static VkWriteDescriptorSet.Buffer
callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkWriteDescriptorSet.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static VkWriteDescriptorSet
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkWriteDescriptorSet
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static VkWriteDescriptorSet
create()
Returns a newVkWriteDescriptorSet
instance allocated withBufferUtils
.static VkWriteDescriptorSet.Buffer
create(int capacity)
Returns a newVkWriteDescriptorSet.Buffer
instance allocated withBufferUtils
.static VkWriteDescriptorSet
create(long address)
Returns a newVkWriteDescriptorSet
instance for the specified memory address ornull
if the address isNULL
.static VkWriteDescriptorSet.Buffer
create(long address, int capacity)
Create aVkWriteDescriptorSet.Buffer
instance at the specified memory.int
descriptorCount()
Returns the value of thedescriptorCount
field.int
descriptorType()
Returns the value of thedescriptorType
field.VkWriteDescriptorSet
descriptorType(int value)
Sets the specified value to thedescriptorType
field.int
dstArrayElement()
Returns the value of thedstArrayElement
field.VkWriteDescriptorSet
dstArrayElement(int value)
Sets the specified value to thedstArrayElement
field.int
dstBinding()
Returns the value of thedstBinding
field.VkWriteDescriptorSet
dstBinding(int value)
Sets the specified value to thedstBinding
field.long
dstSet()
Returns the value of thedstSet
field.VkWriteDescriptorSet
dstSet(long value)
Sets the specified value to thedstSet
field.static VkWriteDescriptorSet
malloc()
Returns a newVkWriteDescriptorSet
instance allocated withmemAlloc
.static VkWriteDescriptorSet.Buffer
malloc(int capacity)
Returns a newVkWriteDescriptorSet.Buffer
instance allocated withmemAlloc
.static VkWriteDescriptorSet
mallocStack()
Returns a newVkWriteDescriptorSet
instance allocated on the thread-localMemoryStack
.static VkWriteDescriptorSet.Buffer
mallocStack(int capacity)
Returns a newVkWriteDescriptorSet.Buffer
instance allocated on the thread-localMemoryStack
.static VkWriteDescriptorSet.Buffer
mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkWriteDescriptorSet.Buffer
instance allocated on the specifiedMemoryStack
.static VkWriteDescriptorSet
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkWriteDescriptorSet
instance allocated on the specifiedMemoryStack
.VkDescriptorBufferInfo.Buffer
pBufferInfo()
Returns aVkDescriptorBufferInfo.Buffer
view of the struct array pointed to by thepBufferInfo
field.VkWriteDescriptorSet
pBufferInfo(VkDescriptorBufferInfo.Buffer value)
Sets the address of the specifiedVkDescriptorBufferInfo.Buffer
to thepBufferInfo
field.VkDescriptorImageInfo.Buffer
pImageInfo()
Returns aVkDescriptorImageInfo.Buffer
view of the struct array pointed to by thepImageInfo
field.VkWriteDescriptorSet
pImageInfo(VkDescriptorImageInfo.Buffer value)
Sets the address of the specifiedVkDescriptorImageInfo.Buffer
to thepImageInfo
field.long
pNext()
Returns the value of thepNext
field.VkWriteDescriptorSet
pNext(long value)
Sets the specified value to thepNext
field.java.nio.LongBuffer
pTexelBufferView()
Returns aLongBuffer
view of the data pointed to by thepTexelBufferView
field.VkWriteDescriptorSet
pTexelBufferView(java.nio.LongBuffer value)
Sets the address of the specifiedLongBuffer
to thepTexelBufferView
field.VkWriteDescriptorSet
set(int sType, long pNext, long dstSet, int dstBinding, int dstArrayElement, int descriptorType, VkDescriptorImageInfo.Buffer pImageInfo, VkDescriptorBufferInfo.Buffer pBufferInfo, java.nio.LongBuffer pTexelBufferView)
Initializes this struct with the specified values.VkWriteDescriptorSet
set(VkWriteDescriptorSet src)
Copies the specified struct data to this struct.int
sizeof()
Returns thesizeof(struct)
.int
sType()
Returns the value of thesType
field.VkWriteDescriptorSet
sType(int value)
Sets the specified value to thesType
field.static void
validate(long struct)
Validates pointer members that should not beNULL
.static void
validate(long array, int count)
CallsVkWriteDescriptorSet.validate(long)
for each struct contained in the specified struct array.
-
-
-
Constructor Detail
-
VkWriteDescriptorSet
public VkWriteDescriptorSet(java.nio.ByteBuffer container)
Creates aVkWriteDescriptorSet
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()
Description copied from class:org.lwjgl.system.Struct
Returns thesizeof(struct)
.- 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.
-
dstSet
public long dstSet()
Returns the value of thedstSet
field.
-
dstBinding
public int dstBinding()
Returns the value of thedstBinding
field.
-
dstArrayElement
public int dstArrayElement()
Returns the value of thedstArrayElement
field.
-
descriptorCount
public int descriptorCount()
Returns the value of thedescriptorCount
field.
-
descriptorType
public int descriptorType()
Returns the value of thedescriptorType
field.
-
pImageInfo
public VkDescriptorImageInfo.Buffer pImageInfo()
Returns aVkDescriptorImageInfo.Buffer
view of the struct array pointed to by thepImageInfo
field.
-
pBufferInfo
public VkDescriptorBufferInfo.Buffer pBufferInfo()
Returns aVkDescriptorBufferInfo.Buffer
view of the struct array pointed to by thepBufferInfo
field.
-
pTexelBufferView
public java.nio.LongBuffer pTexelBufferView()
Returns aLongBuffer
view of the data pointed to by thepTexelBufferView
field.
-
sType
public VkWriteDescriptorSet sType(int value)
Sets the specified value to thesType
field.
-
pNext
public VkWriteDescriptorSet pNext(long value)
Sets the specified value to thepNext
field.
-
dstSet
public VkWriteDescriptorSet dstSet(long value)
Sets the specified value to thedstSet
field.
-
dstBinding
public VkWriteDescriptorSet dstBinding(int value)
Sets the specified value to thedstBinding
field.
-
dstArrayElement
public VkWriteDescriptorSet dstArrayElement(int value)
Sets the specified value to thedstArrayElement
field.
-
descriptorType
public VkWriteDescriptorSet descriptorType(int value)
Sets the specified value to thedescriptorType
field.
-
pImageInfo
public VkWriteDescriptorSet pImageInfo(VkDescriptorImageInfo.Buffer value)
Sets the address of the specifiedVkDescriptorImageInfo.Buffer
to thepImageInfo
field.
-
pBufferInfo
public VkWriteDescriptorSet pBufferInfo(VkDescriptorBufferInfo.Buffer value)
Sets the address of the specifiedVkDescriptorBufferInfo.Buffer
to thepBufferInfo
field.
-
pTexelBufferView
public VkWriteDescriptorSet pTexelBufferView(java.nio.LongBuffer value)
Sets the address of the specifiedLongBuffer
to thepTexelBufferView
field.
-
set
public VkWriteDescriptorSet set(int sType, long pNext, long dstSet, int dstBinding, int dstArrayElement, int descriptorType, VkDescriptorImageInfo.Buffer pImageInfo, VkDescriptorBufferInfo.Buffer pBufferInfo, java.nio.LongBuffer pTexelBufferView)
Initializes this struct with the specified values.
-
set
public VkWriteDescriptorSet set(VkWriteDescriptorSet src)
Copies the specified struct data to this struct.- Parameters:
src
- the source struct- Returns:
- this struct
-
malloc
public static VkWriteDescriptorSet malloc()
Returns a newVkWriteDescriptorSet
instance allocated withmemAlloc
. The instance must be explicitly freed.
-
calloc
public static VkWriteDescriptorSet calloc()
Returns a newVkWriteDescriptorSet
instance allocated withmemCalloc
. The instance must be explicitly freed.
-
create
public static VkWriteDescriptorSet create()
Returns a newVkWriteDescriptorSet
instance allocated withBufferUtils
.
-
create
public static VkWriteDescriptorSet create(long address)
Returns a newVkWriteDescriptorSet
instance for the specified memory address ornull
if the address isNULL
.
-
malloc
public static VkWriteDescriptorSet.Buffer malloc(int capacity)
Returns a newVkWriteDescriptorSet.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
public static VkWriteDescriptorSet.Buffer calloc(int capacity)
Returns a newVkWriteDescriptorSet.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
public static VkWriteDescriptorSet.Buffer create(int capacity)
Returns a newVkWriteDescriptorSet.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
public static VkWriteDescriptorSet.Buffer create(long address, int capacity)
Create aVkWriteDescriptorSet.Buffer
instance at the specified memory.- Parameters:
address
- the memory addresscapacity
- the buffer capacity
-
mallocStack
public static VkWriteDescriptorSet mallocStack()
Returns a newVkWriteDescriptorSet
instance allocated on the thread-localMemoryStack
.
-
callocStack
public static VkWriteDescriptorSet callocStack()
Returns a newVkWriteDescriptorSet
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.
-
mallocStack
public static VkWriteDescriptorSet mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkWriteDescriptorSet
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
callocStack
public static VkWriteDescriptorSet callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkWriteDescriptorSet
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocate
-
mallocStack
public static VkWriteDescriptorSet.Buffer mallocStack(int capacity)
Returns a newVkWriteDescriptorSet.Buffer
instance allocated on the thread-localMemoryStack
.- Parameters:
capacity
- the buffer capacity
-
callocStack
public static VkWriteDescriptorSet.Buffer callocStack(int capacity)
Returns a newVkWriteDescriptorSet.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.- Parameters:
capacity
- the buffer capacity
-
mallocStack
public static VkWriteDescriptorSet.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkWriteDescriptorSet.Buffer
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
callocStack
public static VkWriteDescriptorSet.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkWriteDescriptorSet.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
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)
CallsVkWriteDescriptorSet.validate(long)
for each struct contained in the specified struct array.- Parameters:
array
- the struct array to validatecount
- the number of structs inarray
-
-