naga::back::pipeline_constants

Function process_overrides

Source
pub fn process_overrides<'a>(
    module: &'a Module,
    module_info: &'a ModuleInfo,
    pipeline_constants: &PipelineConstants,
) -> Result<(Cow<'a, Module>, Cow<'a, ModuleInfo>), PipelineConstantError>
Expand description

Replace all overrides in module with constants.

If no changes are needed, this just returns Cow::Borrowed references to module and module_info. Otherwise, it clones module, edits its global_expressions arena to contain only fully-evaluated expressions, and returns Cow::Owned values holding the simplified module and its validation results.

In either case, the module returned has an empty overrides arena, and the global_expressions arena contains only fully-evaluated expressions.