pub fn begin_block_no_label(
        &mut self,
        label_id: Option<spirv::Word>,
    ) -> BuildResult<spirv::Word> {
        let selected_function = match self.selected_function {
            Some(f) => f,
            None => return Err(Error::DetachedBlock),
        };
        if self.selected_block.is_some() {
            return Err(Error::NestedBlock);
        }

        let id = match label_id {
            Some(v) => v,
            None => self.id(),
        };

        let bb = dr::Block::new();
        let blocks = &mut self.module.functions[selected_function].blocks;
        blocks.push(bb);
        self.selected_block = Some(blocks.len() - 1);
        Ok(id)
    }
/// Begins building of a new block.
///
/// Counter to `begin_block` that always generates a new OpLabel at the beginning of a block - in some cases
/// this is undesirable (such as when constructing a branch).
Begins building of a new block.
Counter to `begin_block` that always generates a new OpLabel at the beginning of a block - in some cases
this is undesirable (such as when constructing a branch).
Begins building of a new block . Counter to ` begin_block ` that always generates a new OpLabel at the beginning of a block - in some cases this is undesirable ( such as when constructing a branch ) .
pub fn begin_block_no_label(
        &mut self,
        label_id: Option<spirv::Word>,
    ) -> BuildResult<spirv::Word> {
        let selected_function = match self.selected_function {
            Some(f) => f,
            None => return Err(Error::DetachedBlock),
        };
        if self.selected_block.is_some() {
            return Err(Error::NestedBlock);
        }
        let id = match label_id {
            Some(v) => v,
            None => self.id(),
        };
        let bb = dr::Block::new();
        let blocks = &mut self.module.functions[selected_function].blocks;
        blocks.push(bb);
        self.selected_block = Some(blocks.len() - 1);
        Ok(id)
    }
pub fn begin_block_no_label ( & mut self , label_id : Option < spirv :: Word > , ) -> BuildResult < spirv :: Word > { let selected_function = match self . selected_function { Some ( f ) => f , None => return Err ( Error :: DetachedBlock ) , } ; if self . selected_block . is_some ( ) { return Err ( Error :: NestedBlock ) ; } let id = match label_id { Some ( v ) => v , None => self . id ( ) , } ; let bb = dr :: Block :: new ( ) ; let blocks = & mut self . module . functions [ selected_function ] . blocks ; blocks . push ( bb ) ; self . selected_block = Some ( blocks . len ( ) - 1 ) ; Ok ( id ) }
Begins building of a new block.
Begins building of a new block .
&mut self
label_id
Option<spirv::Word>
&mut self
label_id
Option<spirv::Word>