mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-15 22:28:10 +08:00
Require a node registry to compile so the layout pass always runs
This commit is contained in:
@@ -12,7 +12,7 @@ pub fn setup_network(name: &str) -> (DynamicExecutor, ProtoNetwork) {
|
||||
let mut network = wrap_network_in_scope(network, editor_api);
|
||||
let preprocessor = preprocessor::Preprocessor::new();
|
||||
preprocessor.preprocess(&mut network, &|_| None).unwrap();
|
||||
let proto_network = compile(network);
|
||||
let proto_network = compile(network, &interpreted_executor::node_registry::NODE_REGISTRY);
|
||||
let executor = DynamicExecutor::new(proto_network.clone()).unwrap();
|
||||
(executor, proto_network)
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ use interpreted_executor::dynamic_executor::DynamicExecutor;
|
||||
|
||||
fn update_executor<M: Measurement>(name: &str, c: &mut BenchmarkGroup<M>) {
|
||||
let network = load_from_name(name);
|
||||
let proto_network = compile(network);
|
||||
let proto_network = compile(network, &interpreted_executor::node_registry::NODE_REGISTRY);
|
||||
|
||||
c.bench_function(name, |b| {
|
||||
b.iter_batched(
|
||||
@@ -28,7 +28,7 @@ fn update_executor_demo(c: &mut Criterion) {
|
||||
|
||||
fn run_once<M: Measurement>(name: &str, c: &mut BenchmarkGroup<M>) {
|
||||
let network = load_from_name(name);
|
||||
let proto_network = compile(network);
|
||||
let proto_network = compile(network, &interpreted_executor::node_registry::NODE_REGISTRY);
|
||||
|
||||
let executor = DynamicExecutor::new(proto_network).unwrap();
|
||||
let footprint = Footprint::default();
|
||||
|
||||
@@ -44,7 +44,7 @@ mod tests {
|
||||
use graph_craft::graphene_compiler::Compiler;
|
||||
|
||||
let compiler = Compiler {};
|
||||
let protograph = compiler.compile_single(network, Some(&crate::node_registry::NODE_REGISTRY)).expect("Graph should be generated");
|
||||
let protograph = compiler.compile_single(network, &crate::node_registry::NODE_REGISTRY).expect("Graph should be generated");
|
||||
|
||||
let _exec = DynamicExecutor::new(protograph).map(|_e| panic!("The network should not type check ")).unwrap_err();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user