mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-21 06:50:59 +01:00
Add support for `naga::ir::MathFunction::Cross` to `naga::proc::constant_evaluator`. In the tests: - Change `naga/tests/in/wgsl/cross.wgsl` to use more interesting argument values. Rather than passing the same vector twice, which yields a cross product of zero, pass in the x and y unit vectors, whose cross product is the z unit vector. Update snapshot output. - Replace `validation::bad_cross_builtin_args` with a new test, `builtin_cross_product_args`, that is written more in the style of the other tests in this module, and does not depend on the WGSL front end. Because this PR changes the behavior of the constant evaluator, this test stopped behaving as expected. - In `wgsl_errors::check`, move a `panic!` out of a closure so that the `#[track_caller]` attribute works properly.