diff --git a/Cargo.lock b/Cargo.lock index fe637cfc5b..4fdc8b3da0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2186,6 +2186,7 @@ dependencies = [ "codespan-reporting", "diff", "env_logger", + "half", "hexf-parse", "hlsl-snapshots", "indexmap", diff --git a/naga/Cargo.toml b/naga/Cargo.toml index 2c8d846289..76f15e276f 100644 --- a/naga/Cargo.toml +++ b/naga/Cargo.toml @@ -86,6 +86,7 @@ petgraph = { version = "0.7", optional = true } pp-rs = { version = "0.2.1", optional = true } hexf-parse = { version = "0.2.1", optional = true } unicode-xid = { version = "0.2.6", optional = true } +half = { version = "2.4.1", default-features = false } [build-dependencies] cfg_aliases.workspace = true diff --git a/naga/src/proc/constant_evaluator.rs b/naga/src/proc/constant_evaluator.rs index 42ba489790..048eedf464 100644 --- a/naga/src/proc/constant_evaluator.rs +++ b/naga/src/proc/constant_evaluator.rs @@ -1232,6 +1232,21 @@ impl<'a> ConstantEvaluator<'a> { }) } + // geometry + // crate::MathFunction::Reflect => { + // let dot = |scalar: Scalar| match scalar { + // Scalar::AbstractFloat([e1, e2]) => todo!(), + // Scalar::F32([e1, e2]) => todo!(), + // Scalar::AbstractInt([e1, e2]) => todo!(), + // Scalar::U32([e1, e2]) => todo!(), + // Scalar::I32([e1, e2]) => todo!(), + // }; + // component_wise_float(self, span, [arg, arg1.unwrap()], |scalars| { + // let dot = dot(scalars); + // Ok([e1 - 2 * dot(e2, e1) * e2]) + // }) + // } + // computational crate::MathFunction::Sign => { component_wise_signed!(self, span, [arg], |e| { Ok([e.signum()]) })