Struct vulkano::descriptor_set::WriteDescriptorSet
source · pub struct WriteDescriptorSet { /* private fields */ }
Expand description
Represents a single write operation to the binding of a descriptor set.
WriteDescriptorSet
specifies the binding number and target array index, and includes one or
more resources of a given type that need to be written to that location. Two constructors are
provided for each resource type:
- The basic constructor variant writes a single element to array index 0. It is intended for
non-arrayed bindings, where
descriptor_count
in the descriptor set layout is 1. - The
_array
variant writes several elements and allows specifying the target array index. At least one element must be provided; a panic results if the provided iterator is empty.
Implementations§
source§impl WriteDescriptorSet
impl WriteDescriptorSet
sourcepub fn none(binding: u32) -> Self
pub fn none(binding: u32) -> Self
Write an empty element to array element 0.
This is used for push descriptors in combination with Sampler
descriptors that have
immutable samplers in the layout. The Vulkan spec requires these elements to be explicitly
written, but since there is no data to write, a dummy write is provided instead.
For regular descriptor sets, the data for such descriptors is automatically valid, and dummy writes are not allowed.
sourcepub fn none_array(
binding: u32,
first_array_element: u32,
num_elements: u32
) -> Self
pub fn none_array( binding: u32, first_array_element: u32, num_elements: u32 ) -> Self
Write a number of consecutive empty elements.
See none
for more information.
sourcepub fn buffer(binding: u32, buffer: Subbuffer<impl ?Sized>) -> Self
pub fn buffer(binding: u32, buffer: Subbuffer<impl ?Sized>) -> Self
Write a single buffer to array element 0, with the bound range covering the whole buffer.
For dynamic buffer bindings, this will bind the whole buffer, and only a dynamic offset
of zero will be valid, which is probably not what you want.
Use buffer_with_range
instead.
sourcepub fn buffer_array(
binding: u32,
first_array_element: u32,
elements: impl IntoIterator<Item = Subbuffer<impl ?Sized>>
) -> Self
pub fn buffer_array( binding: u32, first_array_element: u32, elements: impl IntoIterator<Item = Subbuffer<impl ?Sized>> ) -> Self
Write a number of consecutive buffer elements.
See buffer
for more information.
sourcepub fn buffer_with_range(
binding: u32,
buffer_info: DescriptorBufferInfo
) -> Self
pub fn buffer_with_range( binding: u32, buffer_info: DescriptorBufferInfo ) -> Self
Write a single buffer to array element 0, specifying the range of the buffer to be bound.
sourcepub fn buffer_with_range_array(
binding: u32,
first_array_element: u32,
elements: impl IntoIterator<Item = DescriptorBufferInfo>
) -> Self
pub fn buffer_with_range_array( binding: u32, first_array_element: u32, elements: impl IntoIterator<Item = DescriptorBufferInfo> ) -> Self
Write a number of consecutive buffer elements, specifying the ranges of the buffers to be bound.
See buffer_with_range
for more information.
sourcepub fn buffer_view(binding: u32, buffer_view: Arc<BufferView>) -> Self
pub fn buffer_view(binding: u32, buffer_view: Arc<BufferView>) -> Self
Write a single buffer view to array element 0.
sourcepub fn buffer_view_array(
binding: u32,
first_array_element: u32,
elements: impl IntoIterator<Item = Arc<BufferView>>
) -> Self
pub fn buffer_view_array( binding: u32, first_array_element: u32, elements: impl IntoIterator<Item = Arc<BufferView>> ) -> Self
Write a number of consecutive buffer view elements.
sourcepub fn image_view(binding: u32, image_view: Arc<ImageView>) -> Self
pub fn image_view(binding: u32, image_view: Arc<ImageView>) -> Self
Write a single image view to array element 0, using the Undefined
image layout,
which will be automatically replaced with an appropriate default layout.
sourcepub fn image_view_array(
binding: u32,
first_array_element: u32,
elements: impl IntoIterator<Item = Arc<ImageView>>
) -> Self
pub fn image_view_array( binding: u32, first_array_element: u32, elements: impl IntoIterator<Item = Arc<ImageView>> ) -> Self
Write a number of consecutive image view elements, using the Undefined
image layout,
which will be automatically replaced with an appropriate default layout.
sourcepub fn image_view_with_layout(
binding: u32,
image_view_info: DescriptorImageViewInfo
) -> Self
pub fn image_view_with_layout( binding: u32, image_view_info: DescriptorImageViewInfo ) -> Self
Write a single image view to array element 0, specifying the layout of the image to be bound.
sourcepub fn image_view_with_layout_array(
binding: u32,
first_array_element: u32,
elements: impl IntoIterator<Item = DescriptorImageViewInfo>
) -> Self
pub fn image_view_with_layout_array( binding: u32, first_array_element: u32, elements: impl IntoIterator<Item = DescriptorImageViewInfo> ) -> Self
Write a number of consecutive image view elements, specifying the layouts of the images to be bound.
sourcepub fn image_view_sampler(
binding: u32,
image_view: Arc<ImageView>,
sampler: Arc<Sampler>
) -> Self
pub fn image_view_sampler( binding: u32, image_view: Arc<ImageView>, sampler: Arc<Sampler> ) -> Self
Write a single image view and sampler to array element 0,
using the Undefined
image layout, which will be automatically replaced with
an appropriate default layout.
sourcepub fn image_view_sampler_array(
binding: u32,
first_array_element: u32,
elements: impl IntoIterator<Item = (Arc<ImageView>, Arc<Sampler>)>
) -> Self
pub fn image_view_sampler_array( binding: u32, first_array_element: u32, elements: impl IntoIterator<Item = (Arc<ImageView>, Arc<Sampler>)> ) -> Self
Write a number of consecutive image view and sampler elements,
using the Undefined
image layout, which will be automatically replaced with
an appropriate default layout.
sourcepub fn image_view_with_layout_sampler(
binding: u32,
image_view_info: DescriptorImageViewInfo,
sampler: Arc<Sampler>
) -> Self
pub fn image_view_with_layout_sampler( binding: u32, image_view_info: DescriptorImageViewInfo, sampler: Arc<Sampler> ) -> Self
Write a single image view and sampler to array element 0, specifying the layout of the image to be bound.
sourcepub fn image_view_with_layout_sampler_array(
binding: u32,
first_array_element: u32,
elements: impl IntoIterator<Item = (DescriptorImageViewInfo, Arc<Sampler>)>
) -> Self
pub fn image_view_with_layout_sampler_array( binding: u32, first_array_element: u32, elements: impl IntoIterator<Item = (DescriptorImageViewInfo, Arc<Sampler>)> ) -> Self
Write a number of consecutive image view and sampler elements, specifying the layout of the image to be bound.
sourcepub fn sampler(binding: u32, sampler: Arc<Sampler>) -> Self
pub fn sampler(binding: u32, sampler: Arc<Sampler>) -> Self
Write a single sampler to array element 0.
sourcepub fn sampler_array(
binding: u32,
first_array_element: u32,
elements: impl IntoIterator<Item = Arc<Sampler>>
) -> Self
pub fn sampler_array( binding: u32, first_array_element: u32, elements: impl IntoIterator<Item = Arc<Sampler>> ) -> Self
Write a number of consecutive sampler elements.
sourcepub fn inline_uniform_block(binding: u32, offset: u32, data: Vec<u8>) -> Self
pub fn inline_uniform_block(binding: u32, offset: u32, data: Vec<u8>) -> Self
Write data to an inline uniform block.
offset
and the length of data
must be a multiple of 4.
sourcepub fn acceleration_structure(
binding: u32,
acceleration_structure: Arc<AccelerationStructure>
) -> Self
pub fn acceleration_structure( binding: u32, acceleration_structure: Arc<AccelerationStructure> ) -> Self
Write a single acceleration structure to array element 0.
sourcepub fn acceleration_structure_array(
binding: u32,
first_array_element: u32,
elements: impl IntoIterator<Item = Arc<AccelerationStructure>>
) -> Self
pub fn acceleration_structure_array( binding: u32, first_array_element: u32, elements: impl IntoIterator<Item = Arc<AccelerationStructure>> ) -> Self
Write a number of consecutive acceleration structure elements.
sourcepub fn binding(&self) -> u32
pub fn binding(&self) -> u32
Returns the binding number that is updated by this descriptor write.
sourcepub fn first_array_element(&self) -> u32
pub fn first_array_element(&self) -> u32
Returns the first array element in the binding that is updated by this descriptor write.
sourcepub fn elements(&self) -> &WriteDescriptorSetElements
pub fn elements(&self) -> &WriteDescriptorSetElements
Returns a reference to the elements held by this descriptor write.
Trait Implementations§
source§impl Clone for WriteDescriptorSet
impl Clone for WriteDescriptorSet
source§fn clone(&self) -> WriteDescriptorSet
fn clone(&self) -> WriteDescriptorSet
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more