WIP shaders: fix vello with Raster<GPU>

This commit is contained in:
firestar99
2025-09-07 20:02:46 +02:00
parent af5af7516b
commit 0a052b8d77
2 changed files with 3 additions and 3 deletions

View File

@@ -153,7 +153,7 @@ impl Default for SvgRender {
#[derive(Clone, Debug, Default)]
pub struct RenderContext {
#[cfg(feature = "vello")]
pub resource_overrides: Vec<(peniko::Image, wgpu::Texture)>,
pub resource_overrides: Vec<(peniko::Image, Raster<GPU>)>,
}
/// Static state used whilst rendering
@@ -1326,7 +1326,7 @@ impl Render for Table<Raster<GPU>> {
.with_extend(peniko::Extend::Repeat);
let image_transform = transform * *row.transform * DAffine2::from_scale(1. / DVec2::new(image.width as f64, image.height as f64));
scene.draw_image(&image, kurbo::Affine::new(image_transform.to_cols_array()));
context.resource_overrides.push((image, row.element.data().clone()));
context.resource_overrides.push((image, row.element.clone()));
if layer {
scene.pop_layer()

View File

@@ -140,7 +140,7 @@ impl WgpuExecutor {
let mut renderer = self.vello_renderer.lock().await;
for (image, texture) in context.resource_overrides.iter() {
let texture_view = wgpu::TexelCopyTextureInfoBase {
texture: texture.clone(),
texture: texture.texture.clone(),
mip_level: 0,
origin: Origin3d::ZERO,
aspect: TextureAspect::All,