vulkano_taskgraph/command_buffer/commands/
render_pass.rs

1use crate::command_buffer::{RecordingCommandBuffer, Result};
2use vulkano::command_buffer::{ClearAttachment, ClearRect};
3
4/// # Commands for render passes
5///
6/// These commands require a graphics queue.
7impl RecordingCommandBuffer<'_> {
8    /// Clears specific regions of specific attachments of the framebuffer.
9    ///
10    /// `attachments` specify the types of attachments and their clear values. `rects` specify the
11    /// regions to clear.
12    ///
13    /// If the render pass instance this is recorded in uses multiview then
14    /// [`ClearRect::base_array_layer`] must be zero and [`ClearRect::layer_count`] must be one.
15    ///
16    /// The rectangle area must be inside the render area ranges.
17    pub unsafe fn clear_attachments(
18        &mut self,
19        attachments: &[ClearAttachment],
20        rects: &[ClearRect],
21    ) -> Result<&mut Self> {
22        Ok(unsafe { self.clear_attachments_unchecked(attachments, rects) })
23    }
24
25    pub unsafe fn clear_attachments_unchecked(
26        &mut self,
27        attachments: &[ClearAttachment],
28        rects: &[ClearRect],
29    ) -> &mut Self {
30        unsafe { self.inner.clear_attachments_unchecked(attachments, rects) };
31
32        self
33    }
34}