Skip to content

Commit

Permalink
WIP: feat(const_eval): impl. reflect
Browse files Browse the repository at this point in the history
  • Loading branch information
ErichDonGubler committed Jan 11, 2025
1 parent 4efc992 commit de3b5e4
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions naga/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ petgraph = { version = "0.6", 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
Expand Down
15 changes: 15 additions & 0 deletions naga/src/proc/constant_evaluator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()]) })
Expand Down

0 comments on commit de3b5e4

Please sign in to comment.