Enum vulkano::descriptor_set::layout::DescriptorType
source · #[non_exhaustive]#[repr(i32)]pub enum DescriptorType {
Show 13 variants
Sampler = 0,
CombinedImageSampler = 1,
SampledImage = 2,
StorageImage = 3,
UniformTexelBuffer = 4,
StorageTexelBuffer = 5,
UniformBuffer = 6,
StorageBuffer = 7,
UniformBufferDynamic = 8,
StorageBufferDynamic = 9,
InputAttachment = 10,
InlineUniformBlock = 1_000_138_000,
AccelerationStructure = 1_000_150_000,
}
Expand description
Describes what kind of resource may later be bound to a descriptor.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Sampler = 0
Describes how a SampledImage
descriptor should be read.
CombinedImageSampler = 1
Combines SampledImage
and Sampler
in one descriptor.
SampledImage = 2
Gives read-only access to an image via a sampler. The image must be combined with a sampler inside the shader.
StorageImage = 3
Gives read and/or write access to individual pixels in an image. The image cannot be sampled, so you have exactly specify which pixel to read or write.
UniformTexelBuffer = 4
Gives read-only access to the content of a buffer, interpreted as an array of texel data.
StorageTexelBuffer = 5
Gives read and/or write access to the content of a buffer, interpreted as an array of texel data. Less restrictive but sometimes slower than a uniform texel buffer.
UniformBuffer = 6
Gives read-only access to the content of a buffer, interpreted as a structure.
StorageBuffer = 7
Gives read and/or write access to the content of a buffer, interpreted as a structure. Less restrictive but sometimes slower than a uniform buffer.
UniformBufferDynamic = 8
As UniformBuffer
, but the offset within the buffer is specified at the time the descriptor
set is bound, rather than when the descriptor set is updated.
StorageBufferDynamic = 9
As StorageBuffer
, but the offset within the buffer is specified at the time the descriptor
set is bound, rather than when the descriptor set is updated.
InputAttachment = 10
Gives access to an image inside a fragment shader via a render pass. You can only access the pixel that is currently being processed by the fragment shader.
InlineUniformBlock = 1_000_138_000
Very similar to UniformBuffer
, but the data is written directly into an inline buffer
inside the descriptor set, instead of writing a reference to a buffer.
This is similar to push constants, but because the data is stored in the descriptor set
rather than the command buffer, it can be bound multiple times and reused, and you can
have more than one of them bound in a single shader.
It is not possible to have an arrayed binding of inline uniform blocks; at most one inline uniform block can be bound to one binding.
Within a shader, an inline uniform block is defined exactly the same as a uniform buffer. The Vulkan API acts as if every byte in the inline buffer were its own descriptor:
- The
descriptor_count
value specifies the number of bytes available for data. - The
variable_descriptor_count
value when allocating a descriptor set specifies a variable byte count instead. - The
first_array_element
value when writing a descriptor set specifies the byte offset into the inline buffer. These values must always be a multiple of 4.
AccelerationStructure = 1_000_150_000
Gives read access to an acceleration structure, for performing ray queries and ray tracing.
Trait Implementations§
source§impl Clone for DescriptorType
impl Clone for DescriptorType
source§fn clone(&self) -> DescriptorType
fn clone(&self) -> DescriptorType
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for DescriptorType
impl Debug for DescriptorType
source§impl From<DescriptorType> for DescriptorType
impl From<DescriptorType> for DescriptorType
source§fn from(val: DescriptorType) -> Self
fn from(val: DescriptorType) -> Self
source§impl Hash for DescriptorType
impl Hash for DescriptorType
source§impl PartialEq for DescriptorType
impl PartialEq for DescriptorType
source§fn eq(&self, other: &DescriptorType) -> bool
fn eq(&self, other: &DescriptorType) -> bool
self
and other
values to be equal, and is used
by ==
.