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.NativeResource
Structure 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
pBindings
array. Bindings that are not specified have adescriptorCount
andstageFlags
of zero, and the value ofdescriptorType
is undefined. However, all binding numbers between 0 and the maximum binding number in theVkDescriptorSetLayoutCreateInfo
::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
descriptorType
isDESCRIPTOR_TYPE_SAMPLER
orDESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER
, anddescriptorCount
is not 0 andpImmutableSamplers
is notNULL
,pImmutableSamplers
must be a valid pointer to an array ofdescriptorCount
validVkSampler
handles - If
descriptorType
isDESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT
thendescriptorCount
must be a multiple of 4 - If
descriptorType
isDESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT
thendescriptorCount
must be less than or equal toVkPhysicalDeviceInlineUniformBlockPropertiesEXT
::maxInlineUniformBlockSize
- If
descriptorCount
is not 0,stageFlags
must be a valid combination ofVkShaderStageFlagBits
values - If
descriptorType
isDESCRIPTOR_TYPE_INPUT_ATTACHMENT
anddescriptorCount
is not 0, thenstageFlags
must be 0 orSHADER_STAGE_FRAGMENT_BIT
Valid Usage (Implicit)
descriptorType
must be a validVkDescriptorType
value
See Also
VkDescriptorSetLayoutCreateInfo
Member documentation
binding
– the binding number of this entry and corresponds to a resource of the same binding number in the shader stages.descriptorType
– aVkDescriptorType
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 ifdescriptorType
isDESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT
in which casedescriptorCount
is the size in bytes of the inline uniform block . IfdescriptorCount
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 ofVkShaderStageFlagBits
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. IfdescriptorType
specifies aDESCRIPTOR_TYPE_SAMPLER
orDESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER
type descriptor, thenpImmutableSamplers
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 aDESCRIPTOR_TYPE_SAMPLER
descriptor with immutable samplers is not allowed and updates to aDESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER
descriptor with immutable samplers does not modify the samplers (the image views are updated, but the sampler updates are ignored). IfpImmutableSamplers
is 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. IfpImmutableSamplers
isNULL
, then the sampler slots are dynamic and sampler handles must be bound into descriptor sets using this layout. IfdescriptorType
is not one of these descriptor types, thenpImmutableSamplers
is 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 class
VkDescriptorSetLayoutBinding.Buffer
An array ofVkDescriptorSetLayoutBinding
structs.
-
Field Summary
Fields Modifier and Type Field Description static int
ALIGNOF
The struct alignment in bytes.static int
BINDING
DESCRIPTORCOUNT
DESCRIPTORTYPE
PIMMUTABLESAMPLERSThe struct member offsets.static int
SIZEOF
The struct size in bytes.static int
STAGEFLAGS
The struct member offsets.
-
Constructor Summary
Constructors Constructor Description VkDescriptorSetLayoutBinding(java.nio.ByteBuffer container)
Creates aVkDescriptorSetLayoutBinding
instance at the current position of the specifiedByteBuffer
container.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
binding()
Returns the value of thebinding
field.VkDescriptorSetLayoutBinding
binding(int value)
Sets the specified value to thebinding
field.static VkDescriptorSetLayoutBinding
calloc()
Returns a newVkDescriptorSetLayoutBinding
instance allocated withmemCalloc
.static VkDescriptorSetLayoutBinding.Buffer
calloc(int capacity)
Returns a newVkDescriptorSetLayoutBinding.Buffer
instance allocated withmemCalloc
.static VkDescriptorSetLayoutBinding
callocStack()
Returns a newVkDescriptorSetLayoutBinding
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static VkDescriptorSetLayoutBinding.Buffer
callocStack(int capacity)
Returns a newVkDescriptorSetLayoutBinding.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static VkDescriptorSetLayoutBinding.Buffer
callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkDescriptorSetLayoutBinding.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static VkDescriptorSetLayoutBinding
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkDescriptorSetLayoutBinding
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static VkDescriptorSetLayoutBinding
create()
Returns a newVkDescriptorSetLayoutBinding
instance allocated withBufferUtils
.static VkDescriptorSetLayoutBinding.Buffer
create(int capacity)
Returns a newVkDescriptorSetLayoutBinding.Buffer
instance allocated withBufferUtils
.static VkDescriptorSetLayoutBinding
create(long address)
Returns a newVkDescriptorSetLayoutBinding
instance for the specified memory address.static VkDescriptorSetLayoutBinding.Buffer
create(long address, int capacity)
Create aVkDescriptorSetLayoutBinding.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 thedescriptorCount
field.VkDescriptorSetLayoutBinding
descriptorCount(int value)
Sets the specified value to thedescriptorCount
field.int
descriptorType()
Returns the value of thedescriptorType
field.VkDescriptorSetLayoutBinding
descriptorType(int value)
Sets the specified value to thedescriptorType
field.static VkDescriptorSetLayoutBinding
malloc()
Returns a newVkDescriptorSetLayoutBinding
instance allocated withmemAlloc
.static VkDescriptorSetLayoutBinding.Buffer
malloc(int capacity)
Returns a newVkDescriptorSetLayoutBinding.Buffer
instance allocated withmemAlloc
.static VkDescriptorSetLayoutBinding
mallocStack()
Returns a newVkDescriptorSetLayoutBinding
instance allocated on the thread-localMemoryStack
.static VkDescriptorSetLayoutBinding.Buffer
mallocStack(int capacity)
Returns a newVkDescriptorSetLayoutBinding.Buffer
instance allocated on the thread-localMemoryStack
.static VkDescriptorSetLayoutBinding.Buffer
mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkDescriptorSetLayoutBinding.Buffer
instance allocated on the specifiedMemoryStack
.static VkDescriptorSetLayoutBinding
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkDescriptorSetLayoutBinding
instance allocated on the specifiedMemoryStack
.static int
nbinding(long struct)
Unsafe version ofbinding()
.static void
nbinding(long struct, int value)
Unsafe version ofbinding
.static int
ndescriptorCount(long struct)
Unsafe version ofdescriptorCount()
.static void
ndescriptorCount(long struct, int value)
Sets the specified value to thedescriptorCount
field of the specifiedstruct
.static int
ndescriptorType(long struct)
Unsafe version ofdescriptorType()
.static void
ndescriptorType(long struct, int value)
Unsafe version ofdescriptorType
.static java.nio.LongBuffer
npImmutableSamplers(long struct)
Unsafe version ofpImmutableSamplers
.static void
npImmutableSamplers(long struct, java.nio.LongBuffer value)
Unsafe version ofpImmutableSamplers
.static int
nstageFlags(long struct)
Unsafe version ofstageFlags()
.static void
nstageFlags(long struct, int value)
Unsafe version ofstageFlags
.java.nio.LongBuffer
pImmutableSamplers()
Returns aLongBuffer
view of the data pointed to by thepImmutableSamplers
field.VkDescriptorSetLayoutBinding
pImmutableSamplers(java.nio.LongBuffer value)
Sets the address of the specifiedLongBuffer
to thepImmutableSamplers
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 thestageFlags
field.VkDescriptorSetLayoutBinding
stageFlags(int value)
Sets the specified value to thestageFlags
field.
-
-
-
Constructor Detail
-
VkDescriptorSetLayoutBinding
public VkDescriptorSetLayoutBinding(java.nio.ByteBuffer container)
Creates aVkDescriptorSetLayoutBinding
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()
- Specified by:
sizeof
in classorg.lwjgl.system.Struct
-
binding
public int binding()
Returns the value of thebinding
field.
-
descriptorType
public int descriptorType()
Returns the value of thedescriptorType
field.
-
descriptorCount
public int descriptorCount()
Returns the value of thedescriptorCount
field.
-
stageFlags
public int stageFlags()
Returns the value of thestageFlags
field.
-
pImmutableSamplers
@Nullable public java.nio.LongBuffer pImmutableSamplers()
Returns aLongBuffer
view of the data pointed to by thepImmutableSamplers
field.
-
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 specifiedLongBuffer
to 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 newVkDescriptorSetLayoutBinding
instance allocated withmemAlloc
. The instance must be explicitly freed.
-
calloc
public static VkDescriptorSetLayoutBinding calloc()
Returns a newVkDescriptorSetLayoutBinding
instance allocated withmemCalloc
. The instance must be explicitly freed.
-
create
public static VkDescriptorSetLayoutBinding create()
Returns a newVkDescriptorSetLayoutBinding
instance allocated withBufferUtils
.
-
create
public static VkDescriptorSetLayoutBinding create(long address)
Returns a newVkDescriptorSetLayoutBinding
instance for the specified memory address.
-
createSafe
@Nullable public static VkDescriptorSetLayoutBinding createSafe(long address)
-
malloc
public static VkDescriptorSetLayoutBinding.Buffer malloc(int capacity)
Returns a newVkDescriptorSetLayoutBinding.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
public static VkDescriptorSetLayoutBinding.Buffer calloc(int capacity)
Returns a newVkDescriptorSetLayoutBinding.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
public static VkDescriptorSetLayoutBinding.Buffer create(int capacity)
Returns a newVkDescriptorSetLayoutBinding.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
public static VkDescriptorSetLayoutBinding.Buffer create(long address, int capacity)
Create aVkDescriptorSetLayoutBinding.Buffer
instance 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 newVkDescriptorSetLayoutBinding
instance allocated on the thread-localMemoryStack
.
-
callocStack
public static VkDescriptorSetLayoutBinding callocStack()
Returns a newVkDescriptorSetLayoutBinding
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.
-
mallocStack
public static VkDescriptorSetLayoutBinding mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkDescriptorSetLayoutBinding
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
callocStack
public static VkDescriptorSetLayoutBinding callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkDescriptorSetLayoutBinding
instance allocated on the specifiedMemoryStack
and 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.Buffer
instance allocated on the thread-localMemoryStack
.- Parameters:
capacity
- the buffer capacity
-
callocStack
public static VkDescriptorSetLayoutBinding.Buffer callocStack(int capacity)
Returns a newVkDescriptorSetLayoutBinding.Buffer
instance allocated on the thread-localMemoryStack
and 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.Buffer
instance 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.Buffer
instance allocated on the specifiedMemoryStack
and 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 thedescriptorCount
field 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
.
-
-