[naga] Implement atan2 in const (#8222)

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
This commit is contained in:
Sam authored and GitHub committed 2025-09-24 11:23:25 -07:00
1 parent d2ee4b8be5
commit 084431b548
2 files changed
+8 -2

No files matched your search

+2
View File
@@ -134,6 +134,8 @@ fails-if(metal) webgpu:api,operation,uncapturederror:iff_uncaptured:*
//FAIL: webgpu:api,operation,uncapturederror:onuncapturederror_order_wrt_addEventListener
// There are also two unimplemented SKIPs in uncapturederror not enumerated here.
webgpu:api,validation,encoding,queries,general:occlusion_query,query_type:*
webgpu:shader,execution,expression,call,builtin,atan2:f16:*
webgpu:shader,execution,expression,call,builtin,atan2:f32:*
webgpu:shader,execution,expression,call,builtin,textureSample:sampled_1d_coords:*
webgpu:shader,execution,expression,call,builtin,textureSampleBaseClampToEdge:2d_coords:stage="c";textureType="texture_2d<f32>";*
webgpu:shader,execution,flow_control,return:*
+6 -2
View File
@@ -1178,6 +1178,11 @@ impl<'a> ConstantEvaluator<'a> {
crate::MathFunction::Atan => {
component_wise_float!(self, span, [arg], |e| { Ok([e.atan()]) })
}
crate::MathFunction::Atan2 => {
component_wise_float!(self, span, [arg, arg1.unwrap()], |y, x| {
Ok([y.atan2(x)])
})
}
crate::MathFunction::Asinh => {
component_wise_float!(self, span, [arg], |e| { Ok([e.asinh()]) })
}
@@ -1346,8 +1351,7 @@ impl<'a> ConstantEvaluator<'a> {
crate::MathFunction::Cross => self.cross_product(arg, arg1.unwrap(), span),
// unimplemented
crate::MathFunction::Atan2
| crate::MathFunction::Modf
crate::MathFunction::Modf
| crate::MathFunction::Frexp
| crate::MathFunction::Ldexp
| crate::MathFunction::Dot