diff --git a/node-graph/graph-craft/Cargo.toml b/node-graph/graph-craft/Cargo.toml index d82f73e387..db2fdd5756 100644 --- a/node-graph/graph-craft/Cargo.toml +++ b/node-graph/graph-craft/Cargo.toml @@ -6,7 +6,7 @@ license = "MIT OR Apache-2.0" authors.workspace = true [features] -default = ["dealloc_nodes", "wgpu"] +default = ["dealloc_nodes", "wgpu", "loading"] dealloc_nodes = ["core-types/dealloc_nodes"] wgpu = ["wgpu-executor"] tokio = ["dep:tokio"] diff --git a/node-graph/graphene-cli/Cargo.toml b/node-graph/graphene-cli/Cargo.toml index b5dcfd71fd..05e3b78705 100644 --- a/node-graph/graphene-cli/Cargo.toml +++ b/node-graph/graphene-cli/Cargo.toml @@ -24,7 +24,7 @@ futures = { workspace = true } fern = { workspace = true } chrono = { workspace = true } wgpu = { workspace = true } -tokio = { workspace = true, features = ["rt-multi-thread"] } +tokio = { workspace = true } clap = { workspace = true, features = ["cargo", "derive"] } image = { workspace = true } wgpu-executor = { workspace = true, optional = true } diff --git a/node-graph/graphene-cli/src/export.rs b/node-graph/graphene-cli/src/export.rs index 5c4b54cbc3..558d6b5206 100644 --- a/node-graph/graphene-cli/src/export.rs +++ b/node-graph/graphene-cli/src/export.rs @@ -72,6 +72,8 @@ pub async fn export_document( let gpu_raster = Raster::::new_gpu(image_texture.texture.as_ref().clone()); let cpu_raster: Raster = gpu_raster.convert(Footprint::BOUNDLESS, wgpu_executor).await; let (data, width, height) = cpu_raster.to_flat_u8(); + // Explicitly drop texture to make sure it lives long enough + std::mem::drop(image_texture); // Encode and write raster image write_raster_image(output_path, file_type, data, width, height, transparent)?; @@ -200,8 +202,10 @@ pub async fn export_gif( let (data, img_width, img_height) = match result { TaggedValue::RenderOutput(output) => match output.data { RenderOutputType::Texture(image_texture) => { - let gpu_raster = Raster::::new_gpu(image_texture.texture); + let gpu_raster = Raster::::new_gpu(image_texture.texture.as_ref().clone()); let cpu_raster: Raster = gpu_raster.convert(Footprint::BOUNDLESS, wgpu_executor).await; + // Explicitly drop texture to make sure it lives long enough + std::mem::drop(image_texture); cpu_raster.to_flat_u8() } RenderOutputType::Buffer { data, width, height } => (data, width, height),