mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-23 21:18:12 +08:00
Fix
This commit is contained in:
@@ -73,7 +73,7 @@ pub fn wrap_network_in_scope(network: NodeNetwork, editor_api: Arc<PlatformEdito
|
||||
DocumentNode {
|
||||
call_argument: concrete!(Context),
|
||||
inputs: vec![
|
||||
NodeInput::scope(graphene_std::render_background::composit_background_pipeline::IDENTIFIER),
|
||||
NodeInput::scope(graphene_std::render_background::composite_background_pipeline::IDENTIFIER),
|
||||
NodeInput::node(NodeId(3), 0),
|
||||
],
|
||||
implementation: DocumentNodeImplementation::ProtoNode(graphene_std::render_background::render_background::IDENTIFIER),
|
||||
|
||||
@@ -14,7 +14,7 @@ use wgpu_executor::{AsyncWgpuPipeline, WgpuExecutor, WgpuPipelineCache};
|
||||
#[node_macro::node(category(""))]
|
||||
async fn render_background<'a: 'n>(
|
||||
ctx: impl Ctx + ExtractFootprint + ExtractVarArgs,
|
||||
#[scope(composit_background_pipeline::IDENTIFIER)] pipeline: WgpuPipelineCache,
|
||||
#[scope(composite_background_pipeline::IDENTIFIER)] pipeline: WgpuPipelineCache,
|
||||
data: RenderOutput,
|
||||
) -> RenderOutput {
|
||||
let footprint = ctx.footprint();
|
||||
@@ -36,7 +36,7 @@ async fn render_background<'a: 'n>(
|
||||
RenderOutputType::Texture(foreground_texture) => {
|
||||
let doc_to_screen = (glam::DAffine2::from_scale(glam::DVec2::splat(render_params.scale)) * render_params.footprint.transform).as_affine2();
|
||||
let blended = pipeline
|
||||
.run::<CompositBackground>(&CompositBackgroundArgs {
|
||||
.run::<CompositeBackground>(&CompositeBackgroundArgs {
|
||||
foreground: foreground_texture.as_ref(),
|
||||
backgrounds: &metadata.backgrounds,
|
||||
document_to_screen: doc_to_screen,
|
||||
@@ -118,18 +118,18 @@ async fn render_background<'a: 'n>(
|
||||
}
|
||||
|
||||
#[node_macro::node(category(""), inject_scope)]
|
||||
async fn composit_background_pipeline<'a: 'n>(
|
||||
async fn composite_background_pipeline<'a: 'n>(
|
||||
_ctx: impl Ctx,
|
||||
#[scope(crate::platform_application_io::try_wgpu_executor::IDENTIFIER)] executor: Option<&'a WgpuExecutor>,
|
||||
#[data] pipeline: WgpuPipelineCache,
|
||||
) -> WgpuPipelineCache {
|
||||
if let Some(executor) = executor {
|
||||
executor.pipeline_init::<CompositBackground>(pipeline);
|
||||
executor.pipeline_init::<CompositeBackground>(pipeline);
|
||||
}
|
||||
pipeline.clone()
|
||||
}
|
||||
|
||||
pub struct CompositBackground {
|
||||
pub struct CompositeBackground {
|
||||
checker_rect_pipeline: wgpu::RenderPipeline,
|
||||
checker_viewport_pipeline: wgpu::RenderPipeline,
|
||||
fullscreen_pipeline: wgpu::RenderPipeline,
|
||||
@@ -138,15 +138,15 @@ pub struct CompositBackground {
|
||||
sampler: wgpu::Sampler,
|
||||
}
|
||||
|
||||
pub struct CompositBackgroundArgs<'a> {
|
||||
pub struct CompositeBackgroundArgs<'a> {
|
||||
foreground: &'a wgpu::Texture,
|
||||
backgrounds: &'a [rendering::Background],
|
||||
document_to_screen: Affine2,
|
||||
zoom: f32,
|
||||
}
|
||||
|
||||
impl AsyncWgpuPipeline for CompositBackground {
|
||||
type Args<'a> = CompositBackgroundArgs<'a>;
|
||||
impl AsyncWgpuPipeline for CompositeBackground {
|
||||
type Args<'a> = CompositeBackgroundArgs<'a>;
|
||||
type Out = Arc<wgpu::Texture>;
|
||||
|
||||
fn create(executor: &WgpuExecutor) -> Self {
|
||||
@@ -329,7 +329,7 @@ impl AsyncWgpuPipeline for CompositBackground {
|
||||
}
|
||||
|
||||
async fn run<'a>(&'a self, executor: &'a WgpuExecutor, args: &'a Self::Args<'_>) -> Self::Out {
|
||||
let &CompositBackgroundArgs {
|
||||
let &CompositeBackgroundArgs {
|
||||
foreground,
|
||||
backgrounds,
|
||||
document_to_screen,
|
||||
@@ -439,7 +439,7 @@ impl AsyncWgpuPipeline for CompositBackground {
|
||||
}
|
||||
}
|
||||
|
||||
impl CompositBackground {
|
||||
impl CompositeBackground {
|
||||
fn create_checker_bind_group(&self, device: &wgpu::Device, uniforms: CompositeUniforms) -> wgpu::BindGroup {
|
||||
let buffer = device.create_buffer_init(&wgpu::util::BufferInitDescriptor {
|
||||
label: Some("background_checker_uniforms"),
|
||||
|
||||
Reference in New Issue
Block a user