Class VkDescriptorSetLayoutBinding
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.vulkan.VkDescriptorSetLayoutBinding
-
- All Implemented Interfaces:
java.lang.AutoCloseable,org.lwjgl.system.NativeResource,org.lwjgl.system.Pointer
public class VkDescriptorSetLayoutBinding extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResourceStructure specifying a descriptor set layout binding.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
pBindingsarray. Bindings that are not specified have adescriptorCountandstageFlagsof zero, and the value ofdescriptorTypeis undefined. However, all binding numbers between 0 and the maximum binding number in theVkDescriptorSetLayoutCreateInfo::pBindingsarray 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 inlineUniformBlock feature 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_BLOCKthendescriptorCountmust be less than or equal toVkPhysicalDeviceInlineUniformBlockProperties::maxInlineUniformBlockSize - If
descriptorCountis not 0,stageFlagsmust be a valid combination ofVkShaderStageFlagBitsvalues - 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_VALVE, thenpImmutableSamplersmust beNULL
Valid Usage (Implicit)
descriptorTypemust be a validVkDescriptorTypevalue
See Also
VkDescriptorSetLayoutCreateInfoLayout
struct VkDescriptorSetLayoutBinding { uint32_tbinding(); VkDescriptorTypedescriptorType(); uint32_tdescriptorCount(); VkShaderStageFlagsstageFlags(); VkSampler const *pImmutableSamplers(); }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classVkDescriptorSetLayoutBinding.BufferAn array ofVkDescriptorSetLayoutBindingstructs.
-
Field Summary
Fields Modifier and Type Field Description static intALIGNOFThe struct alignment in bytes.static intBINDING
DESCRIPTORCOUNT
DESCRIPTORTYPE
PIMMUTABLESAMPLERSThe struct member offsets.static intSIZEOFThe struct size in bytes.static intSTAGEFLAGSThe struct member offsets.
-
Constructor Summary
Constructors Constructor Description VkDescriptorSetLayoutBinding(java.nio.ByteBuffer container)Creates aVkDescriptorSetLayoutBindinginstance at the current position of the specifiedByteBuffercontainer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description intbinding()the binding number of this entry and corresponds to a resource of the same binding number in the shader stages.VkDescriptorSetLayoutBindingbinding(int value)Sets the specified value to thebinding()field.static VkDescriptorSetLayoutBindingcalloc()Returns a newVkDescriptorSetLayoutBindinginstance allocated withmemCalloc.static VkDescriptorSetLayoutBinding.Buffercalloc(int capacity)Returns a newVkDescriptorSetLayoutBinding.Bufferinstance allocated withmemCalloc.static VkDescriptorSetLayoutBinding.Buffercalloc(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 VkDescriptorSetLayoutBindingcallocStack()Deprecated.static VkDescriptorSetLayoutBinding.BuffercallocStack(int capacity)Deprecated.static VkDescriptorSetLayoutBinding.BuffercallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Deprecated.static VkDescriptorSetLayoutBindingcallocStack(org.lwjgl.system.MemoryStack stack)Deprecated.static VkDescriptorSetLayoutBindingcreate()Returns a newVkDescriptorSetLayoutBindinginstance allocated withBufferUtils.static VkDescriptorSetLayoutBinding.Buffercreate(int capacity)Returns a newVkDescriptorSetLayoutBinding.Bufferinstance allocated withBufferUtils.static VkDescriptorSetLayoutBindingcreate(long address)Returns a newVkDescriptorSetLayoutBindinginstance for the specified memory address.static VkDescriptorSetLayoutBinding.Buffercreate(long address, int capacity)Create aVkDescriptorSetLayoutBinding.Bufferinstance at the specified memory.static VkDescriptorSetLayoutBindingcreateSafe(long address)static VkDescriptorSetLayoutBinding.BuffercreateSafe(long address, int capacity)intdescriptorCount()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.VkDescriptorSetLayoutBindingdescriptorCount(int value)Sets the specified value to thedescriptorCount()field.intdescriptorType()aVkDescriptorTypespecifying which type of resource descriptors are used for this binding.VkDescriptorSetLayoutBindingdescriptorType(int value)Sets the specified value to thedescriptorType()field.static VkDescriptorSetLayoutBindingmalloc()Returns a newVkDescriptorSetLayoutBindinginstance allocated withmemAlloc.static VkDescriptorSetLayoutBinding.Buffermalloc(int capacity)Returns a newVkDescriptorSetLayoutBinding.Bufferinstance allocated withmemAlloc.static VkDescriptorSetLayoutBinding.Buffermalloc(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 VkDescriptorSetLayoutBindingmallocStack()Deprecated.static VkDescriptorSetLayoutBinding.BuffermallocStack(int capacity)Deprecated.static VkDescriptorSetLayoutBinding.BuffermallocStack(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 java.nio.LongBuffernpImmutableSamplers(long struct)Unsafe version ofpImmutableSamplers.static voidnpImmutableSamplers(long struct, java.nio.LongBuffer value)Unsafe version ofpImmutableSamplers.static intnstageFlags(long struct)Unsafe version ofstageFlags().static voidnstageFlags(long struct, int value)Unsafe version ofstageFlags.java.nio.LongBufferpImmutableSamplers()affects initialization of samplers.VkDescriptorSetLayoutBindingpImmutableSamplers(java.nio.LongBuffer value)Sets the address of the specifiedLongBufferto thepImmutableSamplers()field.VkDescriptorSetLayoutBindingset(int binding, int descriptorType, int descriptorCount, int stageFlags, java.nio.LongBuffer pImmutableSamplers)Initializes this struct with the specified values.VkDescriptorSetLayoutBindingset(VkDescriptorSetLayoutBinding src)Copies the specified struct data to this struct.intsizeof()intstageFlags()member is a bitmask ofVkShaderStageFlagBitsspecifying which pipeline shader stages can access a resource for this binding.VkDescriptorSetLayoutBindingstageFlags(int value)Sets the specified value to thestageFlags()field.
-
-
-
Constructor Detail
-
VkDescriptorSetLayoutBinding
public VkDescriptorSetLayoutBinding(java.nio.ByteBuffer container)
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 Detail
-
sizeof
public int sizeof()
- Specified by:
sizeofin classorg.lwjgl.system.Struct
-
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
@Nullable public java.nio.LongBuffer 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
public VkDescriptorSetLayoutBinding binding(int value)
Sets the specified value to thebinding()field.
-
descriptorType
public VkDescriptorSetLayoutBinding descriptorType(int value)
Sets the specified value to thedescriptorType()field.
-
descriptorCount
public VkDescriptorSetLayoutBinding descriptorCount(int value)
Sets the specified value to thedescriptorCount()field.
-
stageFlags
public VkDescriptorSetLayoutBinding stageFlags(int value)
Sets the specified value to thestageFlags()field.
-
pImmutableSamplers
public VkDescriptorSetLayoutBinding pImmutableSamplers(@Nullable java.nio.LongBuffer value)
Sets the address of the specifiedLongBufferto thepImmutableSamplers()field.
-
set
public VkDescriptorSetLayoutBinding set(int binding, int descriptorType, int descriptorCount, int stageFlags, @Nullable java.nio.LongBuffer pImmutableSamplers)
Initializes this struct with the specified values.
-
set
public VkDescriptorSetLayoutBinding set(VkDescriptorSetLayoutBinding src)
Copies the specified struct data to this struct.- Parameters:
src- the source struct- Returns:
- this struct
-
malloc
public static VkDescriptorSetLayoutBinding malloc()
Returns a newVkDescriptorSetLayoutBindinginstance allocated withmemAlloc. The instance must be explicitly freed.
-
calloc
public static VkDescriptorSetLayoutBinding calloc()
Returns a newVkDescriptorSetLayoutBindinginstance allocated withmemCalloc. The instance must be explicitly freed.
-
create
public static VkDescriptorSetLayoutBinding create()
Returns a newVkDescriptorSetLayoutBindinginstance allocated withBufferUtils.
-
create
public static VkDescriptorSetLayoutBinding create(long address)
Returns a newVkDescriptorSetLayoutBindinginstance for the specified memory address.
-
createSafe
@Nullable public static VkDescriptorSetLayoutBinding createSafe(long address)
-
malloc
public static VkDescriptorSetLayoutBinding.Buffer malloc(int capacity)
Returns a newVkDescriptorSetLayoutBinding.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
public static VkDescriptorSetLayoutBinding.Buffer calloc(int capacity)
Returns a newVkDescriptorSetLayoutBinding.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
public static VkDescriptorSetLayoutBinding.Buffer create(int capacity)
Returns a newVkDescriptorSetLayoutBinding.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
public static VkDescriptorSetLayoutBinding.Buffer create(long address, int capacity)
Create aVkDescriptorSetLayoutBinding.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
@Nullable public static VkDescriptorSetLayoutBinding.Buffer createSafe(long address, int capacity)
-
mallocStack
@Deprecated public static VkDescriptorSetLayoutBinding mallocStack()
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)instead.
-
callocStack
@Deprecated public static VkDescriptorSetLayoutBinding 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 public static VkDescriptorSetLayoutBinding.Buffer mallocStack(int capacity)
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(int, MemoryStack)instead.
-
callocStack
@Deprecated public static VkDescriptorSetLayoutBinding.Buffer callocStack(int capacity)
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
public static VkDescriptorSetLayoutBinding malloc(org.lwjgl.system.MemoryStack stack)
Returns a newVkDescriptorSetLayoutBindinginstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
public static VkDescriptorSetLayoutBinding calloc(org.lwjgl.system.MemoryStack stack)
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:
stack- the stack from which to allocatecapacity- the buffer capacity
-
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:
stack- the stack from which to allocatecapacity- the buffer capacity
-
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
@Nullable public static java.nio.LongBuffer npImmutableSamplers(long struct)
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
public static void npImmutableSamplers(long struct, @Nullable java.nio.LongBuffer value)Unsafe version ofpImmutableSamplers.
-
-