mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-16 06:38:03 +08:00
Fmt
This commit is contained in:
@@ -168,10 +168,7 @@ impl StatusCell {
|
||||
}
|
||||
|
||||
pub fn no_partial() -> Self {
|
||||
Self {
|
||||
no_partial: true,
|
||||
..Self::new()
|
||||
}
|
||||
Self { no_partial: true, ..Self::new() }
|
||||
}
|
||||
|
||||
pub fn eval_input<Input, N: GNode<Input>>(&self, input_index: usize, node: &N, input: &Input) -> Result<N::Output, Interrupt> {
|
||||
|
||||
@@ -117,10 +117,7 @@ impl<N: ?Sized> SharedEdge<N> {
|
||||
}
|
||||
|
||||
pub fn share(&self) -> Self {
|
||||
Self {
|
||||
ptr: self.ptr,
|
||||
own: self.own.clone(),
|
||||
}
|
||||
Self { ptr: self.ptr, own: self.own.clone() }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -152,12 +149,7 @@ where
|
||||
unsafe { self.ptr.as_ref() }.serialize()
|
||||
}
|
||||
|
||||
fn eval_batch<'a>(
|
||||
&self,
|
||||
input: &'a Input,
|
||||
range: std::ops::Range<u64>,
|
||||
scratch: Option<&'a mut [std::mem::MaybeUninit<Self::Output>]>,
|
||||
) -> crate::gnode::BatchStatus<'a, Self::Output>
|
||||
fn eval_batch<'a>(&self, input: &'a Input, range: std::ops::Range<u64>, scratch: Option<&'a mut [std::mem::MaybeUninit<Self::Output>]>) -> crate::gnode::BatchStatus<'a, Self::Output>
|
||||
where
|
||||
Input: crate::context::InjectIndex + Copy,
|
||||
{
|
||||
@@ -235,10 +227,7 @@ impl EdgeHandle {
|
||||
|
||||
pub fn downcast_erased<N: ?Sized + 'static>(self, expected: Type) -> Result<SharedEdge<N>, ConstructionError> {
|
||||
let found = self.ty;
|
||||
self.node
|
||||
.downcast::<SharedEdge<N>>()
|
||||
.map(|edge| *edge)
|
||||
.map_err(|_| ConstructionError::Type { expected, found })
|
||||
self.node.downcast::<SharedEdge<N>>().map(|edge| *edge).map_err(|_| ConstructionError::Type { expected, found })
|
||||
}
|
||||
}
|
||||
|
||||
@@ -364,7 +353,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn derive_ctx_repeat_pushes_index_levels_through_the_erased_edge() {
|
||||
use crate::context::{Derived, DeriveCtx, ExtractIndex};
|
||||
use crate::context::{DeriveCtx, Derived, ExtractIndex};
|
||||
|
||||
struct RepeatNode<Node0> {
|
||||
content: Node0,
|
||||
@@ -421,7 +410,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn derive_ctx_footprint_replace_reaches_the_content() {
|
||||
use crate::context::{Derived, DeriveCtx, ExtractFootprint};
|
||||
use crate::context::{DeriveCtx, Derived, ExtractFootprint};
|
||||
use crate::transform::Footprint;
|
||||
|
||||
struct ShiftFootprintNode<Node0> {
|
||||
|
||||
@@ -300,12 +300,7 @@ mod tests {
|
||||
|
||||
let gate = Arc::new(std::sync::atomic::AtomicBool::new(false));
|
||||
let runtime = Arc::new(MockRuntime::default());
|
||||
let graph = StagedSumNode::new(
|
||||
SourceNode(40.0f64),
|
||||
GatedSource(gate.clone(), 2.0),
|
||||
SourceNode(RuntimeHandle(runtime.clone())),
|
||||
SourceNode(9u64),
|
||||
);
|
||||
let graph = StagedSumNode::new(SourceNode(40.0f64), GatedSource(gate.clone(), 2.0), SourceNode(RuntimeHandle(runtime.clone())), SourceNode(9u64));
|
||||
|
||||
assert_eq!(GNode::eval(&graph, &ctx), GPoll::Pending);
|
||||
assert_eq!(runtime.drain(), Vec::<SourceId>::new(), "an interrupted prologue must not spawn or claim the slot");
|
||||
|
||||
@@ -9,11 +9,11 @@ use crate::texture_cache::TextureCache;
|
||||
use anyhow::Result;
|
||||
use core_types::Color;
|
||||
use core_types::color::SRGBA8;
|
||||
use std::sync::Mutex;
|
||||
use glam::UVec2;
|
||||
use graphene_application_io::{ApplicationIo, EditorApi};
|
||||
use raster_types::Texture;
|
||||
use std::sync::Arc;
|
||||
use std::sync::Mutex;
|
||||
use vello::{AaConfig, AaSupport, RenderParams, Renderer, RendererOptions, Scene};
|
||||
use wgpu::{Origin3d, TextureAspect};
|
||||
|
||||
|
||||
@@ -2,10 +2,10 @@ use crate::WgpuContext;
|
||||
use crate::shader_runtime::{FULLSCREEN_VERTEX_SHADER_NAME, ShaderRuntime};
|
||||
use core_types::list::{Item, List};
|
||||
use core_types::shaders::buffer_struct::BufferStruct;
|
||||
use std::sync::Mutex;
|
||||
use raster_types::{GPU, Raster};
|
||||
use std::borrow::Cow;
|
||||
use std::collections::HashMap;
|
||||
use std::sync::Mutex;
|
||||
use wgpu::util::{BufferInitDescriptor, DeviceExt};
|
||||
use wgpu::{
|
||||
BindGroupDescriptor, BindGroupEntry, BindGroupLayoutDescriptor, BindGroupLayoutEntry, BindingResource, BindingType, Buffer, BufferBinding, BufferBindingType, BufferUsages, ColorTargetState, Face,
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
use crate::WgpuExecutor;
|
||||
use crate::WgpuExecutorHandle;
|
||||
use core_types::Color;
|
||||
use core_types::Ctx;
|
||||
use core_types::color::SRGBA8;
|
||||
@@ -8,7 +9,6 @@ use core_types::runtime::SourceFuture;
|
||||
use core_types::transform::Footprint;
|
||||
use raster_types::Image;
|
||||
use raster_types::{CPU, GPU, Raster};
|
||||
use crate::WgpuExecutorHandle;
|
||||
use wgpu::util::{DeviceExt, TextureDataOrder};
|
||||
use wgpu::{Extent3d, TextureDescriptor, TextureDimension, TextureFormat, TextureUsages};
|
||||
|
||||
@@ -40,7 +40,6 @@ fn upload_to_texture(device: &wgpu::Device, queue: &wgpu::Queue, image: &Raster<
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
/// Passthrough conversion for GPU `List`s - no conversion needed
|
||||
impl Convert<List<Raster<GPU>>, WgpuExecutorHandle> for List<Raster<GPU>> {
|
||||
fn convert(self, _: Footprint, _converter: WgpuExecutorHandle) -> List<Raster<GPU>> {
|
||||
|
||||
Reference in New Issue
Block a user