mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-17 23:38:06 +08:00
WIP shaders: fix vello with Raster<GPU>
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user