pub unsafe fn clear_color_image<R>(
        &mut self,
        image: Arc<dyn ImageAccess>,
        layout: ImageLayout,
        color: ClearValue,
        regions: R,
    ) -> Result<(), SyncCommandBufferBuilderError>
    where
        R: IntoIterator<Item = UnsafeCommandBufferBuilderColorImageClear> + Send + Sync + 'static,
    {
        struct Cmd<R> {
            image: Arc<dyn ImageAccess>,
            layout: ImageLayout,
            color: ClearValue,
            regions: Mutex<Option<R>>,
        }

        impl<R> Command for Cmd<R>
        where
            R: IntoIterator<Item = UnsafeCommandBufferBuilderColorImageClear>
                + Send
                + Sync
                + 'static,
        {
            fn name(&self) -> &'static str {
                "vkCmdClearColorImage"
            }

            unsafe fn send(&self, out: &mut UnsafeCommandBufferBuilder) {
                out.clear_color_image(
                    self.image.as_ref(),
                    self.layout,
                    self.color,
                    self.regions.lock().unwrap().take().unwrap(),
                );
            }
        }

        self.append_command(
            Cmd {
                image: image.clone(),
                layout,
                color,
                regions: Mutex::new(Some(regions)),
            },
            [(
                KeyTy::Image(image),
                "target".into(),
                Some((
                    PipelineMemoryAccess {
                        stages: PipelineStages {
                            transfer: true,
                            ..PipelineStages::none()
                        },
                        access: AccessFlags {
                            transfer_write: true,
                            ..AccessFlags::none()
                        },
                        exclusive: true,
                    },
                    layout,
                    layout,
                    ImageUninitializedSafe::Safe,
                )),
            )],
        )?;

        Ok(())
    }
/// Calls `vkCmdClearColorImage` on the builder.
///
/// Does nothing if the list of regions is empty, as it would be a no-op and isn't a valid
/// usage of the command anyway.
Calls `vkCmdClearColorImage` on the builder.
Does nothing if the list of regions is empty, as it would be a no-op and isn't a valid
usage of the command anyway.
Calls ` vkCmdClearColorImage ` on the builder . Does nothing if the list of regions is empty as it would be a no - op and isn ' t a valid usage of the command anyway .
pub unsafe fn clear_color_image<R>(
        &mut self,
        image: Arc<dyn ImageAccess>,
        layout: ImageLayout,
        color: ClearValue,
        regions: R,
    ) -> Result<(), SyncCommandBufferBuilderError>
    where
        R: IntoIterator<Item = UnsafeCommandBufferBuilderColorImageClear> + Send + Sync + 'static,
    {
        struct Cmd<R> {
            image: Arc<dyn ImageAccess>,
            layout: ImageLayout,
            color: ClearValue,
            regions: Mutex<Option<R>>,
        }
        impl<R> Command for Cmd<R>
        where
            R: IntoIterator<Item = UnsafeCommandBufferBuilderColorImageClear>
                + Send
                + Sync
                + 'static,
        {
            fn name(&self) -> &'static str {
                "vkCmdClearColorImage"
            }
            unsafe fn send(&self, out: &mut UnsafeCommandBufferBuilder) {
                out.clear_color_image(
                    self.image.as_ref(),
                    self.layout,
                    self.color,
                    self.regions.lock().unwrap().take().unwrap(),
                );
            }
        }
        self.append_command(
            Cmd {
                image: image.clone(),
                layout,
                color,
                regions: Mutex::new(Some(regions)),
            },
            [(
                KeyTy::Image(image),
                "target".into(),
                Some((
                    PipelineMemoryAccess {
                        stages: PipelineStages {
                            transfer: true,
                            ..PipelineStages::none()
                        },
                        access: AccessFlags {
                            transfer_write: true,
                            ..AccessFlags::none()
                        },
                        exclusive: true,
                    },
                    layout,
                    layout,
                    ImageUninitializedSafe::Safe,
                )),
            )],
        )?;
        Ok(())
    }
pub unsafe fn clear_color_image < R > ( & mut self , image : Arc < dyn ImageAccess > , layout : ImageLayout , color : ClearValue , regions : R , ) -> Result < ( ) , SyncCommandBufferBuilderError > where R : IntoIterator < Item = UnsafeCommandBufferBuilderColorImageClear > + Send + Sync + ' static , { struct Cmd < R > { image : Arc < dyn ImageAccess > , layout : ImageLayout , color : ClearValue , regions : Mutex < Option < R > > , } impl < R > Command for Cmd < R > where R : IntoIterator < Item = UnsafeCommandBufferBuilderColorImageClear > + Send + Sync + ' static , { fn name ( & self ) -> & ' static str { " " } unsafe fn send ( & self , out : & mut UnsafeCommandBufferBuilder ) { out . clear_color_image ( self . image . as_ref ( ) , self . layout , self . color , self . regions . lock ( ) . unwrap ( ) . take ( ) . unwrap ( ) , ) ; } } self . append_command ( Cmd { image : image . clone ( ) , layout , color , regions : Mutex :: new ( Some ( regions ) ) , } , [ ( KeyTy :: Image ( image ) , " " . into ( ) , Some ( ( PipelineMemoryAccess { stages : PipelineStages { transfer : true , .. PipelineStages :: none ( ) } , access : AccessFlags { transfer_write : true , .. AccessFlags :: none ( ) } , exclusive : true , } , layout , layout , ImageUninitializedSafe :: Safe , ) ) , ) ] , ) ? ; Ok ( ( ) ) }
Calls `vkCmdClearColorImage` on the builder.
Calls ` vkCmdClearColorImage ` on the builder .
&mut self
image
Arc<dyn ImageAccess>
layout
ImageLayout
color
ClearValue
regions
R
&mut self
image
Arc<dyn ImageAccess>
layout
ImageLayout
color
ClearValue
regions
R