mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-20 03:18:06 +08:00
Restructure GPU execution to model GPU pipelines in the node graph (#1088)
* Start implementing GpuExecutor for wgpu * Implement read_output_buffer function * Implement extraction node in the compiler * Generate type annotations during shader compilation * Start adding node wrapprs for graph execution api * Wrap more of the api in nodes * Restructure Pipeline to accept arbitrary shader inputs * Adapt nodes to new trait definitions * Start implementing gpu-compiler trait * Adapt shader generation * Hardstuck on pointer casts * Pass nodes as references in gpu code to avoid zsts * Update gcore to compile on the gpu * Fix color doc tests * Impl Node for node refs
This commit is contained in:
committed by
Keavon Chambers
parent
161bbc62b4
commit
bdc1ef926a
@@ -1,5 +1,5 @@
|
||||
use core::marker::PhantomData;
|
||||
use core::ops::Add;
|
||||
use core::ops::{Add, Mul};
|
||||
|
||||
use crate::Node;
|
||||
|
||||
@@ -30,6 +30,27 @@ where
|
||||
first + second
|
||||
}
|
||||
|
||||
pub struct MulParameterNode<Second> {
|
||||
second: Second,
|
||||
}
|
||||
|
||||
#[node_macro::node_fn(MulParameterNode)]
|
||||
fn flat_map<U, T>(first: U, second: T) -> <U as Mul<T>>::Output
|
||||
where
|
||||
U: Mul<T>,
|
||||
{
|
||||
first * second
|
||||
}
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
struct SizeOfNode {}
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
#[node_macro::node_fn(SizeOfNode)]
|
||||
fn flat_map(ty: crate::Type) -> Option<usize> {
|
||||
ty.size()
|
||||
}
|
||||
|
||||
#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
|
||||
pub struct SomeNode;
|
||||
#[node_macro::node_fn(SomeNode)]
|
||||
|
||||
Reference in New Issue
Block a user