Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion node-graph/graphene-cli/src/export.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ pub async fn export_document(
let gpu_raster = Raster::<GPU>::new_gpu(image_texture.texture.as_ref().clone());
let cpu_raster: Raster<CPU> = 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);
Comment thread
TrueDoctor marked this conversation as resolved.

// Encode and write raster image
write_raster_image(output_path, file_type, data, width, height, transparent)?;
Expand Down Expand Up @@ -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::<GPU>::new_gpu(image_texture.texture);
let gpu_raster = Raster::<GPU>::new_gpu(image_texture.texture.as_ref().clone());
let cpu_raster: Raster<CPU> = gpu_raster.convert(Footprint::BOUNDLESS, wgpu_executor).await;
// Explicitly drop texture to make sure it lives long enough
std::mem::drop(image_texture);
Comment thread
TrueDoctor marked this conversation as resolved.
cpu_raster.to_flat_u8()
}
RenderOutputType::Buffer { data, width, height } => (data, width, height),
Expand Down
Loading