Skip to content

Commit eb30ee7

Browse files
authored
Fix Grapene CLI compilation (#3892)
* Fix grapene-cli compilation * Improve cargo features to reduce recompiles
1 parent a3f88b0 commit eb30ee7

3 files changed

Lines changed: 7 additions & 3 deletions

File tree

node-graph/graph-craft/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ license = "MIT OR Apache-2.0"
66
authors.workspace = true
77

88
[features]
9-
default = ["dealloc_nodes", "wgpu"]
9+
default = ["dealloc_nodes", "wgpu", "loading"]
1010
dealloc_nodes = ["core-types/dealloc_nodes"]
1111
wgpu = ["wgpu-executor"]
1212
tokio = ["dep:tokio"]

node-graph/graphene-cli/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ futures = { workspace = true }
2424
fern = { workspace = true }
2525
chrono = { workspace = true }
2626
wgpu = { workspace = true }
27-
tokio = { workspace = true, features = ["rt-multi-thread"] }
27+
tokio = { workspace = true }
2828
clap = { workspace = true, features = ["cargo", "derive"] }
2929
image = { workspace = true }
3030
wgpu-executor = { workspace = true, optional = true }

node-graph/graphene-cli/src/export.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ pub async fn export_document(
7272
let gpu_raster = Raster::<GPU>::new_gpu(image_texture.texture.as_ref().clone());
7373
let cpu_raster: Raster<CPU> = gpu_raster.convert(Footprint::BOUNDLESS, wgpu_executor).await;
7474
let (data, width, height) = cpu_raster.to_flat_u8();
75+
// Explicitly drop texture to make sure it lives long enough
76+
std::mem::drop(image_texture);
7577

7678
// Encode and write raster image
7779
write_raster_image(output_path, file_type, data, width, height, transparent)?;
@@ -200,8 +202,10 @@ pub async fn export_gif(
200202
let (data, img_width, img_height) = match result {
201203
TaggedValue::RenderOutput(output) => match output.data {
202204
RenderOutputType::Texture(image_texture) => {
203-
let gpu_raster = Raster::<GPU>::new_gpu(image_texture.texture);
205+
let gpu_raster = Raster::<GPU>::new_gpu(image_texture.texture.as_ref().clone());
204206
let cpu_raster: Raster<CPU> = gpu_raster.convert(Footprint::BOUNDLESS, wgpu_executor).await;
207+
// Explicitly drop texture to make sure it lives long enough
208+
std::mem::drop(image_texture);
205209
cpu_raster.to_flat_u8()
206210
}
207211
RenderOutputType::Buffer { data, width, height } => (data, width, height),

0 commit comments

Comments
 (0)