From de8bdc72093d63bf0a2abe970f85b97398d64502 Mon Sep 17 00:00:00 2001 From: Dennis Kobert Date: Fri, 19 Sep 2025 20:52:04 +0200 Subject: [PATCH] Make texture size not 1x1 --- .../wgpu-executor/src/vector_to_raster.rs | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/node-graph/libraries/wgpu-executor/src/vector_to_raster.rs b/node-graph/libraries/wgpu-executor/src/vector_to_raster.rs index af237ef70..b9770d84b 100644 --- a/node-graph/libraries/wgpu-executor/src/vector_to_raster.rs +++ b/node-graph/libraries/wgpu-executor/src/vector_to_raster.rs @@ -22,7 +22,7 @@ impl<'i> Convert>, &'i WgpuExecutor> for Table { log::debug!("rasterizing vector data with footprint {footprint:?}"); let vector = &self; - log::debug!("{:?}", vector); + log::debug!("{vector:?}"); // Create a Vello scene for this vector let mut scene = vello::Scene::new(); @@ -33,18 +33,14 @@ impl<'i> Convert>, &'i WgpuExecutor> for Table { // Render the scene to a GPU texture let resolution = footprint.resolution; - let background = core_types::Color::BLACK; + let background = core_types::Color::TRANSPARENT; // Use async rendering to get the texture - let texture = async { - executor - .render_vello_scene_to_texture(&scene, resolution, &context, background) - .await - .expect("Failed to render Vello scene to texture") - }; + let texture = executor + .render_vello_scene_to_texture(&scene, resolution, &context, background) + .await + .expect("Failed to render Vello scene to texture"); - // Block on the texture creation (we're in an async context) - let texture = futures::executor::block_on(texture); let device = &executor.context.device; let queue = &executor.context.queue; let mut encoder = device.create_command_encoder(&CommandEncoderDescriptor::default()); @@ -70,6 +66,8 @@ impl<'i> Convert>, &'i WgpuExecutor> for Table { let command_buffer = encoder.finish(); queue.submit([command_buffer]); - Table::new_from_element(Raster::new_gpu(new_texture)) + let mut table = Table::new_from_element(Raster::new_gpu(new_texture)); + *(table.get_mut(0).as_mut().unwrap().transform) = DAffine2::from_scale((texture.width() as f64, texture.height() as f64).into()); + table } }