Struct ccthw::graphics::vulkan_api::ColorPass
source · pub struct ColorPass { /* private fields */ }
Expand description
A utility for managing a render pass and framebuffers which target a given set of images.
The color pass is single-sampled and does not have a depth/stencil buffer.
Implementations§
source§impl ColorPass
impl ColorPass
sourcepub unsafe fn new(
render_device: Arc<RenderDevice>,
swapchain: &Swapchain
) -> Result<Self, GraphicsError>
pub unsafe fn new( render_device: Arc<RenderDevice>, swapchain: &Swapchain ) -> Result<Self, GraphicsError>
Create a render pass with a single coloro attachment which can target all of the provided images.
Params
render_device
- the render device used to create Vulkan resourcesimages
- the images that can be targeted by this render passformat
- the image format for all provided imagesextent
- the extent for all provided images
Safety
Unsafe because:
- the framebuffers are only valid while the swapchain exists
- if the swapchain is rebuilt, the framebuffers should be destroyed and rebuilt too
- the targeted images MUST outlive the ColorPass.
sourcepub fn render_pass(&self) -> &RenderPass
pub fn render_pass(&self) -> &RenderPass
The current render pass.
sourcepub unsafe fn begin_render_pass_inline(
&self,
frame: &Frame,
clear_color: [f32; 4]
)
pub unsafe fn begin_render_pass_inline( &self, frame: &Frame, clear_color: [f32; 4] )
Begin a render pass for the given image index.
Safety
Unsafe because:
image_index
is not checked, it is expected to be between 0 and the number of images given when the CololPass was created.- the ColorPass must not be destroyed until the command buffer finishes executing or is discarded.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for ColorPass
impl !Send for ColorPass
impl !Sync for ColorPass
impl Unpin for ColorPass
impl UnwindSafe for ColorPass
Blanket Implementations§
source§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,
source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read moresource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.