fn is_builtin(doc: &parse::Spirv, id: u32) -> bool {
    for instruction in &doc.instructions {
        match *instruction {
            parse::Instruction::Decorate {
                target_id,
                decoration: enums::Decoration::DecorationBuiltIn,
                ..
            } if target_id == id => {
                return true;
            },
            parse::Instruction::MemberDecorate {
                target_id,
                decoration: enums::Decoration::DecorationBuiltIn,
                ..
            } if target_id == id => {
                return true;
            },
            _ => (),
        }
    }

    for instruction in &doc.instructions {
        match *instruction {
            parse::Instruction::Variable {
                result_type_id,
                result_id,
                ..
            } if result_id == id => {
                return is_builtin(doc, result_type_id);
            },
            parse::Instruction::TypeArray { result_id, type_id, .. } if result_id == id => {
                return is_builtin(doc, type_id);
            },
            parse::Instruction::TypeRuntimeArray { result_id, type_id } if result_id == id => {
                return is_builtin(doc, type_id);
            },
            parse::Instruction::TypeStruct {
                result_id,
                ref member_types,
            } if result_id == id => {
                for &mem in member_types {
                    if is_builtin(doc, mem) {
                        return true;
                    }
                }
            },
            parse::Instruction::TypePointer { result_id, type_id, .. } if result_id == id => {
                return is_builtin(doc, type_id);
            },
            _ => (),
        }
    }

    false
}
/// Returns true if a `BuiltIn` decorator is applied on an id.
Returns true if a `BuiltIn` decorator is applied on an id.
Returns true if a ` BuiltIn ` decorator is applied on an id .
fn is_builtin(doc: &parse::Spirv, id: u32) -> bool {
    for instruction in &doc.instructions {
        match *instruction {
            parse::Instruction::Decorate {
                target_id,
                decoration: enums::Decoration::DecorationBuiltIn,
                ..
            } if target_id == id => {
                return true;
            },
            parse::Instruction::MemberDecorate {
                target_id,
                decoration: enums::Decoration::DecorationBuiltIn,
                ..
            } if target_id == id => {
                return true;
            },
            _ => (),
        }
    }
    for instruction in &doc.instructions {
        match *instruction {
            parse::Instruction::Variable {
                result_type_id,
                result_id,
                ..
            } if result_id == id => {
                return is_builtin(doc, result_type_id);
            },
            parse::Instruction::TypeArray { result_id, type_id, .. } if result_id == id => {
                return is_builtin(doc, type_id);
            },
            parse::Instruction::TypeRuntimeArray { result_id, type_id } if result_id == id => {
                return is_builtin(doc, type_id);
            },
            parse::Instruction::TypeStruct {
                result_id,
                ref member_types,
            } if result_id == id => {
                for &mem in member_types {
                    if is_builtin(doc, mem) {
                        return true;
                    }
                }
            },
            parse::Instruction::TypePointer { result_id, type_id, .. } if result_id == id => {
                return is_builtin(doc, type_id);
            },
            _ => (),
        }
    }
    false
}
fn is_builtin ( doc : & parse :: Spirv , id : u32 ) -> bool { for instruction in & doc . instructions { match * instruction { parse :: Instruction :: Decorate { target_id , decoration : enums :: Decoration :: DecorationBuiltIn , .. } if target_id == id => { return true ; } , parse :: Instruction :: MemberDecorate { target_id , decoration : enums :: Decoration :: DecorationBuiltIn , .. } if target_id == id => { return true ; } , _ => ( ) , } } for instruction in & doc . instructions { match * instruction { parse :: Instruction :: Variable { result_type_id , result_id , .. } if result_id == id => { return is_builtin ( doc , result_type_id ) ; } , parse :: Instruction :: TypeArray { result_id , type_id , .. } if result_id == id => { return is_builtin ( doc , type_id ) ; } , parse :: Instruction :: TypeRuntimeArray { result_id , type_id } if result_id == id => { return is_builtin ( doc , type_id ) ; } , parse :: Instruction :: TypeStruct { result_id , ref member_types , } if result_id == id => { for & mem in member_types { if is_builtin ( doc , mem ) { return true ; } } } , parse :: Instruction :: TypePointer { result_id , type_id , .. } if result_id == id => { return is_builtin ( doc , type_id ) ; } , _ => ( ) , } } false }
Returns true if a `BuiltIn` decorator is applied on an id.
Returns true if a ` BuiltIn ` decorator is applied on an id .
doc
&parse::Spirv
id
u32
doc
&parse::Spirv
id
u32