Add the first basic version of the GPU blend node (#1243)

* Implement Gpu Blend node

* Remove duplicate shader input

* Fix formatting

---------

Co-authored-by: Dennis Kobert <dennis@kobert.dev>
This commit is contained in:
Alexandru Ică
2023-05-28 11:34:09 +03:00
committed by Keavon Chambers
parent 9da83d3280
commit 57415b948b
14 changed files with 369 additions and 67 deletions

View File

@@ -3,7 +3,7 @@ use crate::executor::Any;
pub use crate::imaginate_input::{ImaginateMaskStartingFill, ImaginateSamplingMethod, ImaginateStatus};
use crate::proto::{Any as DAny, FutureAny};
use graphene_core::raster::{BlendMode, LuminanceCalculation};
use graphene_core::raster::{to_primtive_string, BlendMode, LuminanceCalculation};
use graphene_core::{Color, Node, Type};
pub use dyn_any::StaticType;
@@ -185,10 +185,11 @@ impl<'a> TaggedValue {
match self {
TaggedValue::None => "()".to_string(),
TaggedValue::String(x) => format!("\"{}\"", x),
TaggedValue::U32(x) => x.to_string(),
TaggedValue::F32(x) => x.to_string(),
TaggedValue::F64(x) => x.to_string(),
TaggedValue::U32(x) => x.to_string() + "_u32",
TaggedValue::F32(x) => x.to_string() + "_f32",
TaggedValue::F64(x) => x.to_string() + "_f64",
TaggedValue::Bool(x) => x.to_string(),
TaggedValue::BlendMode(blend_mode) => "BlendMode::".to_string() + to_primtive_string(blend_mode),
_ => panic!("Cannot convert to primitive string"),
}
}