Skip to content

Commit 939ed58

Browse files
WIP: feat(const_eval): impl. reflect
1 parent 894d036 commit 939ed58

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

naga/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ termcolor = { version = "1.4.1" }
9090
# termcolor minimum version was wrong and was fixed in
9191
# https://github.com/brendanzab/codespan/commit/e99c867339a877731437e7ee6a903a3d03b5439e
9292
codespan-reporting = { version = "0.11.0" }
93+
half = { version = "2.4.1", default-features = false }
9394
hashbrown.workspace = true
9495
half = { workspace = true, features = ["arbitrary", "num-traits"] }
9596
rustc-hash.workspace = true

naga/src/proc/constant_evaluator.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1273,6 +1273,21 @@ impl<'a> ConstantEvaluator<'a> {
12731273
})
12741274
}
12751275

1276+
// geometry
1277+
// crate::MathFunction::Reflect => {
1278+
// let dot = |scalar: Scalar| match scalar {
1279+
// Scalar::AbstractFloat([e1, e2]) => todo!(),
1280+
// Scalar::F32([e1, e2]) => todo!(),
1281+
// Scalar::AbstractInt([e1, e2]) => todo!(),
1282+
// Scalar::U32([e1, e2]) => todo!(),
1283+
// Scalar::I32([e1, e2]) => todo!(),
1284+
// };
1285+
// component_wise_float(self, span, [arg, arg1.unwrap()], |scalars| {
1286+
// let dot = dot(scalars);
1287+
// Ok([e1 - 2 * dot(e2, e1) * e2])
1288+
// })
1289+
// }
1290+
12761291
// computational
12771292
crate::MathFunction::Sign => {
12781293
component_wise_signed!(self, span, [arg], |e| { Ok([e.signum()]) })

0 commit comments

Comments
 (0)