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
descriptorTypeisDESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXTthendescriptorCountmust be a multiple of 4 - If
descriptorTypeisDESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXTthendescriptorCountmust be less than or equal toVkPhysicalDeviceInlineUniformBlockPropertiesEXT::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
Valid Usage (Implicit)
descriptorTypemust be a validVkDescriptorTypevalue
See Also
VkDescriptorSetLayoutCreateInfoMember documentation
binding– the binding number of this entry and corresponds to a resource of the same binding number in the shader stages.descriptorType– aVkDescriptorTypespecifying which type of resource descriptors are used for this binding.descriptorCount– the number of descriptors contained in the binding, accessed in a shader as an array , except ifdescriptorTypeisDESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXTin 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– 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 considered to be a pointer to an array of sampler handles that will be consumed by the set layout and used for the corresponding binding. 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.
Layout
struct VkDescriptorSetLayoutBinding { uint32_t binding; VkDescriptorType descriptorType; uint32_t descriptorCount; VkShaderStageFlags stageFlags; 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 Modifier and Type Method Description intbinding()Returns the value of thebindingfield.VkDescriptorSetLayoutBindingbinding(int value)Sets the specified value to thebindingfield.static VkDescriptorSetLayoutBindingcalloc()Returns a newVkDescriptorSetLayoutBindinginstance allocated withmemCalloc.static VkDescriptorSetLayoutBinding.Buffercalloc(int capacity)Returns a newVkDescriptorSetLayoutBinding.Bufferinstance allocated withmemCalloc.static VkDescriptorSetLayoutBindingcallocStack()Returns a newVkDescriptorSetLayoutBindinginstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static VkDescriptorSetLayoutBinding.BuffercallocStack(int capacity)Returns a newVkDescriptorSetLayoutBinding.Bufferinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static VkDescriptorSetLayoutBinding.BuffercallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newVkDescriptorSetLayoutBinding.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static VkDescriptorSetLayoutBindingcallocStack(org.lwjgl.system.MemoryStack stack)Returns a newVkDescriptorSetLayoutBindinginstance allocated on the specifiedMemoryStackand initializes all its bits to zero.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()Returns the value of thedescriptorCountfield.VkDescriptorSetLayoutBindingdescriptorCount(int value)Sets the specified value to thedescriptorCountfield.intdescriptorType()Returns the value of thedescriptorTypefield.VkDescriptorSetLayoutBindingdescriptorType(int value)Sets the specified value to thedescriptorTypefield.static VkDescriptorSetLayoutBindingmalloc()Returns a newVkDescriptorSetLayoutBindinginstance allocated withmemAlloc.static VkDescriptorSetLayoutBinding.Buffermalloc(int capacity)Returns a newVkDescriptorSetLayoutBinding.Bufferinstance allocated withmemAlloc.static VkDescriptorSetLayoutBindingmallocStack()Returns a newVkDescriptorSetLayoutBindinginstance allocated on the thread-localMemoryStack.static VkDescriptorSetLayoutBinding.BuffermallocStack(int capacity)Returns a newVkDescriptorSetLayoutBinding.Bufferinstance allocated on the thread-localMemoryStack.static VkDescriptorSetLayoutBinding.BuffermallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newVkDescriptorSetLayoutBinding.Bufferinstance allocated on the specifiedMemoryStack.static VkDescriptorSetLayoutBindingmallocStack(org.lwjgl.system.MemoryStack stack)Returns a newVkDescriptorSetLayoutBindinginstance allocated on the specifiedMemoryStack.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()Returns aLongBufferview of the data pointed to by thepImmutableSamplersfield.VkDescriptorSetLayoutBindingpImmutableSamplers(java.nio.LongBuffer value)Sets the address of the specifiedLongBufferto thepImmutableSamplersfield.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()Returns the value of thestageFlagsfield.VkDescriptorSetLayoutBindingstageFlags(int value)Sets the specified value to thestageFlagsfield.
-
-
-
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()
Returns the value of thebindingfield.
-
descriptorType
public int descriptorType()
Returns the value of thedescriptorTypefield.
-
descriptorCount
public int descriptorCount()
Returns the value of thedescriptorCountfield.
-
stageFlags
public int stageFlags()
Returns the value of thestageFlagsfield.
-
pImmutableSamplers
@Nullable public java.nio.LongBuffer pImmutableSamplers()
Returns aLongBufferview of the data pointed to by thepImmutableSamplersfield.
-
binding
public VkDescriptorSetLayoutBinding binding(int value)
Sets the specified value to thebindingfield.
-
descriptorType
public VkDescriptorSetLayoutBinding descriptorType(int value)
Sets the specified value to thedescriptorTypefield.
-
descriptorCount
public VkDescriptorSetLayoutBinding descriptorCount(int value)
Sets the specified value to thedescriptorCountfield.
-
stageFlags
public VkDescriptorSetLayoutBinding stageFlags(int value)
Sets the specified value to thestageFlagsfield.
-
pImmutableSamplers
public VkDescriptorSetLayoutBinding pImmutableSamplers(@Nullable java.nio.LongBuffer value)
Sets the address of the specifiedLongBufferto thepImmutableSamplersfield.
-
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
public static VkDescriptorSetLayoutBinding mallocStack()
Returns a newVkDescriptorSetLayoutBindinginstance allocated on the thread-localMemoryStack.
-
callocStack
public static VkDescriptorSetLayoutBinding callocStack()
Returns a newVkDescriptorSetLayoutBindinginstance allocated on the thread-localMemoryStackand initializes all its bits to zero.
-
mallocStack
public static VkDescriptorSetLayoutBinding mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkDescriptorSetLayoutBindinginstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
callocStack
public static VkDescriptorSetLayoutBinding callocStack(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
-
mallocStack
public static VkDescriptorSetLayoutBinding.Buffer mallocStack(int capacity)
Returns a newVkDescriptorSetLayoutBinding.Bufferinstance allocated on the thread-localMemoryStack.- Parameters:
capacity- the buffer capacity
-
callocStack
public static VkDescriptorSetLayoutBinding.Buffer callocStack(int capacity)
Returns a newVkDescriptorSetLayoutBinding.Bufferinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.- Parameters:
capacity- the buffer capacity
-
mallocStack
public static VkDescriptorSetLayoutBinding.Buffer mallocStack(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
-
callocStack
public static VkDescriptorSetLayoutBinding.Buffer callocStack(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.
-
-