fn new(program: &mut ProgramContext, constructor: impl FnOnce(&mut FunctionContext)) -> Self {
        let mut func = Function::new_empty();
        let mut ctx = FunctionContext {
            program,
            function: &mut func,
        };

        constructor(&mut ctx);

        func.type_check(program);

        func
    }
/// create a function in a shader
create a function in a shader
create a function in a shader
fn new(program: &mut ProgramContext, constructor: impl FnOnce(&mut FunctionContext)) -> Self {
        let mut func = Function::new_empty();
        let mut ctx = FunctionContext {
            program,
            function: &mut func,
        };
        constructor(&mut ctx);
        func.type_check(program);
        func
    }
fn new ( program : & mut ProgramContext , constructor : impl FnOnce ( & mut FunctionContext ) ) -> Self { let mut func = Function :: new_empty ( ) ; let mut ctx = FunctionContext { program , function : & mut func , } ; constructor ( & mut ctx ) ; func . type_check ( program ) ; func }
create a function in a shader
create a function in a shader
program
&mut ProgramContext
constructor
impl FnOnce(&mut FunctionContext)
program
&mut ProgramContext
constructor
impl FnOnce(&mut FunctionContext)