public class VkDescriptorSetLayoutBinding
extends org.lwjgl.system.Struct
implements org.lwjgl.system.NativeResource
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.
The maximum binding number specified should be as compact as possible to avoid wasted memory.
descriptorType is DESCRIPTOR_TYPE_SAMPLER or DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, and descriptorCount is not 0 and pImmutableSamplers is not NULL, pImmutableSamplers must be a valid pointer to an array of descriptorCount valid VkSampler handlesdescriptorType is DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT then descriptorCount must be a multiple of 4descriptorType is DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT then descriptorCount must be less than or equal to VkPhysicalDeviceInlineUniformBlockPropertiesEXT::maxInlineUniformBlockSizedescriptorCount is not 0, stageFlags must be a valid combination of VkShaderStageFlagBits valuesdescriptorType is DESCRIPTOR_TYPE_INPUT_ATTACHMENT and descriptorCount is not 0, then stageFlags must be 0 or SHADER_STAGE_FRAGMENT_BITdescriptorType must be a valid VkDescriptorType valueVkDescriptorSetLayoutCreateInfo
binding – the binding number of this entry and corresponds to a resource of the same binding number in the shader stages.descriptorType – a VkDescriptorType specifying 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 if descriptorType is DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT in which case descriptorCount is the size in bytes of the inline uniform block . If descriptorCount is 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 of VkShaderStageFlagBits specifying which pipeline shader stages can access a resource for this binding. SHADER_STAGE_ALL is 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. If descriptorType specifies a DESCRIPTOR_TYPE_SAMPLER or DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER type descriptor, then pImmutableSamplers can be used to initialize a set of immutable samplers. Immutable samplers are permanently bound into the set layout and must not be changed; updating a DESCRIPTOR_TYPE_SAMPLER descriptor with immutable samplers is not allowed and updates to a DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER descriptor with immutable samplers does not modify the samplers (the image views are updated, but the sampler updates are ignored). If pImmutableSamplers is not NULL, then it points 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. If pImmutableSamplers is NULL, then the sampler slots are dynamic and sampler handles must be bound into descriptor sets using this layout. If descriptorType is not one of these descriptor types, then pImmutableSamplers is ignored.
struct VkDescriptorSetLayoutBinding {
uint32_t binding;
VkDescriptorType descriptorType;
uint32_t descriptorCount;
VkShaderStageFlags stageFlags;
VkSampler const * pImmutableSamplers;
}| Modifier and Type | Class and Description |
|---|---|
static class |
VkDescriptorSetLayoutBinding.Buffer
An array of
VkDescriptorSetLayoutBinding structs. |
| Modifier and Type | Field and Description |
|---|---|
static int |
ALIGNOF
The struct alignment in bytes.
|
static int |
BINDING
The struct member offsets.
|
static int |
DESCRIPTORCOUNT
The struct member offsets.
|
static int |
DESCRIPTORTYPE
The struct member offsets.
|
static int |
PIMMUTABLESAMPLERS
The struct member offsets.
|
static int |
SIZEOF
The struct size in bytes.
|
static int |
STAGEFLAGS
The struct member offsets.
|
| Constructor and Description |
|---|
VkDescriptorSetLayoutBinding(java.nio.ByteBuffer container)
Creates a
VkDescriptorSetLayoutBinding instance at the current position of the specified ByteBuffer container. |
| Modifier and Type | Method and Description |
|---|---|
int |
binding()
Returns the value of the
binding field. |
VkDescriptorSetLayoutBinding |
binding(int value)
Sets the specified value to the
binding field. |
static VkDescriptorSetLayoutBinding |
calloc()
Returns a new
VkDescriptorSetLayoutBinding instance allocated with memCalloc. |
static VkDescriptorSetLayoutBinding.Buffer |
calloc(int capacity)
Returns a new
VkDescriptorSetLayoutBinding.Buffer instance allocated with memCalloc. |
static VkDescriptorSetLayoutBinding |
callocStack()
Returns a new
VkDescriptorSetLayoutBinding instance allocated on the thread-local MemoryStack and initializes all its bits to zero. |
static VkDescriptorSetLayoutBinding.Buffer |
callocStack(int capacity)
Returns a new
VkDescriptorSetLayoutBinding.Buffer instance allocated on the thread-local MemoryStack and initializes all its bits to zero. |
static VkDescriptorSetLayoutBinding.Buffer |
callocStack(int capacity,
org.lwjgl.system.MemoryStack stack)
Returns a new
VkDescriptorSetLayoutBinding.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero. |
static VkDescriptorSetLayoutBinding |
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a new
VkDescriptorSetLayoutBinding instance allocated on the specified MemoryStack and initializes all its bits to zero. |
static VkDescriptorSetLayoutBinding |
create()
Returns a new
VkDescriptorSetLayoutBinding instance allocated with BufferUtils. |
static VkDescriptorSetLayoutBinding.Buffer |
create(int capacity)
Returns a new
VkDescriptorSetLayoutBinding.Buffer instance allocated with BufferUtils. |
static VkDescriptorSetLayoutBinding |
create(long address)
Returns a new
VkDescriptorSetLayoutBinding instance for the specified memory address. |
static VkDescriptorSetLayoutBinding.Buffer |
create(long address,
int capacity)
Create a
VkDescriptorSetLayoutBinding.Buffer instance at the specified memory. |
static VkDescriptorSetLayoutBinding |
createSafe(long address)
|
static VkDescriptorSetLayoutBinding.Buffer |
createSafe(long address,
int capacity)
|
int |
descriptorCount()
Returns the value of the
descriptorCount field. |
VkDescriptorSetLayoutBinding |
descriptorCount(int value)
Sets the specified value to the
descriptorCount field. |
int |
descriptorType()
Returns the value of the
descriptorType field. |
VkDescriptorSetLayoutBinding |
descriptorType(int value)
Sets the specified value to the
descriptorType field. |
static VkDescriptorSetLayoutBinding |
malloc()
Returns a new
VkDescriptorSetLayoutBinding instance allocated with memAlloc. |
static VkDescriptorSetLayoutBinding.Buffer |
malloc(int capacity)
Returns a new
VkDescriptorSetLayoutBinding.Buffer instance allocated with memAlloc. |
static VkDescriptorSetLayoutBinding |
mallocStack()
Returns a new
VkDescriptorSetLayoutBinding instance allocated on the thread-local MemoryStack. |
static VkDescriptorSetLayoutBinding.Buffer |
mallocStack(int capacity)
Returns a new
VkDescriptorSetLayoutBinding.Buffer instance allocated on the thread-local MemoryStack. |
static VkDescriptorSetLayoutBinding.Buffer |
mallocStack(int capacity,
org.lwjgl.system.MemoryStack stack)
Returns a new
VkDescriptorSetLayoutBinding.Buffer instance allocated on the specified MemoryStack. |
static VkDescriptorSetLayoutBinding |
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a new
VkDescriptorSetLayoutBinding instance allocated on the specified MemoryStack. |
static int |
nbinding(long struct)
Unsafe version of
binding(). |
static void |
nbinding(long struct,
int value)
Unsafe version of
binding. |
static int |
ndescriptorCount(long struct)
Unsafe version of
descriptorCount(). |
static void |
ndescriptorCount(long struct,
int value)
Sets the specified value to the
descriptorCount field of the specified struct. |
static int |
ndescriptorType(long struct)
Unsafe version of
descriptorType(). |
static void |
ndescriptorType(long struct,
int value)
Unsafe version of
descriptorType. |
static java.nio.LongBuffer |
npImmutableSamplers(long struct)
Unsafe version of
pImmutableSamplers. |
static void |
npImmutableSamplers(long struct,
java.nio.LongBuffer value)
Unsafe version of
pImmutableSamplers. |
static int |
nstageFlags(long struct)
Unsafe version of
stageFlags(). |
static void |
nstageFlags(long struct,
int value)
Unsafe version of
stageFlags. |
java.nio.LongBuffer |
pImmutableSamplers()
Returns a
LongBuffer view of the data pointed to by the pImmutableSamplers field. |
VkDescriptorSetLayoutBinding |
pImmutableSamplers(java.nio.LongBuffer value)
Sets the address of the specified
LongBuffer to the pImmutableSamplers field. |
VkDescriptorSetLayoutBinding |
set(int binding,
int descriptorType,
int descriptorCount,
int stageFlags,
java.nio.LongBuffer pImmutableSamplers)
Initializes this struct with the specified values.
|
VkDescriptorSetLayoutBinding |
set(VkDescriptorSetLayoutBinding src)
Copies the specified struct data to this struct.
|
int |
sizeof() |
int |
stageFlags()
Returns the value of the
stageFlags field. |
VkDescriptorSetLayoutBinding |
stageFlags(int value)
Sets the specified value to the
stageFlags field. |
public static final int SIZEOF
public static final int ALIGNOF
public static final int BINDING
public static final int DESCRIPTORTYPE
public static final int DESCRIPTORCOUNT
public static final int STAGEFLAGS
public static final int PIMMUTABLESAMPLERS
public VkDescriptorSetLayoutBinding(java.nio.ByteBuffer container)
VkDescriptorSetLayoutBinding instance at the current position of the specified ByteBuffer 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.
public int sizeof()
sizeof in class org.lwjgl.system.Structpublic int binding()
binding field.public int descriptorType()
descriptorType field.public int descriptorCount()
descriptorCount field.public int stageFlags()
stageFlags field.@Nullable public java.nio.LongBuffer pImmutableSamplers()
LongBuffer view of the data pointed to by the pImmutableSamplers field.public VkDescriptorSetLayoutBinding binding(int value)
binding field.public VkDescriptorSetLayoutBinding descriptorType(int value)
descriptorType field.public VkDescriptorSetLayoutBinding descriptorCount(int value)
descriptorCount field.public VkDescriptorSetLayoutBinding stageFlags(int value)
stageFlags field.public VkDescriptorSetLayoutBinding pImmutableSamplers(@Nullable java.nio.LongBuffer value)
LongBuffer to the pImmutableSamplers field.public VkDescriptorSetLayoutBinding set(int binding, int descriptorType, int descriptorCount, int stageFlags, @Nullable java.nio.LongBuffer pImmutableSamplers)
public VkDescriptorSetLayoutBinding set(VkDescriptorSetLayoutBinding src)
src - the source structpublic static VkDescriptorSetLayoutBinding malloc()
VkDescriptorSetLayoutBinding instance allocated with memAlloc. The instance must be explicitly freed.public static VkDescriptorSetLayoutBinding calloc()
VkDescriptorSetLayoutBinding instance allocated with memCalloc. The instance must be explicitly freed.public static VkDescriptorSetLayoutBinding create()
VkDescriptorSetLayoutBinding instance allocated with BufferUtils.public static VkDescriptorSetLayoutBinding create(long address)
VkDescriptorSetLayoutBinding instance for the specified memory address.@Nullable public static VkDescriptorSetLayoutBinding createSafe(long address)
public static VkDescriptorSetLayoutBinding.Buffer malloc(int capacity)
VkDescriptorSetLayoutBinding.Buffer instance allocated with memAlloc. The instance must be explicitly freed.capacity - the buffer capacitypublic static VkDescriptorSetLayoutBinding.Buffer calloc(int capacity)
VkDescriptorSetLayoutBinding.Buffer instance allocated with memCalloc. The instance must be explicitly freed.capacity - the buffer capacitypublic static VkDescriptorSetLayoutBinding.Buffer create(int capacity)
VkDescriptorSetLayoutBinding.Buffer instance allocated with BufferUtils.capacity - the buffer capacitypublic static VkDescriptorSetLayoutBinding.Buffer create(long address, int capacity)
VkDescriptorSetLayoutBinding.Buffer instance at the specified memory.address - the memory addresscapacity - the buffer capacity@Nullable public static VkDescriptorSetLayoutBinding.Buffer createSafe(long address, int capacity)
public static VkDescriptorSetLayoutBinding mallocStack()
VkDescriptorSetLayoutBinding instance allocated on the thread-local MemoryStack.public static VkDescriptorSetLayoutBinding callocStack()
VkDescriptorSetLayoutBinding instance allocated on the thread-local MemoryStack and initializes all its bits to zero.public static VkDescriptorSetLayoutBinding mallocStack(org.lwjgl.system.MemoryStack stack)
VkDescriptorSetLayoutBinding instance allocated on the specified MemoryStack.stack - the stack from which to allocatepublic static VkDescriptorSetLayoutBinding callocStack(org.lwjgl.system.MemoryStack stack)
VkDescriptorSetLayoutBinding instance allocated on the specified MemoryStack and initializes all its bits to zero.stack - the stack from which to allocatepublic static VkDescriptorSetLayoutBinding.Buffer mallocStack(int capacity)
VkDescriptorSetLayoutBinding.Buffer instance allocated on the thread-local MemoryStack.capacity - the buffer capacitypublic static VkDescriptorSetLayoutBinding.Buffer callocStack(int capacity)
VkDescriptorSetLayoutBinding.Buffer instance allocated on the thread-local MemoryStack and initializes all its bits to zero.capacity - the buffer capacitypublic static VkDescriptorSetLayoutBinding.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
VkDescriptorSetLayoutBinding.Buffer instance allocated on the specified MemoryStack.stack - the stack from which to allocatecapacity - the buffer capacitypublic static VkDescriptorSetLayoutBinding.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
VkDescriptorSetLayoutBinding.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.stack - the stack from which to allocatecapacity - the buffer capacitypublic static int nbinding(long struct)
binding().public static int ndescriptorType(long struct)
descriptorType().public static int ndescriptorCount(long struct)
descriptorCount().public static int nstageFlags(long struct)
stageFlags().@Nullable public static java.nio.LongBuffer npImmutableSamplers(long struct)
pImmutableSamplers.public static void nbinding(long struct,
int value)
binding.public static void ndescriptorType(long struct,
int value)
descriptorType.public static void ndescriptorCount(long struct,
int value)
descriptorCount field of the specified struct.public static void nstageFlags(long struct,
int value)
stageFlags.public static void npImmutableSamplers(long struct,
@Nullable
java.nio.LongBuffer value)
pImmutableSamplers.Copyright LWJGL. All Rights Reserved. License terms.