Class VkDescriptorSetLayoutBinding
- All Implemented Interfaces:
AutoCloseable,org.lwjgl.system.NativeResource,org.lwjgl.system.Pointer
Description
The above layout definition allows the descriptor bindings to be specified sparsely such that not all binding numbers between 0 and the maximum binding number need to be specified in the pBindings array. Bindings that are not specified have a descriptorCount and stageFlags of zero, and the value of descriptorType is undefined. However, all binding numbers between 0 and the maximum binding number in the VkDescriptorSetLayoutCreateInfo::pBindings array may consume memory in the descriptor set layout even if not all descriptor bindings are used, though it should not consume additional memory from the descriptor pool.
Note
The maximum binding number specified should be as compact as possible to avoid wasted memory.
Valid Usage
- If
descriptorTypeisDESCRIPTOR_TYPE_SAMPLERorDESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, anddescriptorCountis not 0 andpImmutableSamplersis notNULL,pImmutableSamplersmust be a valid pointer to an array ofdescriptorCountvalidVkSamplerhandles - If the
inlineUniformBlockfeature is not enabled,descriptorTypemust not beDESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK - If
descriptorTypeisDESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCKthendescriptorCountmust be a multiple of 4 - If
descriptorTypeisDESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCKandVkDescriptorSetLayoutCreateInfo::flagsdoes not containDESCRIPTOR_SET_LAYOUT_CREATE_DESCRIPTOR_BUFFER_BIT_EXTthendescriptorCountmust be less than or equal toVkPhysicalDeviceInlineUniformBlockProperties::maxInlineUniformBlockSize - If
VkDescriptorSetLayoutCreateInfo::flagscontainsDESCRIPTOR_SET_LAYOUT_CREATE_EMBEDDED_IMMUTABLE_SAMPLERS_BIT_EXT,descriptorTypemust beDESCRIPTOR_TYPE_SAMPLER - If
VkDescriptorSetLayoutCreateInfo::flagscontainsDESCRIPTOR_SET_LAYOUT_CREATE_EMBEDDED_IMMUTABLE_SAMPLERS_BIT_EXT,descriptorCountmust less than or equal to 1 - If
VkDescriptorSetLayoutCreateInfo::flagscontainsDESCRIPTOR_SET_LAYOUT_CREATE_EMBEDDED_IMMUTABLE_SAMPLERS_BIT_EXT, anddescriptorCountis equal to 1,pImmutableSamplersmust not beNULL - If
descriptorCountis not 0,stageFlagsmust beSHADER_STAGE_ALLor a valid combination of otherVkShaderStageFlagBitsvalues - If
descriptorTypeisDESCRIPTOR_TYPE_INPUT_ATTACHMENTanddescriptorCountis not 0, thenstageFlagsmust be 0 orSHADER_STAGE_FRAGMENT_BIT - The sampler objects indicated by
pImmutableSamplersmust not have aborderColorwith one of the valuesBORDER_COLOR_FLOAT_CUSTOM_EXTorBORDER_COLOR_INT_CUSTOM_EXT - If
descriptorTypeisDESCRIPTOR_TYPE_MUTABLE_EXT, thenpImmutableSamplersmust beNULL - If
VkDescriptorSetLayoutCreateInfo::flagscontainsDESCRIPTOR_SET_LAYOUT_CREATE_PER_STAGE_BIT_NV, anddescriptorCountis not 0, thenstageFlagsmust be a valid combination ofSHADER_STAGE_VERTEX_BIT,SHADER_STAGE_TESSELLATION_CONTROL_BIT,SHADER_STAGE_TESSELLATION_EVALUATION_BIT,SHADER_STAGE_GEOMETRY_BIT,SHADER_STAGE_FRAGMENT_BITandSHADER_STAGE_COMPUTE_BITvalues
Valid Usage (Implicit)
descriptorTypemust be a validVkDescriptorTypevalue
See Also
VkDescriptorSetLayoutCreateInfo
Layout
struct VkDescriptorSetLayoutBinding {
uint32_t binding();
VkDescriptorType descriptorType();
uint32_t descriptorCount();
VkShaderStageFlags stageFlags();
VkSampler const * pImmutableSamplers();
}-
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 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
ConstructorsConstructorDescriptionVkDescriptorSetLayoutBinding(ByteBuffer container) Creates aVkDescriptorSetLayoutBindinginstance at the current position of the specifiedByteBuffercontainer. -
Method Summary
Modifier and TypeMethodDescriptionintbinding()the binding number of this entry and corresponds to a resource of the same binding number in the shader stages.binding(int value) Sets the specified value to thebinding()field.static VkDescriptorSetLayoutBindingcalloc()Returns a newVkDescriptorSetLayoutBindinginstance allocated withmemCalloc.calloc(int capacity) Returns a newVkDescriptorSetLayoutBinding.Bufferinstance allocated withmemCalloc.calloc(int capacity, org.lwjgl.system.MemoryStack stack) Returns a newVkDescriptorSetLayoutBinding.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static VkDescriptorSetLayoutBindingcalloc(org.lwjgl.system.MemoryStack stack) Returns a newVkDescriptorSetLayoutBindinginstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static VkDescriptorSetLayoutBindingDeprecated.callocStack(int capacity) Deprecated.callocStack(int capacity, org.lwjgl.system.MemoryStack stack) Deprecated.static VkDescriptorSetLayoutBindingcallocStack(org.lwjgl.system.MemoryStack stack) Deprecated.static VkDescriptorSetLayoutBindingcreate()Returns a newVkDescriptorSetLayoutBindinginstance allocated withBufferUtils.create(int capacity) Returns a newVkDescriptorSetLayoutBinding.Bufferinstance allocated withBufferUtils.static VkDescriptorSetLayoutBindingcreate(long address) Returns a newVkDescriptorSetLayoutBindinginstance for the specified memory address.create(long address, int capacity) Create aVkDescriptorSetLayoutBinding.Bufferinstance at the specified memory.static @Nullable VkDescriptorSetLayoutBindingcreateSafe(long address) static @Nullable VkDescriptorSetLayoutBinding.BuffercreateSafe(long address, int capacity) intthe number of descriptors contained in the binding, accessed in a shader as an array, except ifdescriptorTypeisDESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCKin which casedescriptorCountis the size in bytes of the inline uniform block.descriptorCount(int value) Sets the specified value to thedescriptorCount()field.intaVkDescriptorTypespecifying which type of resource descriptors are used for this binding.descriptorType(int value) Sets the specified value to thedescriptorType()field.static VkDescriptorSetLayoutBindingmalloc()Returns a newVkDescriptorSetLayoutBindinginstance allocated withmemAlloc.malloc(int capacity) Returns a newVkDescriptorSetLayoutBinding.Bufferinstance allocated withmemAlloc.malloc(int capacity, org.lwjgl.system.MemoryStack stack) Returns a newVkDescriptorSetLayoutBinding.Bufferinstance allocated on the specifiedMemoryStack.static VkDescriptorSetLayoutBindingmalloc(org.lwjgl.system.MemoryStack stack) Returns a newVkDescriptorSetLayoutBindinginstance allocated on the specifiedMemoryStack.static VkDescriptorSetLayoutBindingDeprecated.mallocStack(int capacity) Deprecated.mallocStack(int capacity, org.lwjgl.system.MemoryStack stack) Deprecated.static VkDescriptorSetLayoutBindingmallocStack(org.lwjgl.system.MemoryStack stack) Deprecated.static intnbinding(long struct) Unsafe version ofbinding().static voidnbinding(long struct, int value) Unsafe version ofbinding.static intndescriptorCount(long struct) Unsafe version ofdescriptorCount().static voidndescriptorCount(long struct, int value) Sets the specified value to thedescriptorCountfield of the specifiedstruct.static intndescriptorType(long struct) Unsafe version ofdescriptorType().static voidndescriptorType(long struct, int value) Unsafe version ofdescriptorType.static @Nullable LongBuffernpImmutableSamplers(long struct) Unsafe version ofpImmutableSamplers.static voidnpImmutableSamplers(long struct, @Nullable LongBuffer value) Unsafe version ofpImmutableSamplers.static intnstageFlags(long struct) Unsafe version ofstageFlags().static voidnstageFlags(long struct, int value) Unsafe version ofstageFlags.@Nullable LongBufferaffects initialization of samplers.pImmutableSamplers(@Nullable LongBuffer value) Sets the address of the specifiedLongBufferto thepImmutableSamplers()field.set(int binding, int descriptorType, int descriptorCount, int stageFlags, @Nullable LongBuffer pImmutableSamplers) Initializes this struct with the specified values.Copies the specified struct data to this struct.intsizeof()intmember is a bitmask ofVkShaderStageFlagBitsspecifying which pipeline shader stages can access a resource for this binding.stageFlags(int value) Sets the specified value to thestageFlags()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. -
BINDING
public static final int BINDINGThe struct member offsets. -
DESCRIPTORTYPE
public static final int DESCRIPTORTYPEThe struct member offsets. -
DESCRIPTORCOUNT
public static final int DESCRIPTORCOUNTThe struct member offsets. -
STAGEFLAGS
public static final int STAGEFLAGSThe struct member offsets. -
PIMMUTABLESAMPLERS
public static final int PIMMUTABLESAMPLERSThe struct member offsets.
-
-
Constructor Details
-
VkDescriptorSetLayoutBinding
Creates aVkDescriptorSetLayoutBindinginstance 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<VkDescriptorSetLayoutBinding>
-
binding
public int binding()the binding number of this entry and corresponds to a resource of the same binding number in the shader stages. -
descriptorType
public int descriptorType()aVkDescriptorTypespecifying which type of resource descriptors are used for this binding. -
descriptorCount
public int descriptorCount()the number of descriptors contained in the binding, accessed in a shader as an array, except ifdescriptorTypeisDESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCKin which casedescriptorCountis the size in bytes of the inline uniform block. IfdescriptorCountis zero this binding entry is reserved and the resource must not be accessed from any stage via this binding within any pipeline using the set layout. -
stageFlags
public int stageFlags()member is a bitmask ofVkShaderStageFlagBitsspecifying which pipeline shader stages can access a resource for this binding.SHADER_STAGE_ALLis a shorthand specifying that all defined shader stages, including any additional stages defined by extensions, can access the resource.If a shader stage is not included in
stageFlags, then a resource must not be accessed from that stage via this binding within any pipeline using the set layout. Other than input attachments which are limited to the fragment shader, there are no limitations on what combinations of stages can use a descriptor binding, and in particular a binding can be used by both graphics stages and the compute stage. -
pImmutableSamplers
affects initialization of samplers. IfdescriptorTypespecifies aDESCRIPTOR_TYPE_SAMPLERorDESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLERtype descriptor, thenpImmutableSamplerscan be used to initialize a set of immutable samplers. Immutable samplers are permanently bound into the set layout and must not be changed; updating aDESCRIPTOR_TYPE_SAMPLERdescriptor with immutable samplers is not allowed and updates to aDESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLERdescriptor with immutable samplers does not modify the samplers (the image views are updated, but the sampler updates are ignored). IfpImmutableSamplersis notNULL, then it is a pointer to an array of sampler handles that will be copied into the set layout and used for the corresponding binding. Only the sampler handles are copied; the sampler objects must not be destroyed before the final use of the set layout and any descriptor pools and sets created using it. IfpImmutableSamplersisNULL, then the sampler slots are dynamic and sampler handles must be bound into descriptor sets using this layout. IfdescriptorTypeis not one of these descriptor types, thenpImmutableSamplersis ignored. -
binding
Sets the specified value to thebinding()field. -
descriptorType
Sets the specified value to thedescriptorType()field. -
descriptorCount
Sets the specified value to thedescriptorCount()field. -
stageFlags
Sets the specified value to thestageFlags()field. -
pImmutableSamplers
Sets the address of the specifiedLongBufferto thepImmutableSamplers()field. -
set
public VkDescriptorSetLayoutBinding set(int binding, int descriptorType, int descriptorCount, int stageFlags, @Nullable LongBuffer pImmutableSamplers) 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 newVkDescriptorSetLayoutBindinginstance allocated withmemAlloc. The instance must be explicitly freed. -
calloc
Returns a newVkDescriptorSetLayoutBindinginstance allocated withmemCalloc. The instance must be explicitly freed. -
create
Returns a newVkDescriptorSetLayoutBindinginstance allocated withBufferUtils. -
create
Returns a newVkDescriptorSetLayoutBindinginstance for the specified memory address. -
createSafe
-
malloc
Returns a newVkDescriptorSetLayoutBinding.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
Returns a newVkDescriptorSetLayoutBinding.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
Returns a newVkDescriptorSetLayoutBinding.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
Create aVkDescriptorSetLayoutBinding.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 public static VkDescriptorSetLayoutBinding mallocStack(org.lwjgl.system.MemoryStack stack) Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)instead. -
callocStack
@Deprecated public static VkDescriptorSetLayoutBinding callocStack(org.lwjgl.system.MemoryStack stack) 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 VkDescriptorSetLayoutBinding.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 VkDescriptorSetLayoutBinding.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack) Deprecated.Deprecated for removal in 3.4.0. Usecalloc(int, MemoryStack)instead. -
malloc
Returns a newVkDescriptorSetLayoutBindinginstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
Returns a newVkDescriptorSetLayoutBindinginstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
malloc
public static VkDescriptorSetLayoutBinding.Buffer malloc(int capacity, org.lwjgl.system.MemoryStack stack) Returns a newVkDescriptorSetLayoutBinding.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
capacity- the buffer capacitystack- the stack from which to allocate
-
calloc
public static VkDescriptorSetLayoutBinding.Buffer calloc(int capacity, org.lwjgl.system.MemoryStack stack) Returns a newVkDescriptorSetLayoutBinding.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
capacity- the buffer capacitystack- the stack from which to allocate
-
nbinding
public static int nbinding(long struct) Unsafe version ofbinding(). -
ndescriptorType
public static int ndescriptorType(long struct) Unsafe version ofdescriptorType(). -
ndescriptorCount
public static int ndescriptorCount(long struct) Unsafe version ofdescriptorCount(). -
nstageFlags
public static int nstageFlags(long struct) Unsafe version ofstageFlags(). -
npImmutableSamplers
Unsafe version ofpImmutableSamplers. -
nbinding
public static void nbinding(long struct, int value) Unsafe version ofbinding. -
ndescriptorType
public static void ndescriptorType(long struct, int value) Unsafe version ofdescriptorType. -
ndescriptorCount
public static void ndescriptorCount(long struct, int value) Sets the specified value to thedescriptorCountfield of the specifiedstruct. -
nstageFlags
public static void nstageFlags(long struct, int value) Unsafe version ofstageFlags. -
npImmutableSamplers
Unsafe version ofpImmutableSamplers.
-