From f24b37e12257dfff75f6f95fcc0c252340720468 Mon Sep 17 00:00:00 2001 From: Ben Clayton Date: Mon, 28 Jun 2021 15:30:57 +0000 Subject: [PATCH] writer/msl: Rework string printing Add `out` parameters to expression and type generators. Use the new helper classes in TextGenerator. Cleans up bad formatting. Prepares the writer generating 'pre' statements, required for atomics. If-else statements are generated slightly differently. This is done so that 'pre' statements for the else conditions are scoped correctly. This is identical to the HLSL writer. Bug tint:892 Change-Id: I4c6e96c90673ba30898b3682bf3198497d63a2d4 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/56067 Kokoro: Kokoro Reviewed-by: James Price Commit-Queue: Ben Clayton --- src/writer/msl/generator_impl.cc | 1187 ++++++++--------- src/writer/msl/generator_impl.h | 92 +- .../msl/generator_impl_array_accessor_test.cc | 10 +- src/writer/msl/generator_impl_binary_test.cc | 5 +- src/writer/msl/generator_impl_bitcast_test.cc | 5 +- src/writer/msl/generator_impl_block_test.cc | 5 +- src/writer/msl/generator_impl_call_test.cc | 10 +- src/writer/msl/generator_impl_cast_test.cc | 10 +- .../msl/generator_impl_function_test.cc | 16 +- .../msl/generator_impl_identifier_test.cc | 5 +- src/writer/msl/generator_impl_if_test.cc | 14 +- src/writer/msl/generator_impl_import_test.cc | 39 +- .../msl/generator_impl_intrinsic_test.cc | 30 +- .../generator_impl_intrinsic_texture_test.cc | 5 +- .../generator_impl_member_accessor_test.cc | 15 +- src/writer/msl/generator_impl_type_test.cc | 105 +- .../msl/generator_impl_unary_op_test.cc | 25 +- src/writer/text_generator.cc | 3 +- test/bug/dawn/947.wgsl.expected.msl | 4 +- test/bug/tint/749.spvasm.expected.msl | 4 +- test/bug/tint/913.wgsl.expected.msl | 4 +- test/bug/tint/914.wgsl.expected.msl | 6 +- .../gen/abs/002533.wgsl.expected.msl | 2 +- .../gen/abs/005174.wgsl.expected.msl | 2 +- .../gen/abs/1ce782.wgsl.expected.msl | 2 +- .../gen/abs/1e9d53.wgsl.expected.msl | 2 +- .../gen/abs/467cd1.wgsl.expected.msl | 2 +- .../gen/abs/4ad288.wgsl.expected.msl | 2 +- .../gen/abs/5ad50a.wgsl.expected.msl | 2 +- .../gen/abs/7326de.wgsl.expected.msl | 2 +- .../gen/abs/7f28e6.wgsl.expected.msl | 2 +- .../gen/abs/7faa9e.wgsl.expected.msl | 2 +- .../gen/abs/9c80a6.wgsl.expected.msl | 2 +- .../gen/abs/b96037.wgsl.expected.msl | 2 +- .../gen/acos/489247.wgsl.expected.msl | 2 +- .../gen/acos/8e2acf.wgsl.expected.msl | 2 +- .../gen/acos/a610c4.wgsl.expected.msl | 2 +- .../gen/acos/dfc915.wgsl.expected.msl | 2 +- .../gen/all/986c7b.wgsl.expected.msl | 2 +- .../gen/all/bd2dba.wgsl.expected.msl | 2 +- .../gen/all/f46790.wgsl.expected.msl | 2 +- .../gen/any/083428.wgsl.expected.msl | 2 +- .../gen/any/0e3e58.wgsl.expected.msl | 2 +- .../gen/any/e755c1.wgsl.expected.msl | 2 +- .../gen/asin/064953.wgsl.expected.msl | 2 +- .../gen/asin/7b6a44.wgsl.expected.msl | 2 +- .../gen/asin/8cd9c9.wgsl.expected.msl | 2 +- .../gen/asin/c0c272.wgsl.expected.msl | 2 +- .../gen/atan/02979a.wgsl.expected.msl | 2 +- .../gen/atan/331e6d.wgsl.expected.msl | 2 +- .../gen/atan/a8b696.wgsl.expected.msl | 2 +- .../gen/atan/ad96e4.wgsl.expected.msl | 2 +- .../gen/atan2/57fb13.wgsl.expected.msl | 2 +- .../gen/atan2/96057c.wgsl.expected.msl | 2 +- .../gen/atan2/a70d0d.wgsl.expected.msl | 2 +- .../gen/atan2/ae713e.wgsl.expected.msl | 2 +- .../gen/ceil/34064b.wgsl.expected.msl | 2 +- .../gen/ceil/678655.wgsl.expected.msl | 2 +- .../gen/ceil/96f597.wgsl.expected.msl | 2 +- .../gen/ceil/b74c16.wgsl.expected.msl | 2 +- .../gen/clamp/0acf8f.wgsl.expected.msl | 2 +- .../gen/clamp/1a32e3.wgsl.expected.msl | 2 +- .../gen/clamp/2bd567.wgsl.expected.msl | 2 +- .../gen/clamp/2bde41.wgsl.expected.msl | 2 +- .../gen/clamp/548fc7.wgsl.expected.msl | 2 +- .../gen/clamp/5f0819.wgsl.expected.msl | 2 +- .../gen/clamp/6c1749.wgsl.expected.msl | 2 +- .../gen/clamp/7706d7.wgsl.expected.msl | 2 +- .../gen/clamp/867397.wgsl.expected.msl | 2 +- .../gen/clamp/a2de25.wgsl.expected.msl | 2 +- .../gen/clamp/b07c65.wgsl.expected.msl | 2 +- .../gen/clamp/bd43ce.wgsl.expected.msl | 2 +- .../gen/cos/16dc15.wgsl.expected.msl | 2 +- .../gen/cos/29d66d.wgsl.expected.msl | 2 +- .../gen/cos/c3b486.wgsl.expected.msl | 2 +- .../gen/cos/c5c28e.wgsl.expected.msl | 2 +- .../gen/cosh/377652.wgsl.expected.msl | 2 +- .../gen/cosh/c13756.wgsl.expected.msl | 2 +- .../gen/cosh/da92dd.wgsl.expected.msl | 2 +- .../gen/cosh/e0c1de.wgsl.expected.msl | 2 +- .../gen/countOneBits/0d0e46.wgsl.expected.msl | 2 +- .../gen/countOneBits/0f7980.wgsl.expected.msl | 2 +- .../gen/countOneBits/65d2ae.wgsl.expected.msl | 2 +- .../gen/countOneBits/690cfc.wgsl.expected.msl | 2 +- .../gen/countOneBits/94fd81.wgsl.expected.msl | 2 +- .../gen/countOneBits/ae44f9.wgsl.expected.msl | 2 +- .../gen/countOneBits/af90e2.wgsl.expected.msl | 2 +- .../gen/countOneBits/fd88b2.wgsl.expected.msl | 2 +- .../gen/cross/041cb0.wgsl.expected.msl | 2 +- .../gen/determinant/2b62ba.wgsl.expected.msl | 2 +- .../gen/determinant/a0a87c.wgsl.expected.msl | 2 +- .../gen/determinant/e19305.wgsl.expected.msl | 2 +- .../gen/distance/0657d4.wgsl.expected.msl | 2 +- .../gen/distance/9646ea.wgsl.expected.msl | 2 +- .../gen/distance/aa4055.wgsl.expected.msl | 2 +- .../gen/dot/0c577b.wgsl.expected.msl | 2 +- .../gen/dot/883f0e.wgsl.expected.msl | 2 +- .../gen/dot/ba4246.wgsl.expected.msl | 2 +- .../gen/dpdx/0763f7.wgsl.expected.msl | 2 +- .../gen/dpdx/99edb1.wgsl.expected.msl | 2 +- .../gen/dpdx/c487fa.wgsl.expected.msl | 2 +- .../gen/dpdx/e263de.wgsl.expected.msl | 2 +- .../gen/dpdxCoarse/029152.wgsl.expected.msl | 2 +- .../gen/dpdxCoarse/9581cf.wgsl.expected.msl | 2 +- .../gen/dpdxCoarse/c28641.wgsl.expected.msl | 2 +- .../gen/dpdxCoarse/f64d7b.wgsl.expected.msl | 2 +- .../gen/dpdxFine/8c5069.wgsl.expected.msl | 2 +- .../gen/dpdxFine/9631de.wgsl.expected.msl | 2 +- .../gen/dpdxFine/f401a2.wgsl.expected.msl | 2 +- .../gen/dpdxFine/f92fb6.wgsl.expected.msl | 2 +- .../gen/dpdy/699a05.wgsl.expected.msl | 2 +- .../gen/dpdy/7f8d84.wgsl.expected.msl | 2 +- .../gen/dpdy/a8b56e.wgsl.expected.msl | 2 +- .../gen/dpdy/feb40f.wgsl.expected.msl | 2 +- .../gen/dpdyCoarse/3e1ab4.wgsl.expected.msl | 2 +- .../gen/dpdyCoarse/445d24.wgsl.expected.msl | 2 +- .../gen/dpdyCoarse/870a7e.wgsl.expected.msl | 2 +- .../gen/dpdyCoarse/ae1873.wgsl.expected.msl | 2 +- .../gen/dpdyFine/1fb7ab.wgsl.expected.msl | 2 +- .../gen/dpdyFine/6eb673.wgsl.expected.msl | 2 +- .../gen/dpdyFine/d0a648.wgsl.expected.msl | 2 +- .../gen/dpdyFine/df33aa.wgsl.expected.msl | 2 +- .../gen/exp/0f70eb.wgsl.expected.msl | 2 +- .../gen/exp/1951e7.wgsl.expected.msl | 2 +- .../gen/exp/771fd2.wgsl.expected.msl | 2 +- .../gen/exp/d98450.wgsl.expected.msl | 2 +- .../gen/exp2/1f8680.wgsl.expected.msl | 2 +- .../gen/exp2/a9d0a7.wgsl.expected.msl | 2 +- .../gen/exp2/d6777c.wgsl.expected.msl | 2 +- .../gen/exp2/dea523.wgsl.expected.msl | 2 +- .../gen/faceForward/5afbd5.wgsl.expected.msl | 2 +- .../gen/faceForward/b316e5.wgsl.expected.msl | 2 +- .../gen/faceForward/e6908b.wgsl.expected.msl | 2 +- .../gen/floor/3bccc4.wgsl.expected.msl | 2 +- .../gen/floor/5fc9ac.wgsl.expected.msl | 2 +- .../gen/floor/60d7ea.wgsl.expected.msl | 2 +- .../gen/floor/66f154.wgsl.expected.msl | 2 +- .../gen/fma/26a7a9.wgsl.expected.msl | 2 +- .../gen/fma/6a3283.wgsl.expected.msl | 2 +- .../gen/fma/c10ba3.wgsl.expected.msl | 2 +- .../gen/fma/e17c5c.wgsl.expected.msl | 2 +- .../gen/fract/8bc1e9.wgsl.expected.msl | 2 +- .../gen/fract/943cb1.wgsl.expected.msl | 2 +- .../gen/fract/a49758.wgsl.expected.msl | 2 +- .../gen/fract/fa5c71.wgsl.expected.msl | 2 +- .../gen/fwidth/5d1b39.wgsl.expected.msl | 2 +- .../gen/fwidth/b83ebb.wgsl.expected.msl | 2 +- .../gen/fwidth/d2ab9a.wgsl.expected.msl | 2 +- .../gen/fwidth/df38ef.wgsl.expected.msl | 2 +- .../gen/fwidthCoarse/159c8a.wgsl.expected.msl | 2 +- .../gen/fwidthCoarse/1e59d9.wgsl.expected.msl | 2 +- .../gen/fwidthCoarse/4e4fc4.wgsl.expected.msl | 2 +- .../gen/fwidthCoarse/e653f7.wgsl.expected.msl | 2 +- .../gen/fwidthFine/523fdc.wgsl.expected.msl | 2 +- .../gen/fwidthFine/68f4ef.wgsl.expected.msl | 2 +- .../gen/fwidthFine/f1742d.wgsl.expected.msl | 2 +- .../gen/fwidthFine/ff6aa0.wgsl.expected.msl | 2 +- .../gen/inverseSqrt/84407e.wgsl.expected.msl | 2 +- .../gen/inverseSqrt/8f2bd2.wgsl.expected.msl | 2 +- .../gen/inverseSqrt/b197b1.wgsl.expected.msl | 2 +- .../gen/inverseSqrt/c22347.wgsl.expected.msl | 2 +- .../gen/isFinite/34d32b.wgsl.expected.msl | 2 +- .../gen/isFinite/426f9f.wgsl.expected.msl | 2 +- .../gen/isFinite/8a23ad.wgsl.expected.msl | 2 +- .../gen/isFinite/f31987.wgsl.expected.msl | 2 +- .../gen/isInf/666f2a.wgsl.expected.msl | 2 +- .../gen/isInf/7bd98f.wgsl.expected.msl | 2 +- .../gen/isInf/7e81b5.wgsl.expected.msl | 2 +- .../gen/isInf/a46d6f.wgsl.expected.msl | 2 +- .../gen/isNan/1280ab.wgsl.expected.msl | 2 +- .../gen/isNan/4d280d.wgsl.expected.msl | 2 +- .../gen/isNan/67ecd3.wgsl.expected.msl | 2 +- .../gen/isNan/e4978e.wgsl.expected.msl | 2 +- .../gen/isNormal/863dcd.wgsl.expected.msl | 2 +- .../gen/isNormal/b00ab1.wgsl.expected.msl | 2 +- .../gen/isNormal/c286b7.wgsl.expected.msl | 2 +- .../gen/isNormal/c6e880.wgsl.expected.msl | 2 +- .../gen/ldexp/a31cdc.wgsl.expected.msl | 2 +- .../gen/ldexp/abd718.wgsl.expected.msl | 2 +- .../gen/ldexp/cc9cde.wgsl.expected.msl | 2 +- .../gen/ldexp/db8b49.wgsl.expected.msl | 2 +- .../gen/ldexp/f54ff2.wgsl.expected.msl | 2 +- .../gen/length/056071.wgsl.expected.msl | 2 +- .../gen/length/afde8b.wgsl.expected.msl | 2 +- .../gen/length/becebf.wgsl.expected.msl | 2 +- .../gen/log/3da25a.wgsl.expected.msl | 2 +- .../gen/log/7114a6.wgsl.expected.msl | 2 +- .../gen/log/b2ce28.wgsl.expected.msl | 2 +- .../gen/log/f4c570.wgsl.expected.msl | 2 +- .../gen/log2/4036ed.wgsl.expected.msl | 2 +- .../gen/log2/902988.wgsl.expected.msl | 2 +- .../gen/log2/adb233.wgsl.expected.msl | 2 +- .../gen/log2/aea659.wgsl.expected.msl | 2 +- .../gen/max/0c0aae.wgsl.expected.msl | 2 +- .../gen/max/25eafe.wgsl.expected.msl | 2 +- .../gen/max/320815.wgsl.expected.msl | 2 +- .../gen/max/44a39d.wgsl.expected.msl | 2 +- .../gen/max/453e04.wgsl.expected.msl | 2 +- .../gen/max/462050.wgsl.expected.msl | 2 +- .../gen/max/4883ac.wgsl.expected.msl | 2 +- .../gen/max/85e6bc.wgsl.expected.msl | 2 +- .../gen/max/a93419.wgsl.expected.msl | 2 +- .../gen/max/b1b73a.wgsl.expected.msl | 2 +- .../gen/max/ce7c30.wgsl.expected.msl | 2 +- .../gen/max/e8192f.wgsl.expected.msl | 2 +- .../gen/min/03c7e3.wgsl.expected.msl | 2 +- .../gen/min/0dc614.wgsl.expected.msl | 2 +- .../gen/min/3941e1.wgsl.expected.msl | 2 +- .../gen/min/46c5d3.wgsl.expected.msl | 2 +- .../gen/min/82b28f.wgsl.expected.msl | 2 +- .../gen/min/93cfc4.wgsl.expected.msl | 2 +- .../gen/min/a45171.wgsl.expected.msl | 2 +- .../gen/min/aa28ad.wgsl.expected.msl | 2 +- .../gen/min/af326d.wgsl.expected.msl | 2 +- .../gen/min/c70bb7.wgsl.expected.msl | 2 +- .../gen/min/c73147.wgsl.expected.msl | 2 +- .../gen/min/c76fa6.wgsl.expected.msl | 2 +- .../gen/mix/0c8c33.wgsl.expected.msl | 2 +- .../gen/mix/4f0b5e.wgsl.expected.msl | 2 +- .../gen/mix/6f8adc.wgsl.expected.msl | 2 +- .../gen/mix/c37ede.wgsl.expected.msl | 2 +- .../gen/normalize/64d8c0.wgsl.expected.msl | 2 +- .../gen/normalize/9a0aab.wgsl.expected.msl | 2 +- .../gen/normalize/fc2ef1.wgsl.expected.msl | 2 +- .../pack2x16float/0e97b3.wgsl.expected.msl | 2 +- .../pack2x16snorm/6c169b.wgsl.expected.msl | 2 +- .../pack2x16unorm/0f08e4.wgsl.expected.msl | 2 +- .../gen/pack4x8snorm/4d22e7.wgsl.expected.msl | 2 +- .../gen/pack4x8unorm/95c456.wgsl.expected.msl | 2 +- .../gen/pow/04a908.wgsl.expected.msl | 2 +- .../gen/pow/46e029.wgsl.expected.msl | 2 +- .../gen/pow/4a46c9.wgsl.expected.msl | 2 +- .../gen/pow/e60ea5.wgsl.expected.msl | 2 +- .../gen/reflect/05357e.wgsl.expected.msl | 2 +- .../gen/reflect/b61e10.wgsl.expected.msl | 2 +- .../gen/reflect/f47fdb.wgsl.expected.msl | 2 +- .../gen/reverseBits/222177.wgsl.expected.msl | 2 +- .../gen/reverseBits/35fea9.wgsl.expected.msl | 2 +- .../gen/reverseBits/4dbd6f.wgsl.expected.msl | 2 +- .../gen/reverseBits/7c4269.wgsl.expected.msl | 2 +- .../gen/reverseBits/a6ccd4.wgsl.expected.msl | 2 +- .../gen/reverseBits/c21bc1.wgsl.expected.msl | 2 +- .../gen/reverseBits/e1f4c1.wgsl.expected.msl | 2 +- .../gen/reverseBits/e31adf.wgsl.expected.msl | 2 +- .../gen/round/106c0b.wgsl.expected.msl | 2 +- .../gen/round/1c7897.wgsl.expected.msl | 2 +- .../gen/round/52c84d.wgsl.expected.msl | 2 +- .../gen/round/9edc38.wgsl.expected.msl | 2 +- .../gen/select/00b848.wgsl.expected.msl | 2 +- .../gen/select/01e2cd.wgsl.expected.msl | 2 +- .../gen/select/1e960b.wgsl.expected.msl | 2 +- .../gen/select/266aff.wgsl.expected.msl | 2 +- .../gen/select/28a27e.wgsl.expected.msl | 2 +- .../gen/select/416e14.wgsl.expected.msl | 2 +- .../gen/select/80a9a9.wgsl.expected.msl | 2 +- .../gen/select/99f883.wgsl.expected.msl | 2 +- .../gen/select/a2860e.wgsl.expected.msl | 2 +- .../gen/select/bb8aae.wgsl.expected.msl | 2 +- .../gen/select/c31f9e.wgsl.expected.msl | 2 +- .../gen/select/c4a4ef.wgsl.expected.msl | 2 +- .../gen/select/cb9301.wgsl.expected.msl | 2 +- .../gen/select/e3e028.wgsl.expected.msl | 2 +- .../gen/select/ebfea2.wgsl.expected.msl | 2 +- .../gen/select/ed8a15.wgsl.expected.msl | 2 +- .../gen/sign/159665.wgsl.expected.msl | 2 +- .../gen/sign/b8f634.wgsl.expected.msl | 2 +- .../gen/sign/d065d8.wgsl.expected.msl | 2 +- .../gen/sign/dd790e.wgsl.expected.msl | 2 +- .../gen/sin/01f241.wgsl.expected.msl | 2 +- .../gen/sin/4e3979.wgsl.expected.msl | 2 +- .../gen/sin/b78c91.wgsl.expected.msl | 2 +- .../gen/sin/fc8bc4.wgsl.expected.msl | 2 +- .../gen/sinh/445e33.wgsl.expected.msl | 2 +- .../gen/sinh/7bb598.wgsl.expected.msl | 2 +- .../gen/sinh/b9860e.wgsl.expected.msl | 2 +- .../gen/sinh/c9a5eb.wgsl.expected.msl | 2 +- .../gen/smoothStep/5f615b.wgsl.expected.msl | 2 +- .../gen/smoothStep/658be3.wgsl.expected.msl | 2 +- .../gen/smoothStep/c11eef.wgsl.expected.msl | 2 +- .../gen/smoothStep/cb0bfb.wgsl.expected.msl | 2 +- .../gen/sqrt/20c74e.wgsl.expected.msl | 2 +- .../gen/sqrt/8c7024.wgsl.expected.msl | 2 +- .../gen/sqrt/aa0d7a.wgsl.expected.msl | 2 +- .../gen/sqrt/f8c59a.wgsl.expected.msl | 2 +- .../gen/step/0b073b.wgsl.expected.msl | 2 +- .../gen/step/19accd.wgsl.expected.msl | 2 +- .../gen/step/334303.wgsl.expected.msl | 2 +- .../gen/step/e2b337.wgsl.expected.msl | 2 +- .../storageBarrier/d87211.wgsl.expected.msl | 2 +- .../gen/tan/244e2a.wgsl.expected.msl | 2 +- .../gen/tan/2f030e.wgsl.expected.msl | 2 +- .../gen/tan/7ea104.wgsl.expected.msl | 2 +- .../gen/tan/8ce3e9.wgsl.expected.msl | 2 +- .../gen/tanh/5663c5.wgsl.expected.msl | 2 +- .../gen/tanh/5724b3.wgsl.expected.msl | 2 +- .../gen/tanh/9f9fb9.wgsl.expected.msl | 2 +- .../gen/tanh/c15fdb.wgsl.expected.msl | 2 +- .../gen/transpose/2585cd.wgsl.expected.msl | 2 +- .../gen/transpose/31d679.wgsl.expected.msl | 2 +- .../gen/transpose/31e37e.wgsl.expected.msl | 2 +- .../gen/transpose/4ce359.wgsl.expected.msl | 2 +- .../gen/transpose/4dc9a1.wgsl.expected.msl | 2 +- .../gen/transpose/854336.wgsl.expected.msl | 2 +- .../gen/transpose/c1b600.wgsl.expected.msl | 2 +- .../gen/transpose/d8f8ba.wgsl.expected.msl | 2 +- .../gen/transpose/ed4bdc.wgsl.expected.msl | 2 +- .../gen/trunc/562d05.wgsl.expected.msl | 2 +- .../gen/trunc/e183aa.wgsl.expected.msl | 2 +- .../gen/trunc/eb83df.wgsl.expected.msl | 2 +- .../gen/trunc/f370d3.wgsl.expected.msl | 2 +- .../unpack2x16float/32a5cf.wgsl.expected.msl | 2 +- .../unpack2x16snorm/b4aea6.wgsl.expected.msl | 2 +- .../unpack2x16unorm/7699c0.wgsl.expected.msl | 2 +- .../unpack4x8snorm/523fb3.wgsl.expected.msl | 2 +- .../unpack4x8unorm/750c74.wgsl.expected.msl | 2 +- .../workgroupBarrier/a17f7f.wgsl.expected.msl | 2 +- .../local/ptr_workgroup.wgsl.expected.msl | 2 +- test/samples/compute_boids.wgsl.expected.msl | 12 +- test/var/workgroup.wgsl.expected.msl | 6 +- 319 files changed, 1126 insertions(+), 1081 deletions(-) diff --git a/src/writer/msl/generator_impl.cc b/src/writer/msl/generator_impl.cc index db3665ef2f..c1c73b239e 100644 --- a/src/writer/msl/generator_impl.cc +++ b/src/writer/msl/generator_impl.cc @@ -84,8 +84,9 @@ bool GeneratorImpl::Generate() { return false; } - out_ << "#include " << std::endl << std::endl; - out_ << "using namespace metal;" << std::endl; + line() << "#include "; + line(); + line() << "using namespace metal;"; for (auto* const type_decl : program_->AST().TypeDecls()) { if (!type_decl->Is()) { @@ -96,7 +97,7 @@ bool GeneratorImpl::Generate() { } if (!program_->AST().TypeDecls().empty()) { - out_ << std::endl; + line(); } for (auto* var : program_->AST().GlobalVariables()) { @@ -130,14 +131,13 @@ bool GeneratorImpl::Generate() { return false; } } + line(); } return true; } bool GeneratorImpl::EmitTypeDecl(const sem::Type* ty) { - make_indent(); - if (auto* str = ty->As()) { if (!EmitStructType(str)) { return false; @@ -151,159 +151,161 @@ bool GeneratorImpl::EmitTypeDecl(const sem::Type* ty) { return true; } -bool GeneratorImpl::EmitArrayAccessor(ast::ArrayAccessorExpression* expr) { +bool GeneratorImpl::EmitArrayAccessor(std::ostream& out, + ast::ArrayAccessorExpression* expr) { bool paren_lhs = !expr->array() ->IsAnyOf(); + if (paren_lhs) { - out_ << "("; + out << "("; } - if (!EmitExpression(expr->array())) { + if (!EmitExpression(out, expr->array())) { return false; } if (paren_lhs) { - out_ << ")"; + out << ")"; } - out_ << "["; + out << "["; - if (!EmitExpression(expr->idx_expr())) { + if (!EmitExpression(out, expr->idx_expr())) { return false; } - out_ << "]"; + out << "]"; return true; } -bool GeneratorImpl::EmitBitcast(ast::BitcastExpression* expr) { - out_ << "as_type<"; - if (!EmitType(TypeOf(expr)->UnwrapRef(), "")) { +bool GeneratorImpl::EmitBitcast(std::ostream& out, + ast::BitcastExpression* expr) { + out << "as_type<"; + if (!EmitType(out, TypeOf(expr)->UnwrapRef(), "")) { return false; } - out_ << ">("; - if (!EmitExpression(expr->expr())) { + out << ">("; + if (!EmitExpression(out, expr->expr())) { return false; } - out_ << ")"; + out << ")"; return true; } bool GeneratorImpl::EmitAssign(ast::AssignmentStatement* stmt) { - make_indent(); + auto out = line(); - if (!EmitExpression(stmt->lhs())) { + if (!EmitExpression(out, stmt->lhs())) { return false; } - out_ << " = "; + out << " = "; - if (!EmitExpression(stmt->rhs())) { + if (!EmitExpression(out, stmt->rhs())) { return false; } - out_ << ";" << std::endl; + out << ";"; return true; } -bool GeneratorImpl::EmitBinary(ast::BinaryExpression* expr) { - out_ << "("; +bool GeneratorImpl::EmitBinary(std::ostream& out, ast::BinaryExpression* expr) { + out << "("; - if (!EmitExpression(expr->lhs())) { + if (!EmitExpression(out, expr->lhs())) { return false; } - out_ << " "; + out << " "; switch (expr->op()) { case ast::BinaryOp::kAnd: - out_ << "&"; + out << "&"; break; case ast::BinaryOp::kOr: - out_ << "|"; + out << "|"; break; case ast::BinaryOp::kXor: - out_ << "^"; + out << "^"; break; case ast::BinaryOp::kLogicalAnd: - out_ << "&&"; + out << "&&"; break; case ast::BinaryOp::kLogicalOr: - out_ << "||"; + out << "||"; break; case ast::BinaryOp::kEqual: - out_ << "=="; + out << "=="; break; case ast::BinaryOp::kNotEqual: - out_ << "!="; + out << "!="; break; case ast::BinaryOp::kLessThan: - out_ << "<"; + out << "<"; break; case ast::BinaryOp::kGreaterThan: - out_ << ">"; + out << ">"; break; case ast::BinaryOp::kLessThanEqual: - out_ << "<="; + out << "<="; break; case ast::BinaryOp::kGreaterThanEqual: - out_ << ">="; + out << ">="; break; case ast::BinaryOp::kShiftLeft: - out_ << "<<"; + out << "<<"; break; case ast::BinaryOp::kShiftRight: // TODO(dsinclair): MSL is based on C++14, and >> in C++14 has // implementation-defined behaviour for negative LHS. We may have to // generate extra code to implement WGSL-specified behaviour for negative // LHS. - out_ << R"(>>)"; + out << R"(>>)"; break; case ast::BinaryOp::kAdd: - out_ << "+"; + out << "+"; break; case ast::BinaryOp::kSubtract: - out_ << "-"; + out << "-"; break; case ast::BinaryOp::kMultiply: - out_ << "*"; + out << "*"; break; case ast::BinaryOp::kDivide: - out_ << "/"; + out << "/"; break; case ast::BinaryOp::kModulo: - out_ << "%"; + out << "%"; break; case ast::BinaryOp::kNone: diagnostics_.add_error(diag::System::Writer, "missing binary operation type"); return false; } - out_ << " "; + out << " "; - if (!EmitExpression(expr->rhs())) { + if (!EmitExpression(out, expr->rhs())) { return false; } - out_ << ")"; + out << ")"; return true; } bool GeneratorImpl::EmitBreak(ast::BreakStatement*) { - make_indent(); - out_ << "break;" << std::endl; + line() << "break;"; return true; } -bool GeneratorImpl::EmitCall(ast::CallExpression* expr) { +bool GeneratorImpl::EmitCall(std::ostream& out, ast::CallExpression* expr) { auto* ident = expr->func(); auto* call = program_->Sem().Get(expr); if (auto* intrinsic = call->Target()->As()) { - return EmitIntrinsicCall(expr, intrinsic); + return EmitIntrinsicCall(out, expr, intrinsic); } auto* func = program_->AST().Functions().Find(ident->symbol()); @@ -314,81 +316,79 @@ bool GeneratorImpl::EmitCall(ast::CallExpression* expr) { return false; } - out_ << program_->Symbols().NameFor(ident->symbol()) << "("; + out << program_->Symbols().NameFor(ident->symbol()) << "("; bool first = true; auto* func_sem = program_->Sem().Get(func); for (const auto& data : func_sem->ReferencedUniformVariables()) { auto* var = data.first; if (!first) { - out_ << ", "; + out << ", "; } first = false; - out_ << program_->Symbols().NameFor(var->Declaration()->symbol()); + out << program_->Symbols().NameFor(var->Declaration()->symbol()); } for (const auto& data : func_sem->ReferencedStorageBufferVariables()) { auto* var = data.first; if (!first) { - out_ << ", "; + out << ", "; } first = false; - out_ << program_->Symbols().NameFor(var->Declaration()->symbol()); + out << program_->Symbols().NameFor(var->Declaration()->symbol()); } const auto& params = expr->params(); for (auto* param : params) { if (!first) { - out_ << ", "; + out << ", "; } first = false; - if (!EmitExpression(param)) { + if (!EmitExpression(out, param)) { return false; } } - out_ << ")"; + out << ")"; return true; } -bool GeneratorImpl::EmitIntrinsicCall(ast::CallExpression* expr, +bool GeneratorImpl::EmitIntrinsicCall(std::ostream& out, + ast::CallExpression* expr, const sem::Intrinsic* intrinsic) { if (intrinsic->IsTexture()) { - return EmitTextureCall(expr, intrinsic); + return EmitTextureCall(out, expr, intrinsic); } switch (intrinsic->Type()) { case sem::IntrinsicType::kPack2x16float: case sem::IntrinsicType::kUnpack2x16float: { - make_indent(); if (intrinsic->Type() == sem::IntrinsicType::kPack2x16float) { - out_ << "as_type(half2("; + out << "as_type(half2("; } else { - out_ << "float2(as_type("; + out << "float2(as_type("; } - if (!EmitExpression(expr->params()[0])) { + if (!EmitExpression(out, expr->params()[0])) { return false; } - out_ << "))"; + out << "))"; return true; } // TODO(crbug.com/tint/661): Combine sequential barriers to a single // instruction. case sem::IntrinsicType::kStorageBarrier: { - make_indent(); - out_ << "threadgroup_barrier(mem_flags::mem_device)"; + out << "threadgroup_barrier(mem_flags::mem_device)"; return true; } case sem::IntrinsicType::kWorkgroupBarrier: { - make_indent(); - out_ << "threadgroup_barrier(mem_flags::mem_threadgroup)"; + out << "threadgroup_barrier(mem_flags::mem_threadgroup)"; return true; } case sem::IntrinsicType::kIgnore: { - out_ << "(void) "; - if (!EmitExpression(expr->params()[0])) { + out << "(void) "; + if (!EmitExpression(out, expr->params()[0])) { return false; } return true; @@ -402,27 +402,27 @@ bool GeneratorImpl::EmitIntrinsicCall(ast::CallExpression* expr, return false; } - make_indent(); - out_ << name << "("; + out << name << "("; bool first = true; const auto& params = expr->params(); for (auto* param : params) { if (!first) { - out_ << ", "; + out << ", "; } first = false; - if (!EmitExpression(param)) { + if (!EmitExpression(out, param)) { return false; } } - out_ << ")"; + out << ")"; return true; } -bool GeneratorImpl::EmitTextureCall(ast::CallExpression* expr, +bool GeneratorImpl::EmitTextureCall(std::ostream& out, + ast::CallExpression* expr, const sem::Intrinsic* intrinsic) { using Usage = sem::ParameterUsage; @@ -453,13 +453,13 @@ bool GeneratorImpl::EmitTextureCall(ast::CallExpression* expr, ast::IdentifierExpression, ast::MemberAccessorExpression, ast::TypeConstructorExpression>(); if (paren_lhs) { - out_ << "("; + out << "("; } - if (!EmitExpression(texture)) { + if (!EmitExpression(out, texture)) { return false; } if (paren_lhs) { - out_ << ")"; + out << ")"; } return true; }; @@ -490,55 +490,55 @@ bool GeneratorImpl::EmitTextureCall(ast::CallExpression* expr, if (!texture_expr()) { return false; } - out_ << ".get_" << name << "("; + out << ".get_" << name << "("; if (auto* level = arg(Usage::kLevel)) { - if (!EmitExpression(level)) { + if (!EmitExpression(out, level)) { return false; } } - out_ << ")"; + out << ")"; return true; }; if (dims.size() == 1) { - out_ << "int("; + out << "int("; get_dim(dims[0]); - out_ << ")"; + out << ")"; } else { - EmitType(TypeOf(expr)->UnwrapRef(), ""); - out_ << "("; + EmitType(out, TypeOf(expr)->UnwrapRef(), ""); + out << "("; for (size_t i = 0; i < dims.size(); i++) { if (i > 0) { - out_ << ", "; + out << ", "; } get_dim(dims[i]); } - out_ << ")"; + out << ")"; } return true; } case sem::IntrinsicType::kTextureNumLayers: { - out_ << "int("; + out << "int("; if (!texture_expr()) { return false; } - out_ << ".get_array_size())"; + out << ".get_array_size())"; return true; } case sem::IntrinsicType::kTextureNumLevels: { - out_ << "int("; + out << "int("; if (!texture_expr()) { return false; } - out_ << ".get_num_mip_levels())"; + out << ".get_num_mip_levels())"; return true; } case sem::IntrinsicType::kTextureNumSamples: { - out_ << "int("; + out << "int("; if (!texture_expr()) { return false; } - out_ << ".get_num_samples())"; + out << ".get_num_samples())"; return true; } default: @@ -556,18 +556,18 @@ bool GeneratorImpl::EmitTextureCall(ast::CallExpression* expr, case sem::IntrinsicType::kTextureSampleBias: case sem::IntrinsicType::kTextureSampleLevel: case sem::IntrinsicType::kTextureSampleGrad: - out_ << ".sample("; + out << ".sample("; break; case sem::IntrinsicType::kTextureSampleCompare: case sem::IntrinsicType::kTextureSampleCompareLevel: - out_ << ".sample_compare("; + out << ".sample_compare("; break; case sem::IntrinsicType::kTextureLoad: - out_ << ".read("; + out << ".read("; lod_param_is_named = false; break; case sem::IntrinsicType::kTextureStore: - out_ << ".write("; + out << ".write("; break; default: TINT_UNREACHABLE(Writer, diagnostics_) @@ -578,7 +578,7 @@ bool GeneratorImpl::EmitTextureCall(ast::CallExpression* expr, bool first_arg = true; auto maybe_write_comma = [&] { if (!first_arg) { - out_ << ", "; + out << ", "; } first_arg = false; }; @@ -598,14 +598,14 @@ bool GeneratorImpl::EmitTextureCall(ast::CallExpression* expr, casted = true; switch (texture_type->dim()) { case ast::TextureDimension::k1d: - out_ << "uint("; + out << "uint("; break; case ast::TextureDimension::k2d: case ast::TextureDimension::k2dArray: - out_ << "uint2("; + out << "uint2("; break; case ast::TextureDimension::k3d: - out_ << "uint3("; + out << "uint3("; break; default: TINT_ICE(Writer, diagnostics_) @@ -614,38 +614,38 @@ bool GeneratorImpl::EmitTextureCall(ast::CallExpression* expr, } } - if (!EmitExpression(e)) + if (!EmitExpression(out, e)) return false; if (casted) { - out_ << ")"; + out << ")"; } } } if (auto* bias = arg(Usage::kBias)) { maybe_write_comma(); - out_ << "bias("; - if (!EmitExpression(bias)) { + out << "bias("; + if (!EmitExpression(out, bias)) { return false; } - out_ << ")"; + out << ")"; } if (auto* level = arg(Usage::kLevel)) { maybe_write_comma(); if (lod_param_is_named) { - out_ << "level("; + out << "level("; } - if (!EmitExpression(level)) { + if (!EmitExpression(out, level)) { return false; } if (lod_param_is_named) { - out_ << ")"; + out << ")"; } } if (intrinsic->Type() == sem::IntrinsicType::kTextureSampleCompareLevel) { maybe_write_comma(); - out_ << "level(0)"; + out << "level(0)"; } if (auto* ddx = arg(Usage::kDdx)) { auto dim = texture_type->dim(); @@ -653,16 +653,16 @@ bool GeneratorImpl::EmitTextureCall(ast::CallExpression* expr, case ast::TextureDimension::k2d: case ast::TextureDimension::k2dArray: maybe_write_comma(); - out_ << "gradient2d("; + out << "gradient2d("; break; case ast::TextureDimension::k3d: maybe_write_comma(); - out_ << "gradient3d("; + out << "gradient3d("; break; case ast::TextureDimension::kCube: case ast::TextureDimension::kCubeArray: maybe_write_comma(); - out_ << "gradientcube("; + out << "gradientcube("; break; default: { std::stringstream err; @@ -671,24 +671,24 @@ bool GeneratorImpl::EmitTextureCall(ast::CallExpression* expr, return false; } } - if (!EmitExpression(ddx)) { + if (!EmitExpression(out, ddx)) { return false; } - out_ << ", "; - if (!EmitExpression(arg(Usage::kDdy))) { + out << ", "; + if (!EmitExpression(out, arg(Usage::kDdy))) { return false; } - out_ << ")"; + out << ")"; } if (auto* offset = arg(Usage::kOffset)) { maybe_write_comma(); - if (!EmitExpression(offset)) { + if (!EmitExpression(out, offset)) { return false; } } - out_ << ")"; + out << ")"; return true; } @@ -836,91 +836,85 @@ std::string GeneratorImpl::generate_builtin_name( } bool GeneratorImpl::EmitCase(ast::CaseStatement* stmt) { - make_indent(); - if (stmt->IsDefault()) { - out_ << "default:"; + line() << "default: {"; } else { - bool first = true; for (auto* selector : stmt->selectors()) { - if (!first) { - out_ << std::endl; - make_indent(); - } - first = false; - - out_ << "case "; - if (!EmitLiteral(selector)) { + auto out = line(); + out << "case "; + if (!EmitLiteral(out, selector)) { return false; } - out_ << ":"; + out << ":"; + if (selector == stmt->selectors().back()) { + out << " {"; + } } } - out_ << " {" << std::endl; + { + ScopedIndent si(this); - increment_indent(); + for (auto* s : *stmt->body()) { + if (!EmitStatement(s)) { + return false; + } + } - for (auto* s : *stmt->body()) { - if (!EmitStatement(s)) { - return false; + if (!last_is_break_or_fallthrough(stmt->body())) { + line() << "break;"; } } - if (!last_is_break_or_fallthrough(stmt->body())) { - make_indent(); - out_ << "break;" << std::endl; - } - - decrement_indent(); - make_indent(); - out_ << "}" << std::endl; + line() << "}"; return true; } -bool GeneratorImpl::EmitConstructor(ast::ConstructorExpression* expr) { +bool GeneratorImpl::EmitConstructor(std::ostream& out, + ast::ConstructorExpression* expr) { if (auto* scalar = expr->As()) { - return EmitScalarConstructor(scalar); + return EmitScalarConstructor(out, scalar); } - return EmitTypeConstructor(expr->As()); + return EmitTypeConstructor(out, expr->As()); } bool GeneratorImpl::EmitContinue(ast::ContinueStatement*) { if (!emit_continuing_()) { return false; } - make_indent(); - out_ << "continue;" << std::endl; + + line() << "continue;"; return true; } -bool GeneratorImpl::EmitTypeConstructor(ast::TypeConstructorExpression* expr) { +bool GeneratorImpl::EmitTypeConstructor(std::ostream& out, + ast::TypeConstructorExpression* expr) { auto* type = TypeOf(expr)->UnwrapRef(); if (type->IsAnyOf()) { - out_ << "{"; + out << "{"; } else { - if (!EmitType(type, "")) { + if (!EmitType(out, type, "")) { return false; } - out_ << "("; + out << "("; } int i = 0; for (auto* e : expr->values()) { if (i > 0) { - out_ << ", "; + out << ", "; } if (auto* struct_ty = type->As()) { // Emit field designators for structures to account for padding members. auto* member = struct_ty->Members()[i]->Declaration(); auto name = program_->Symbols().NameFor(member->symbol()); - out_ << "." << name << "="; + out << "." << name << "="; } - if (!EmitExpression(e)) { + if (!EmitExpression(out, e)) { return false; } @@ -928,41 +922,41 @@ bool GeneratorImpl::EmitTypeConstructor(ast::TypeConstructorExpression* expr) { } if (type->IsAnyOf()) { - out_ << "}"; + out << "}"; } else { - out_ << ")"; + out << ")"; } return true; } -bool GeneratorImpl::EmitZeroValue(const sem::Type* type) { +bool GeneratorImpl::EmitZeroValue(std::ostream& out, const sem::Type* type) { if (type->Is()) { - out_ << "false"; + out << "false"; } else if (type->Is()) { - out_ << "0.0f"; + out << "0.0f"; } else if (type->Is()) { - out_ << "0"; + out << "0"; } else if (type->Is()) { - out_ << "0u"; + out << "0u"; } else if (auto* vec = type->As()) { - return EmitZeroValue(vec->type()); + return EmitZeroValue(out, vec->type()); } else if (auto* mat = type->As()) { - if (!EmitType(mat, "")) { + if (!EmitType(out, mat, "")) { return false; } - out_ << "("; - if (!EmitZeroValue(mat->type())) { + out << "("; + if (!EmitZeroValue(out, mat->type())) { return false; } - out_ << ")"; + out << ")"; } else if (auto* arr = type->As()) { - out_ << "{"; - if (!EmitZeroValue(arr->ElemType())) { + out << "{"; + if (!EmitZeroValue(out, arr->ElemType())) { return false; } - out_ << "}"; + out << "}"; } else if (type->As()) { - out_ << "{}"; + out << "{}"; } else { diagnostics_.add_error( diag::System::Writer, @@ -973,19 +967,20 @@ bool GeneratorImpl::EmitZeroValue(const sem::Type* type) { } bool GeneratorImpl::EmitScalarConstructor( + std::ostream& out, ast::ScalarConstructorExpression* expr) { - return EmitLiteral(expr->literal()); + return EmitLiteral(out, expr->literal()); } -bool GeneratorImpl::EmitLiteral(ast::Literal* lit) { +bool GeneratorImpl::EmitLiteral(std::ostream& out, ast::Literal* lit) { if (auto* l = lit->As()) { - out_ << (l->IsTrue() ? "true" : "false"); + out << (l->IsTrue() ? "true" : "false"); } else if (auto* fl = lit->As()) { - out_ << FloatToString(fl->value()) << "f"; + out << FloatToString(fl->value()) << "f"; } else if (auto* sl = lit->As()) { - out_ << sl->value(); + out << sl->value(); } else if (auto* ul = lit->As()) { - out_ << ul->value() << "u"; + out << ul->value() << "u"; } else { diagnostics_.add_error(diag::System::Writer, "unknown literal type"); return false; @@ -993,30 +988,30 @@ bool GeneratorImpl::EmitLiteral(ast::Literal* lit) { return true; } -bool GeneratorImpl::EmitExpression(ast::Expression* expr) { +bool GeneratorImpl::EmitExpression(std::ostream& out, ast::Expression* expr) { if (auto* a = expr->As()) { - return EmitArrayAccessor(a); + return EmitArrayAccessor(out, a); } if (auto* b = expr->As()) { - return EmitBinary(b); + return EmitBinary(out, b); } if (auto* b = expr->As()) { - return EmitBitcast(b); + return EmitBitcast(out, b); } if (auto* c = expr->As()) { - return EmitCall(c); + return EmitCall(out, c); } if (auto* c = expr->As()) { - return EmitConstructor(c); + return EmitConstructor(out, c); } if (auto* i = expr->As()) { - return EmitIdentifier(i); + return EmitIdentifier(out, i); } if (auto* m = expr->As()) { - return EmitMemberAccessor(m); + return EmitMemberAccessor(out, m); } if (auto* u = expr->As()) { - return EmitUnaryOp(u); + return EmitUnaryOp(out, u); } diagnostics_.add_error(diag::System::Writer, @@ -1024,16 +1019,16 @@ bool GeneratorImpl::EmitExpression(ast::Expression* expr) { return false; } -void GeneratorImpl::EmitStage(ast::PipelineStage stage) { +void GeneratorImpl::EmitStage(std::ostream& out, ast::PipelineStage stage) { switch (stage) { case ast::PipelineStage::kFragment: - out_ << "fragment"; + out << "fragment"; break; case ast::PipelineStage::kVertex: - out_ << "vertex"; + out << "vertex"; break; case ast::PipelineStage::kCompute: - out_ << "kernel"; + out << "kernel"; break; case ast::PipelineStage::kNone: break; @@ -1042,75 +1037,76 @@ void GeneratorImpl::EmitStage(ast::PipelineStage stage) { } bool GeneratorImpl::EmitFunction(ast::Function* func) { - make_indent(); - auto* func_sem = program_->Sem().Get(func); - if (!EmitType(func_sem->ReturnType(), "")) { - return false; - } - out_ << " " << program_->Symbols().NameFor(func->symbol()) << "("; - - bool first = true; - for (const auto& data : func_sem->ReferencedUniformVariables()) { - auto* var = data.first; - if (!first) { - out_ << ", "; - } - first = false; - - out_ << "constant "; - // TODO(dsinclair): Can arrays be uniform? If so, fix this ... - if (!EmitType(var->Type()->UnwrapRef(), "")) { + { + auto out = line(); + if (!EmitType(out, func_sem->ReturnType(), "")) { return false; } - out_ << "& " << program_->Symbols().NameFor(var->Declaration()->symbol()); + out << " " << program_->Symbols().NameFor(func->symbol()) << "("; + + bool first = true; + for (const auto& data : func_sem->ReferencedUniformVariables()) { + auto* var = data.first; + if (!first) { + out << ", "; + } + first = false; + + out << "constant "; + // TODO(dsinclair): Can arrays be uniform? If so, fix this ... + if (!EmitType(out, var->Type()->UnwrapRef(), "")) { + return false; + } + out << "& " << program_->Symbols().NameFor(var->Declaration()->symbol()); + } + + for (const auto& data : func_sem->ReferencedStorageBufferVariables()) { + auto* var = data.first; + if (!first) { + out << ", "; + } + first = false; + + if (var->Access() == ast::Access::kRead) { + out << "const "; + } + + out << "device "; + if (!EmitType(out, var->Type()->UnwrapRef(), "")) { + return false; + } + out << "& " << program_->Symbols().NameFor(var->Declaration()->symbol()); + } + + for (auto* v : func->params()) { + if (!first) { + out << ", "; + } + first = false; + + auto* type = program_->Sem().Get(v)->Type(); + + std::string param_name = + "const " + program_->Symbols().NameFor(v->symbol()); + if (!EmitType(out, type, param_name)) { + return false; + } + // Parameter name is output as part of the type for arrays and pointers. + if (!type->Is() && !type->Is()) { + out << " " << program_->Symbols().NameFor(v->symbol()); + } + } + + out << ") {"; } - for (const auto& data : func_sem->ReferencedStorageBufferVariables()) { - auto* var = data.first; - if (!first) { - out_ << ", "; - } - first = false; - - if (var->Access() == ast::Access::kRead) { - out_ << "const "; - } - - out_ << "device "; - if (!EmitType(var->Type()->UnwrapRef(), "")) { - return false; - } - out_ << "& " << program_->Symbols().NameFor(var->Declaration()->symbol()); - } - - for (auto* v : func->params()) { - if (!first) { - out_ << ", "; - } - first = false; - - auto* type = program_->Sem().Get(v)->Type(); - - std::string param_name = - "const " + program_->Symbols().NameFor(v->symbol()); - if (!EmitType(type, param_name)) { - return false; - } - // Parameter name is output as part of the type for arrays and pointers. - if (!type->Is() && !type->Is()) { - out_ << " " << program_->Symbols().NameFor(v->symbol()); - } - } - - out_ << ") "; - - if (!EmitBlockAndNewline(func->body())) { + if (!EmitStatementsWithIndent(func->body()->statements())) { return false; } - out_ << std::endl; + line() << "}"; return true; } @@ -1148,249 +1144,258 @@ std::string GeneratorImpl::builtin_to_attribute(ast::Builtin builtin) const { bool GeneratorImpl::EmitEntryPointFunction(ast::Function* func) { auto* func_sem = program_->Sem().Get(func); - make_indent(); + { + auto out = line(); - EmitStage(func->pipeline_stage()); - out_ << " " << func->return_type()->FriendlyName(program_->Symbols()); - out_ << " " << program_->Symbols().NameFor(func->symbol()) << "("; + EmitStage(out, func->pipeline_stage()); + out << " " << func->return_type()->FriendlyName(program_->Symbols()); + out << " " << program_->Symbols().NameFor(func->symbol()) << "("; - // Emit entry point parameters. - bool first = true; - for (auto* var : func->params()) { - if (!first) { - out_ << ", "; - } - first = false; + // Emit entry point parameters. + bool first = true; + for (auto* var : func->params()) { + if (!first) { + out << ", "; + } + first = false; - auto* type = program_->Sem().Get(var)->Type()->UnwrapRef(); + auto* type = program_->Sem().Get(var)->Type()->UnwrapRef(); - if (!EmitType(type, "")) { - return false; - } - - out_ << " " << program_->Symbols().NameFor(var->symbol()); - - if (type->Is()) { - out_ << " [[stage_in]]"; - } else if (var->type()->is_handle()) { - auto* binding = - ast::GetDecoration(var->decorations()); - if (binding == nullptr) { - TINT_ICE(Writer, diagnostics_) - << "missing binding attribute for entry point parameter"; + if (!EmitType(out, type, "")) { return false; } - if (var->type()->Is()) { - out_ << " [[sampler(" << binding->value() << ")]]"; - } else if (var->type()->Is()) { - out_ << " [[texture(" << binding->value() << ")]]"; - } else { - TINT_ICE(Writer, diagnostics_) - << "invalid handle type entry point parameter"; - return false; - } - } else { - auto& decos = var->decorations(); - bool builtin_found = false; - for (auto* deco : decos) { - auto* builtin = deco->As(); - if (!builtin) { - continue; - } - builtin_found = true; + out << " " << program_->Symbols().NameFor(var->symbol()); - auto attr = builtin_to_attribute(builtin->value()); - if (attr.empty()) { - diagnostics_.add_error(diag::System::Writer, "unknown builtin"); + if (type->Is()) { + out << " [[stage_in]]"; + } else if (var->type()->is_handle()) { + auto* binding = + ast::GetDecoration(var->decorations()); + if (binding == nullptr) { + TINT_ICE(Writer, diagnostics_) + << "missing binding attribute for entry point parameter"; return false; } - out_ << " [[" << attr << "]]"; + if (var->type()->Is()) { + out << " [[sampler(" << binding->value() << ")]]"; + } else if (var->type()->Is()) { + out << " [[texture(" << binding->value() << ")]]"; + } else { + TINT_ICE(Writer, diagnostics_) + << "invalid handle type entry point parameter"; + return false; + } + } else { + auto& decos = var->decorations(); + bool builtin_found = false; + for (auto* deco : decos) { + auto* builtin = deco->As(); + if (!builtin) { + continue; + } + + builtin_found = true; + + auto attr = builtin_to_attribute(builtin->value()); + if (attr.empty()) { + diagnostics_.add_error(diag::System::Writer, "unknown builtin"); + return false; + } + out << " [[" << attr << "]]"; + } + if (!builtin_found) { + TINT_ICE(Writer, diagnostics_) << "Unsupported entry point parameter"; + } } - if (!builtin_found) { - TINT_ICE(Writer, diagnostics_) << "Unsupported entry point parameter"; + } + + for (auto data : func_sem->ReferencedUniformVariables()) { + if (!first) { + out << ", "; + } + first = false; + + auto* var = data.first; + // TODO(dsinclair): We're using the binding to make up the buffer number + // but we should instead be using a provided mapping that uses both buffer + // and set. https://bugs.chromium.org/p/tint/issues/detail?id=104 + auto* binding = data.second.binding; + if (binding == nullptr) { + diagnostics_.add_error( + diag::System::Writer, + "unable to find binding information for uniform: " + + program_->Symbols().NameFor(var->Declaration()->symbol())); + return false; + } + // auto* set = data.second.set; + + out << "constant "; + // TODO(dsinclair): Can you have a uniform array? If so, this needs to be + // updated to handle arrays property. + if (!EmitType(out, var->Type()->UnwrapRef(), "")) { + return false; + } + out << "& " << program_->Symbols().NameFor(var->Declaration()->symbol()) + << " [[buffer(" << binding->value() << ")]]"; + } + + for (auto data : func_sem->ReferencedStorageBufferVariables()) { + if (!first) { + out << ", "; + } + first = false; + + auto* var = data.first; + // TODO(dsinclair): We're using the binding to make up the buffer number + // but we should instead be using a provided mapping that uses both buffer + // and set. https://bugs.chromium.org/p/tint/issues/detail?id=104 + auto* binding = data.second.binding; + // auto* set = data.second.set; + + if (var->Access() == ast::Access::kRead) { + out << "const "; + } + + out << "device "; + if (!EmitType(out, var->Type()->UnwrapRef(), "")) { + return false; + } + out << "& " << program_->Symbols().NameFor(var->Declaration()->symbol()) + << " [[buffer(" << binding->value() << ")]]"; + } + + out << ") {"; + } + + { + ScopedIndent si(this); + + if (!EmitStatements(func->body()->statements())) { + return false; + } + + if (!Is(func->get_last_statement())) { + ast::ReturnStatement ret(ProgramID{}, Source{}); + if (!EmitStatement(&ret)) { + return false; } } } - for (auto data : func_sem->ReferencedUniformVariables()) { - if (!first) { - out_ << ", "; - } - first = false; - - auto* var = data.first; - // TODO(dsinclair): We're using the binding to make up the buffer number but - // we should instead be using a provided mapping that uses both buffer and - // set. https://bugs.chromium.org/p/tint/issues/detail?id=104 - auto* binding = data.second.binding; - if (binding == nullptr) { - diagnostics_.add_error( - diag::System::Writer, - "unable to find binding information for uniform: " + - program_->Symbols().NameFor(var->Declaration()->symbol())); - return false; - } - // auto* set = data.second.set; - - out_ << "constant "; - // TODO(dsinclair): Can you have a uniform array? If so, this needs to be - // updated to handle arrays property. - if (!EmitType(var->Type()->UnwrapRef(), "")) { - return false; - } - out_ << "& " << program_->Symbols().NameFor(var->Declaration()->symbol()) - << " [[buffer(" << binding->value() << ")]]"; - } - - for (auto data : func_sem->ReferencedStorageBufferVariables()) { - if (!first) { - out_ << ", "; - } - first = false; - - auto* var = data.first; - // TODO(dsinclair): We're using the binding to make up the buffer number but - // we should instead be using a provided mapping that uses both buffer and - // set. https://bugs.chromium.org/p/tint/issues/detail?id=104 - auto* binding = data.second.binding; - // auto* set = data.second.set; - - if (var->Access() == ast::Access::kRead) { - out_ << "const "; - } - - out_ << "device "; - if (!EmitType(var->Type()->UnwrapRef(), "")) { - return false; - } - out_ << "& " << program_->Symbols().NameFor(var->Declaration()->symbol()) - << " [[buffer(" << binding->value() << ")]]"; - } - - out_ << ") {" << std::endl; - - increment_indent(); - - for (auto* s : *func->body()) { - if (!EmitStatement(s)) { - return false; - } - } - auto* last_statement = func->get_last_statement(); - if (last_statement == nullptr || - !last_statement->Is()) { - ast::ReturnStatement ret(ProgramID{}, Source{}); - if (!EmitStatement(&ret)) { - return false; - } - } - - decrement_indent(); - make_indent(); - out_ << "}" << std::endl << std::endl; + line() << "}"; return true; } -bool GeneratorImpl::EmitIdentifier(ast::IdentifierExpression* expr) { - out_ << program_->Symbols().NameFor(expr->symbol()); +bool GeneratorImpl::EmitIdentifier(std::ostream& out, + ast::IdentifierExpression* expr) { + out << program_->Symbols().NameFor(expr->symbol()); return true; } bool GeneratorImpl::EmitLoop(ast::LoopStatement* stmt) { - make_indent(); - auto emit_continuing = [this, stmt]() { if (stmt->has_continuing()) { - make_indent(); if (!EmitBlock(stmt->continuing())) { return false; } - out_ << std::endl; } return true; }; TINT_SCOPED_ASSIGNMENT(emit_continuing_, emit_continuing); - bool ok = EmitBlockBraces("while (true)", [&] { - for (auto* s : stmt->body()->statements()) { - if (!EmitStatement(s)) { - return false; - } + line() << "while (true) {"; + { + ScopedIndent si(this); + if (!EmitStatements(stmt->body()->statements())) { + return false; } - return emit_continuing(); - }); - out_ << std::endl; - return ok; -} + if (!emit_continuing()) { + return false; + } + } + line() << "}"; -bool GeneratorImpl::EmitDiscard(ast::DiscardStatement*) { - make_indent(); - // TODO(dsinclair): Verify this is correct when the discard semantics are - // defined for WGSL (https://github.com/gpuweb/gpuweb/issues/361) - out_ << "discard_fragment();" << std::endl; return true; } -bool GeneratorImpl::EmitElse(ast::ElseStatement* stmt) { - if (stmt->HasCondition()) { - out_ << " else if ("; - if (!EmitExpression(stmt->condition())) { - return false; - } - out_ << ") "; - } else { - out_ << " else "; - } - - return EmitBlock(stmt->body()); +bool GeneratorImpl::EmitDiscard(ast::DiscardStatement*) { + // TODO(dsinclair): Verify this is correct when the discard semantics are + // defined for WGSL (https://github.com/gpuweb/gpuweb/issues/361) + line() << "discard_fragment();"; + return true; } bool GeneratorImpl::EmitIf(ast::IfStatement* stmt) { - make_indent(); - - out_ << "if ("; - if (!EmitExpression(stmt->condition())) { - return false; + { + auto out = line(); + out << "if ("; + if (!EmitExpression(out, stmt->condition())) { + return false; + } + out << ") {"; } - out_ << ") "; - if (!EmitBlock(stmt->body())) { + if (!EmitStatementsWithIndent(stmt->body()->statements())) { return false; } for (auto* e : stmt->else_statements()) { - if (!EmitElse(e)) { + if (e->HasCondition()) { + line() << "} else {"; + increment_indent(); + + { + auto out = line(); + out << "if ("; + if (!EmitExpression(out, e->condition())) { + return false; + } + out << ") {"; + } + } else { + line() << "} else {"; + } + + if (!EmitStatementsWithIndent(e->body()->statements())) { return false; } } - out_ << std::endl; + line() << "}"; + + for (auto* e : stmt->else_statements()) { + if (e->HasCondition()) { + decrement_indent(); + line() << "}"; + } + } return true; } -bool GeneratorImpl::EmitMemberAccessor(ast::MemberAccessorExpression* expr) { +bool GeneratorImpl::EmitMemberAccessor(std::ostream& out, + ast::MemberAccessorExpression* expr) { bool paren_lhs = !expr->structure() ->IsAnyOf(); if (paren_lhs) { - out_ << "("; + out << "("; } - if (!EmitExpression(expr->structure())) { + if (!EmitExpression(out, expr->structure())) { return false; } if (paren_lhs) { - out_ << ")"; + out << ")"; } - out_ << "."; + out << "."; // Swizzles get written out directly if (program_->Sem().Get(expr)->Is()) { - out_ << program_->Symbols().NameFor(expr->member()->symbol()); - } else if (!EmitExpression(expr->member())) { + out << program_->Symbols().NameFor(expr->member()->symbol()); + } else if (!EmitExpression(out, expr->member())) { return false; } @@ -1398,69 +1403,46 @@ bool GeneratorImpl::EmitMemberAccessor(ast::MemberAccessorExpression* expr) { } bool GeneratorImpl::EmitReturn(ast::ReturnStatement* stmt) { - make_indent(); - - out_ << "return"; + auto out = line(); + out << "return"; if (stmt->has_value()) { - out_ << " "; - if (!EmitExpression(stmt->value())) { + out << " "; + if (!EmitExpression(out, stmt->value())) { return false; } } - out_ << ";" << std::endl; + out << ";"; return true; } bool GeneratorImpl::EmitBlock(const ast::BlockStatement* stmt) { - out_ << "{" << std::endl; - increment_indent(); + line() << "{"; - for (auto* s : *stmt) { - if (!EmitStatement(s)) { - return false; - } + if (!EmitStatementsWithIndent(stmt->statements())) { + return false; } - decrement_indent(); - make_indent(); - out_ << "}"; + line() << "}"; return true; } -bool GeneratorImpl::EmitBlockAndNewline(const ast::BlockStatement* stmt) { - const bool result = EmitBlock(stmt); - if (result) { - out_ << std::endl; - } - return result; -} - -bool GeneratorImpl::EmitIndentedBlockAndNewline(ast::BlockStatement* stmt) { - make_indent(); - const bool result = EmitBlock(stmt); - if (result) { - out_ << std::endl; - } - return result; -} - bool GeneratorImpl::EmitStatement(ast::Statement* stmt) { if (auto* a = stmt->As()) { return EmitAssign(a); } if (auto* b = stmt->As()) { - return EmitIndentedBlockAndNewline(b); + return EmitBlock(b); } if (auto* b = stmt->As()) { return EmitBreak(b); } if (auto* c = stmt->As()) { - make_indent(); - if (!EmitCall(c->expr())) { + auto out = line(); + if (!EmitCall(out, c->expr())) { return false; } - out_ << ";" << std::endl; + out << ";"; return true; } if (auto* c = stmt->As()) { @@ -1470,8 +1452,7 @@ bool GeneratorImpl::EmitStatement(ast::Statement* stmt) { return EmitDiscard(d); } if (stmt->As()) { - make_indent(); - out_ << "/* fallthrough */" << std::endl; + line() << "/* fallthrough */"; return true; } if (auto* i = stmt->As()) { @@ -1496,31 +1477,47 @@ bool GeneratorImpl::EmitStatement(ast::Statement* stmt) { return false; } -bool GeneratorImpl::EmitSwitch(ast::SwitchStatement* stmt) { - make_indent(); - - out_ << "switch("; - if (!EmitExpression(stmt->condition())) { - return false; - } - out_ << ") {" << std::endl; - - increment_indent(); - - for (auto* s : stmt->body()) { - if (!EmitCase(s)) { +bool GeneratorImpl::EmitStatements(const ast::StatementList& stmts) { + for (auto* s : stmts) { + if (!EmitStatement(s)) { return false; } } + return true; +} - decrement_indent(); - make_indent(); - out_ << "}" << std::endl; +bool GeneratorImpl::EmitStatementsWithIndent(const ast::StatementList& stmts) { + ScopedIndent si(this); + return EmitStatements(stmts); +} + +bool GeneratorImpl::EmitSwitch(ast::SwitchStatement* stmt) { + { + auto out = line(); + out << "switch("; + if (!EmitExpression(out, stmt->condition())) { + return false; + } + out << ") {"; + } + + { + ScopedIndent si(this); + for (auto* s : stmt->body()) { + if (!EmitCase(s)) { + return false; + } + } + } + + line() << "}"; return true; } -bool GeneratorImpl::EmitType(const sem::Type* type, const std::string& name) { +bool GeneratorImpl::EmitType(std::ostream& out, + const sem::Type* type, + const std::string& name) { if (auto* ary = type->As()) { const sem::Type* base_type = ary; std::vector sizes; @@ -1532,87 +1529,87 @@ bool GeneratorImpl::EmitType(const sem::Type* type, const std::string& name) { } base_type = arr->ElemType(); } - if (!EmitType(base_type, "")) { + if (!EmitType(out, base_type, "")) { return false; } if (!name.empty()) { - out_ << " " << name; + out << " " << name; } for (uint32_t size : sizes) { - out_ << "[" << size << "]"; + out << "[" << size << "]"; } } else if (type->Is()) { - out_ << "bool"; + out << "bool"; } else if (type->Is()) { - out_ << "float"; + out << "float"; } else if (type->Is()) { - out_ << "int"; + out << "int"; } else if (auto* mat = type->As()) { - if (!EmitType(mat->type(), "")) { + if (!EmitType(out, mat->type(), "")) { return false; } - out_ << mat->columns() << "x" << mat->rows(); + out << mat->columns() << "x" << mat->rows(); } else if (auto* ptr = type->As()) { switch (ptr->StorageClass()) { case ast::StorageClass::kFunction: case ast::StorageClass::kPrivate: case ast::StorageClass::kUniformConstant: - out_ << "thread "; + out << "thread "; break; case ast::StorageClass::kWorkgroup: - out_ << "threadgroup "; + out << "threadgroup "; break; case ast::StorageClass::kStorage: - out_ << "device "; + out << "device "; break; case ast::StorageClass::kUniform: - out_ << "constant "; + out << "constant "; break; default: TINT_ICE(Writer, diagnostics_) << "unhandled storage class for pointer"; } if (ptr->StoreType()->Is()) { std::string inner = "(*" + name + ")"; - if (!EmitType(ptr->StoreType(), inner)) { + if (!EmitType(out, ptr->StoreType(), inner)) { return false; } } else { - if (!EmitType(ptr->StoreType(), "")) { + if (!EmitType(out, ptr->StoreType(), "")) { return false; } - out_ << "* " << name; + out << "* " << name; } } else if (type->Is()) { - out_ << "sampler"; + out << "sampler"; } else if (auto* str = type->As()) { // The struct type emits as just the name. The declaration would be emitted // as part of emitting the declared types. - out_ << program_->Symbols().NameFor(str->Declaration()->name()); + out << program_->Symbols().NameFor(str->Declaration()->name()); } else if (auto* tex = type->As()) { if (tex->Is()) { - out_ << "depth"; + out << "depth"; } else { - out_ << "texture"; + out << "texture"; } switch (tex->dim()) { case ast::TextureDimension::k1d: - out_ << "1d"; + out << "1d"; break; case ast::TextureDimension::k2d: - out_ << "2d"; + out << "2d"; break; case ast::TextureDimension::k2dArray: - out_ << "2d_array"; + out << "2d_array"; break; case ast::TextureDimension::k3d: - out_ << "3d"; + out << "3d"; break; case ast::TextureDimension::kCube: - out_ << "cube"; + out << "cube"; break; case ast::TextureDimension::kCubeArray: - out_ << "cube_array"; + out << "cube_array"; break; default: diagnostics_.add_error(diag::System::Writer, @@ -1620,51 +1617,51 @@ bool GeneratorImpl::EmitType(const sem::Type* type, const std::string& name) { return false; } if (tex->Is()) { - out_ << "_ms"; + out << "_ms"; } - out_ << "<"; + out << "<"; if (tex->Is()) { - out_ << "float, access::sample"; + out << "float, access::sample"; } else if (auto* storage = tex->As()) { - if (!EmitType(storage->type(), "")) { + if (!EmitType(out, storage->type(), "")) { return false; } std::string access_str; if (storage->access() == ast::Access::kRead) { - out_ << ", access::read"; + out << ", access::read"; } else if (storage->access() == ast::Access::kWrite) { - out_ << ", access::write"; + out << ", access::write"; } else { diagnostics_.add_error(diag::System::Writer, "Invalid access control for storage texture"); return false; } } else if (auto* ms = tex->As()) { - if (!EmitType(ms->type(), "")) { + if (!EmitType(out, ms->type(), "")) { return false; } - out_ << ", access::read"; + out << ", access::read"; } else if (auto* sampled = tex->As()) { - if (!EmitType(sampled->type(), "")) { + if (!EmitType(out, sampled->type(), "")) { return false; } - out_ << ", access::sample"; + out << ", access::sample"; } else { diagnostics_.add_error(diag::System::Writer, "invalid texture type"); return false; } - out_ << ">"; + out << ">"; } else if (type->Is()) { - out_ << "uint"; + out << "uint"; } else if (auto* vec = type->As()) { - if (!EmitType(vec->type(), "")) { + if (!EmitType(out, vec->type(), "")) { return false; } - out_ << vec->size(); + out << vec->size(); } else if (type->Is()) { - out_ << "void"; + out << "void"; } else { diagnostics_.add_error(diag::System::Writer, "unknown type in EmitType: " + type->type_name()); @@ -1674,49 +1671,51 @@ bool GeneratorImpl::EmitType(const sem::Type* type, const std::string& name) { return true; } -bool GeneratorImpl::EmitPackedType(const sem::Type* type, +bool GeneratorImpl::EmitPackedType(std::ostream& out, + const sem::Type* type, const std::string& name) { if (auto* vec = type->As()) { - out_ << "packed_"; - if (!EmitType(vec->type(), "")) { + out << "packed_"; + if (!EmitType(out, vec->type(), "")) { return false; } - out_ << vec->size(); + out << vec->size(); return true; } - return EmitType(type, name); + return EmitType(out, type, name); } bool GeneratorImpl::EmitStructType(const sem::Struct* str) { - out_ << "struct " << program_->Symbols().NameFor(str->Declaration()->name()) - << " {" << std::endl; + line() << "struct " << program_->Symbols().NameFor(str->Declaration()->name()) + << " {"; bool is_host_shareable = str->IsHostShareable(); // Emits a `/* 0xnnnn */` byte offset comment for a struct member. - auto add_byte_offset_comment = [&](uint32_t offset) { - std::ios_base::fmtflags saved_flag_state(out_.flags()); - out_ << "/* 0x" << std::hex << std::setfill('0') << std::setw(4) << offset - << " */ "; - out_.flags(saved_flag_state); + auto add_byte_offset_comment = [&](std::ostream& out, uint32_t offset) { + std::ios_base::fmtflags saved_flag_state(out.flags()); + out << "/* 0x" << std::hex << std::setfill('0') << std::setw(4) << offset + << " */ "; + out.flags(saved_flag_state); }; uint32_t pad_count = 0; - auto add_padding = [&](uint32_t size) { + auto add_padding = [&](uint32_t size, uint32_t msl_offset) { std::string name; do { name = "tint_pad_" + std::to_string(pad_count++); } while (str->FindMember(program_->Symbols().Get(name))); - out_ << "int8_t " << name << "[" << size << "];" << std::endl; + auto out = line(); + add_byte_offset_comment(out, msl_offset); + out << "int8_t " << name << "[" << size << "];"; }; increment_indent(); uint32_t msl_offset = 0; for (auto* mem : str->Members()) { - make_indent(); - + auto out = line(); auto name = program_->Symbols().NameFor(mem->Declaration()->symbol()); auto wgsl_offset = mem->Offset(); @@ -1731,19 +1730,17 @@ bool GeneratorImpl::EmitStructType(const sem::Struct* str) { // Generate padding if required if (auto padding = wgsl_offset - msl_offset) { - add_byte_offset_comment(msl_offset); - add_padding(padding); + add_padding(padding, msl_offset); msl_offset += padding; - make_indent(); } - add_byte_offset_comment(msl_offset); + add_byte_offset_comment(out, msl_offset); - if (!EmitPackedType(mem->Type(), name)) { + if (!EmitPackedType(out, mem->Type(), name)) { return false; } } else { - if (!EmitType(mem->Type(), name)) { + if (!EmitType(out, mem->Type(), name)) { return false; } } @@ -1752,7 +1749,7 @@ bool GeneratorImpl::EmitStructType(const sem::Struct* str) { // Array member name will be output with the type if (!ty->Is()) { - out_ << " " << name; + out << " " << name; } // Emit decorations @@ -1763,7 +1760,7 @@ bool GeneratorImpl::EmitStructType(const sem::Struct* str) { diagnostics_.add_error(diag::System::Writer, "unknown builtin"); return false; } - out_ << " [[" << attr << "]]"; + out << " [[" << attr << "]]"; } else if (auto* loc = deco->As()) { auto& pipeline_stage_uses = str->PipelineStageUses(); if (pipeline_stage_uses.size() != 1) { @@ -1772,16 +1769,16 @@ bool GeneratorImpl::EmitStructType(const sem::Struct* str) { } if (pipeline_stage_uses.count(sem::PipelineStageUsage::kVertexInput)) { - out_ << " [[attribute(" + std::to_string(loc->value()) + ")]]"; + out << " [[attribute(" + std::to_string(loc->value()) + ")]]"; } else if (pipeline_stage_uses.count( sem::PipelineStageUsage::kVertexOutput)) { - out_ << " [[user(locn" + std::to_string(loc->value()) + ")]]"; + out << " [[user(locn" + std::to_string(loc->value()) + ")]]"; } else if (pipeline_stage_uses.count( sem::PipelineStageUsage::kFragmentInput)) { - out_ << " [[user(locn" + std::to_string(loc->value()) + ")]]"; + out << " [[user(locn" + std::to_string(loc->value()) + ")]]"; } else if (pipeline_stage_uses.count( sem::PipelineStageUsage::kFragmentOutput)) { - out_ << " [[color(" + std::to_string(loc->value()) + ")]]"; + out << " [[color(" + std::to_string(loc->value()) + ")]]"; } else { TINT_ICE(Writer, diagnostics_) << "invalid use of location decoration"; @@ -1789,7 +1786,7 @@ bool GeneratorImpl::EmitStructType(const sem::Struct* str) { } } - out_ << ";" << std::endl; + out << ";"; if (is_host_shareable) { // Calculate new MSL offset @@ -1805,50 +1802,46 @@ bool GeneratorImpl::EmitStructType(const sem::Struct* str) { } if (is_host_shareable && str->Size() != msl_offset) { - make_indent(); - add_byte_offset_comment(msl_offset); - add_padding(str->Size() - msl_offset); + add_padding(str->Size() - msl_offset, msl_offset); } decrement_indent(); - make_indent(); - out_ << "};" << std::endl; + line() << "};"; return true; } -bool GeneratorImpl::EmitUnaryOp(ast::UnaryOpExpression* expr) { +bool GeneratorImpl::EmitUnaryOp(std::ostream& out, + ast::UnaryOpExpression* expr) { switch (expr->op()) { case ast::UnaryOp::kAddressOf: - out_ << "&"; + out << "&"; break; case ast::UnaryOp::kComplement: - out_ << "~"; + out << "~"; break; case ast::UnaryOp::kIndirection: - out_ << "*"; + out << "*"; break; case ast::UnaryOp::kNot: - out_ << "!"; + out << "!"; break; case ast::UnaryOp::kNegation: - out_ << "-"; + out << "-"; break; } - out_ << "("; + out << "("; - if (!EmitExpression(expr->expr())) { + if (!EmitExpression(out, expr->expr())) { return false; } - out_ << ")"; + out << ")"; return true; } bool GeneratorImpl::EmitVariable(const sem::Variable* var) { - make_indent(); - auto* decl = var->Declaration(); for (auto* deco : decl->decorations()) { @@ -1858,16 +1851,18 @@ bool GeneratorImpl::EmitVariable(const sem::Variable* var) { } } + auto out = line(); + switch (var->StorageClass()) { case ast::StorageClass::kFunction: case ast::StorageClass::kUniformConstant: case ast::StorageClass::kNone: break; case ast::StorageClass::kPrivate: - out_ << "thread "; + out << "thread "; break; case ast::StorageClass::kWorkgroup: - out_ << "threadgroup "; + out << "threadgroup "; break; default: TINT_ICE(Writer, diagnostics_) << "unhandled variable storage class"; @@ -1880,35 +1875,33 @@ bool GeneratorImpl::EmitVariable(const sem::Variable* var) { if (decl->is_const()) { name = "const " + name; } - if (!EmitType(type, name)) { + if (!EmitType(out, type, name)) { return false; } // Variable name is output as part of the type for arrays and pointers. if (!type->Is() && !type->Is()) { - out_ << " " << name; + out << " " << name; } if (decl->constructor() != nullptr) { - out_ << " = "; - if (!EmitExpression(decl->constructor())) { + out << " = "; + if (!EmitExpression(out, decl->constructor())) { return false; } } else if (var->StorageClass() == ast::StorageClass::kPrivate || var->StorageClass() == ast::StorageClass::kFunction || var->StorageClass() == ast::StorageClass::kNone) { - out_ << " = "; - if (!EmitZeroValue(type)) { + out << " = "; + if (!EmitZeroValue(out, type)) { return false; } } - out_ << ";" << std::endl; + out << ";"; return true; } bool GeneratorImpl::EmitProgramConstVariable(const ast::Variable* var) { - make_indent(); - for (auto* d : var->decorations()) { if (!d->Is()) { diagnostics_.add_error(diag::System::Writer, @@ -1921,25 +1914,26 @@ bool GeneratorImpl::EmitProgramConstVariable(const ast::Variable* var) { return false; } - out_ << "constant "; + auto out = line(); + out << "constant "; auto* type = program_->Sem().Get(var)->Type()->UnwrapRef(); - if (!EmitType(type, program_->Symbols().NameFor(var->symbol()))) { + if (!EmitType(out, type, program_->Symbols().NameFor(var->symbol()))) { return false; } if (!type->Is()) { - out_ << " " << program_->Symbols().NameFor(var->symbol()); + out << " " << program_->Symbols().NameFor(var->symbol()); } auto* sem_var = program_->Sem().Get(var); if (sem_var->IsPipelineConstant()) { - out_ << " [[function_constant(" << sem_var->ConstantId() << ")]]"; + out << " [[function_constant(" << sem_var->ConstantId() << ")]]"; } else if (var->constructor() != nullptr) { - out_ << " = "; - if (!EmitExpression(var->constructor())) { + out << " = "; + if (!EmitExpression(out, var->constructor())) { return false; } } - out_ << ";" << std::endl; + out << ";"; return true; } @@ -2009,21 +2003,6 @@ GeneratorImpl::SizeAndAlign GeneratorImpl::MslPackedTypeSizeAndAlign( return {}; } -template -bool GeneratorImpl::EmitBlockBraces(const std::string& prefix, F&& cb) { - out_ << prefix << (prefix.empty() ? "{" : " {") << std::endl; - increment_indent(); - - if (!cb()) { - return false; - } - - decrement_indent(); - make_indent(); - out_ << "}"; - return true; -} - } // namespace msl } // namespace writer } // namespace tint diff --git a/src/writer/msl/generator_impl.h b/src/writer/msl/generator_impl.h index 7ce7a657e3..77b66755ab 100644 --- a/src/writer/msl/generator_impl.h +++ b/src/writer/msl/generator_impl.h @@ -64,62 +64,63 @@ class GeneratorImpl : public TextGenerator { /// @returns true if the declared type was emitted bool EmitTypeDecl(const sem::Type* ty); /// Handles an array accessor expression + /// @param out the output of the expression stream /// @param expr the expression to emit /// @returns true if the array accessor was emitted - bool EmitArrayAccessor(ast::ArrayAccessorExpression* expr); + bool EmitArrayAccessor(std::ostream& out, ast::ArrayAccessorExpression* expr); /// Handles an assignment statement /// @param stmt the statement to emit /// @returns true if the statement was emitted successfully bool EmitAssign(ast::AssignmentStatement* stmt); /// Handles generating a binary expression + /// @param out the output of the expression stream /// @param expr the binary expression /// @returns true if the expression was emitted, false otherwise - bool EmitBinary(ast::BinaryExpression* expr); + bool EmitBinary(std::ostream& out, ast::BinaryExpression* expr); /// Handles generating a bitcast expression + /// @param out the output of the expression stream /// @param expr the bitcast expression /// @returns true if the bitcast was emitted - bool EmitBitcast(ast::BitcastExpression* expr); + bool EmitBitcast(std::ostream& out, ast::BitcastExpression* expr); /// Handles a block statement /// @param stmt the statement to emit /// @returns true if the statement was emitted successfully bool EmitBlock(const ast::BlockStatement* stmt); - /// Handles a block statement with a newline at the end - /// @param stmt the statement to emit - /// @returns true if the statement was emitted successfully - bool EmitIndentedBlockAndNewline(ast::BlockStatement* stmt); - /// Handles a block statement with a newline at the end - /// @param stmt the statement to emit - /// @returns true if the statement was emitted successfully - bool EmitBlockAndNewline(const ast::BlockStatement* stmt); /// Handles a break statement /// @param stmt the statement to emit /// @returns true if the statement was emitted successfully bool EmitBreak(ast::BreakStatement* stmt); /// Handles generating a call expression + /// @param out the output of the expression stream /// @param expr the call expression /// @returns true if the call expression is emitted - bool EmitCall(ast::CallExpression* expr); + bool EmitCall(std::ostream& out, ast::CallExpression* expr); /// Handles generating an intrinsic call expression + /// @param out the output of the expression stream /// @param expr the call expression /// @param intrinsic the intrinsic being called /// @returns true if the call expression is emitted - bool EmitIntrinsicCall(ast::CallExpression* expr, + bool EmitIntrinsicCall(std::ostream& out, + ast::CallExpression* expr, const sem::Intrinsic* intrinsic); /// Handles generating a call to a texture function (`textureSample`, /// `textureSampleGrad`, etc) + /// @param out the output of the expression stream /// @param expr the call expression /// @param intrinsic the semantic information for the texture intrinsic /// @returns true if the call expression is emitted - bool EmitTextureCall(ast::CallExpression* expr, + bool EmitTextureCall(std::ostream& out, + ast::CallExpression* expr, const sem::Intrinsic* intrinsic); /// Handles a case statement /// @param stmt the statement /// @returns true if the statement was emitted successfully bool EmitCase(ast::CaseStatement* stmt); /// Handles generating constructor expressions + /// @param out the output of the expression stream /// @param expr the constructor expression /// @returns true if the expression was emitted - bool EmitConstructor(ast::ConstructorExpression* expr); + bool EmitConstructor(std::ostream& out, ast::ConstructorExpression* expr); /// Handles a continue statement /// @param stmt the statement to emit /// @returns true if the statement was emitted successfully @@ -128,85 +129,106 @@ class GeneratorImpl : public TextGenerator { /// @param stmt the discard statement /// @returns true if the statement was successfully emitted bool EmitDiscard(ast::DiscardStatement* stmt); - /// Handles generating an else statement - /// @param stmt the statement to emit - /// @returns true if the statement was emitted - bool EmitElse(ast::ElseStatement* stmt); /// Handles emitting the entry point function /// @param func the entry point function /// @returns true if the entry point function was emitted bool EmitEntryPointFunction(ast::Function* func); /// Handles generate an Expression + /// @param out the output of the expression stream /// @param expr the expression /// @returns true if the expression was emitted - bool EmitExpression(ast::Expression* expr); + bool EmitExpression(std::ostream& out, ast::Expression* expr); /// Handles generating a function /// @param func the function to generate /// @returns true if the function was emitted bool EmitFunction(ast::Function* func); /// Handles generating an identifier expression + /// @param out the output of the expression stream /// @param expr the identifier expression /// @returns true if the identifier was emitted - bool EmitIdentifier(ast::IdentifierExpression* expr); + bool EmitIdentifier(std::ostream& out, ast::IdentifierExpression* expr); /// Handles an if statement /// @param stmt the statement to emit /// @returns true if the statement was successfully emitted bool EmitIf(ast::IfStatement* stmt); /// Handles a literal + /// @param out the output of the expression stream /// @param lit the literal to emit /// @returns true if the literal was successfully emitted - bool EmitLiteral(ast::Literal* lit); + bool EmitLiteral(std::ostream& out, ast::Literal* lit); /// Handles a loop statement /// @param stmt the statement to emit /// @returns true if the statement was emitted bool EmitLoop(ast::LoopStatement* stmt); /// Handles a member accessor expression + /// @param out the output of the expression stream /// @param expr the member accessor expression /// @returns true if the member accessor was emitted - bool EmitMemberAccessor(ast::MemberAccessorExpression* expr); + bool EmitMemberAccessor(std::ostream& out, + ast::MemberAccessorExpression* expr); /// Handles return statements /// @param stmt the statement to emit /// @returns true if the statement was successfully emitted bool EmitReturn(ast::ReturnStatement* stmt); /// Handles generating a scalar constructor + /// @param out the output of the expression stream /// @param expr the scalar constructor expression /// @returns true if the scalar constructor is emitted - bool EmitScalarConstructor(ast::ScalarConstructorExpression* expr); + bool EmitScalarConstructor(std::ostream& out, + ast::ScalarConstructorExpression* expr); /// Handles emitting a pipeline stage name + /// @param out the output of the expression stream /// @param stage the stage to emit - void EmitStage(ast::PipelineStage stage); + void EmitStage(std::ostream& out, ast::PipelineStage stage); /// Handles statement /// @param stmt the statement to emit /// @returns true if the statement was emitted bool EmitStatement(ast::Statement* stmt); + /// Emits a list of statements + /// @param stmts the statement list + /// @returns true if the statements were emitted successfully + bool EmitStatements(const ast::StatementList& stmts); + /// Emits a list of statements with an indentation + /// @param stmts the statement list + /// @returns true if the statements were emitted successfully + bool EmitStatementsWithIndent(const ast::StatementList& stmts); /// Handles generating a switch statement /// @param stmt the statement to emit /// @returns true if the statement was emitted bool EmitSwitch(ast::SwitchStatement* stmt); /// Handles generating a type + /// @param out the output of the type stream /// @param type the type to generate /// @param name the name of the variable, only used for array emission /// @returns true if the type is emitted - bool EmitType(const sem::Type* type, const std::string& name); + bool EmitType(std::ostream& out, + const sem::Type* type, + const std::string& name); /// Handles generating an MSL-packed storage type. /// If the type does not have a packed form, the standard non-packed form is /// emitted. + /// @param out the output of the type stream /// @param type the type to generate /// @param name the name of the variable, only used for array emission /// @returns true if the type is emitted - bool EmitPackedType(const sem::Type* type, const std::string& name); + bool EmitPackedType(std::ostream& out, + const sem::Type* type, + const std::string& name); /// Handles generating a struct declaration /// @param str the struct to generate /// @returns true if the struct is emitted bool EmitStructType(const sem::Struct* str); /// Handles emitting a type constructor + /// @param out the output of the expression stream /// @param expr the type constructor expression /// @returns true if the constructor is emitted - bool EmitTypeConstructor(ast::TypeConstructorExpression* expr); + bool EmitTypeConstructor(std::ostream& out, + ast::TypeConstructorExpression* expr); /// Handles a unary op expression + /// @param out the output of the expression stream /// @param expr the expression to emit /// @returns true if the expression was emitted - bool EmitUnaryOp(ast::UnaryOpExpression* expr); + bool EmitUnaryOp(std::ostream& out, ast::UnaryOpExpression* expr); /// Handles generating a variable /// @param var the variable to generate /// @returns true if the variable was emitted @@ -216,9 +238,10 @@ class GeneratorImpl : public TextGenerator { /// @returns true if the variable was emitted bool EmitProgramConstVariable(const ast::Variable* var); /// Emits the zero value for the given type + /// @param out the output of the expression stream /// @param type the type to emit the value for /// @returns true if the zero value was successfully emitted. - bool EmitZeroValue(const sem::Type* type); + bool EmitZeroValue(std::ostream& out, const sem::Type* type); /// Handles generating a builtin name /// @param intrinsic the semantic info for the intrinsic @@ -259,15 +282,6 @@ class GeneratorImpl : public TextGenerator { /// type. SizeAndAlign MslPackedTypeSizeAndAlign(const sem::Type* ty); - /// Emits `prefix`, followed by an opening brace `{`, then calls `cb` to emit - /// the block body, then finally emits the closing brace `}`. - /// @param prefix the string to emit before the opening brace - /// @param cb a function or function-like object with the signature `bool()` - /// that emits the block body. - /// @returns the return value of `cb`. - template - bool EmitBlockBraces(const std::string& prefix, F&& cb); - const Program* program_ = nullptr; std::function emit_continuing_; }; diff --git a/src/writer/msl/generator_impl_array_accessor_test.cc b/src/writer/msl/generator_impl_array_accessor_test.cc index f5c2f13bfc..dc2f0dcccc 100644 --- a/src/writer/msl/generator_impl_array_accessor_test.cc +++ b/src/writer/msl/generator_impl_array_accessor_test.cc @@ -28,8 +28,9 @@ TEST_F(MslGeneratorImplTest, ArrayAccessor) { GeneratorImpl& gen = Build(); - ASSERT_TRUE(gen.EmitExpression(expr)) << gen.error(); - EXPECT_EQ(gen.result(), "ary[5]"); + std::stringstream out; + ASSERT_TRUE(gen.EmitExpression(out, expr)) << gen.error(); + EXPECT_EQ(out.str(), "ary[5]"); } TEST_F(MslGeneratorImplTest, ArrayAccessor_OfDref) { @@ -41,8 +42,9 @@ TEST_F(MslGeneratorImplTest, ArrayAccessor_OfDref) { GeneratorImpl& gen = Build(); - ASSERT_TRUE(gen.EmitExpression(expr)) << gen.error(); - EXPECT_EQ(gen.result(), "(*(p))[5]"); + std::stringstream out; + ASSERT_TRUE(gen.EmitExpression(out, expr)) << gen.error(); + EXPECT_EQ(out.str(), "(*(p))[5]"); } } // namespace diff --git a/src/writer/msl/generator_impl_binary_test.cc b/src/writer/msl/generator_impl_binary_test.cc index f1099cd3a4..939a4821a4 100644 --- a/src/writer/msl/generator_impl_binary_test.cc +++ b/src/writer/msl/generator_impl_binary_test.cc @@ -47,8 +47,9 @@ TEST_P(MslBinaryTest, Emit) { GeneratorImpl& gen = Build(); - ASSERT_TRUE(gen.EmitExpression(expr)) << gen.error(); - EXPECT_EQ(gen.result(), params.result); + std::stringstream out; + ASSERT_TRUE(gen.EmitExpression(out, expr)) << gen.error(); + EXPECT_EQ(out.str(), params.result); } INSTANTIATE_TEST_SUITE_P( MslGeneratorImplTest, diff --git a/src/writer/msl/generator_impl_bitcast_test.cc b/src/writer/msl/generator_impl_bitcast_test.cc index dc9c910f52..aee349716c 100644 --- a/src/writer/msl/generator_impl_bitcast_test.cc +++ b/src/writer/msl/generator_impl_bitcast_test.cc @@ -27,8 +27,9 @@ TEST_F(MslGeneratorImplTest, EmitExpression_Bitcast) { GeneratorImpl& gen = Build(); - ASSERT_TRUE(gen.EmitExpression(bitcast)) << gen.error(); - EXPECT_EQ(gen.result(), "as_type(1)"); + std::stringstream out; + ASSERT_TRUE(gen.EmitExpression(out, bitcast)) << gen.error(); + EXPECT_EQ(out.str(), "as_type(1)"); } } // namespace diff --git a/src/writer/msl/generator_impl_block_test.cc b/src/writer/msl/generator_impl_block_test.cc index 17a6ffaf54..952302dfb6 100644 --- a/src/writer/msl/generator_impl_block_test.cc +++ b/src/writer/msl/generator_impl_block_test.cc @@ -45,9 +45,10 @@ TEST_F(MslGeneratorImplTest, Emit_Block_WithoutNewline) { gen.increment_indent(); ASSERT_TRUE(gen.EmitBlock(b)) << gen.error(); - EXPECT_EQ(gen.result(), R"({ + EXPECT_EQ(gen.result(), R"( { discard_fragment(); - })"); + } +)"); } } // namespace diff --git a/src/writer/msl/generator_impl_call_test.cc b/src/writer/msl/generator_impl_call_test.cc index d355726f8f..3f2b2cb11f 100644 --- a/src/writer/msl/generator_impl_call_test.cc +++ b/src/writer/msl/generator_impl_call_test.cc @@ -31,8 +31,9 @@ TEST_F(MslGeneratorImplTest, EmitExpression_Call_WithoutParams) { GeneratorImpl& gen = Build(); - ASSERT_TRUE(gen.EmitExpression(call)) << gen.error(); - EXPECT_EQ(gen.result(), "my_func()"); + std::stringstream out; + ASSERT_TRUE(gen.EmitExpression(out, call)) << gen.error(); + EXPECT_EQ(out.str(), "my_func()"); } TEST_F(MslGeneratorImplTest, EmitExpression_Call_WithParams) { @@ -50,8 +51,9 @@ TEST_F(MslGeneratorImplTest, EmitExpression_Call_WithParams) { GeneratorImpl& gen = Build(); - ASSERT_TRUE(gen.EmitExpression(call)) << gen.error(); - EXPECT_EQ(gen.result(), "my_func(param1, param2)"); + std::stringstream out; + ASSERT_TRUE(gen.EmitExpression(out, call)) << gen.error(); + EXPECT_EQ(out.str(), "my_func(param1, param2)"); } TEST_F(MslGeneratorImplTest, EmitStatement_Call) { diff --git a/src/writer/msl/generator_impl_cast_test.cc b/src/writer/msl/generator_impl_cast_test.cc index 4b18761945..6f66478ad2 100644 --- a/src/writer/msl/generator_impl_cast_test.cc +++ b/src/writer/msl/generator_impl_cast_test.cc @@ -27,8 +27,9 @@ TEST_F(MslGeneratorImplTest, EmitExpression_Cast_Scalar) { GeneratorImpl& gen = Build(); - ASSERT_TRUE(gen.EmitExpression(cast)) << gen.error(); - EXPECT_EQ(gen.result(), "float(1)"); + std::stringstream out; + ASSERT_TRUE(gen.EmitExpression(out, cast)) << gen.error(); + EXPECT_EQ(out.str(), "float(1)"); } TEST_F(MslGeneratorImplTest, EmitExpression_Cast_Vector) { @@ -37,8 +38,9 @@ TEST_F(MslGeneratorImplTest, EmitExpression_Cast_Vector) { GeneratorImpl& gen = Build(); - ASSERT_TRUE(gen.EmitExpression(cast)) << gen.error(); - EXPECT_EQ(gen.result(), "float3(int3(1, 2, 3))"); + std::stringstream out; + ASSERT_TRUE(gen.EmitExpression(out, cast)) << gen.error(); + EXPECT_EQ(out.str(), "float3(int3(1, 2, 3))"); } } // namespace diff --git a/src/writer/msl/generator_impl_function_test.cc b/src/writer/msl/generator_impl_function_test.cc index 202a947a42..11bd7bc80e 100644 --- a/src/writer/msl/generator_impl_function_test.cc +++ b/src/writer/msl/generator_impl_function_test.cc @@ -36,9 +36,9 @@ TEST_F(MslGeneratorImplTest, Emit_Function) { gen.increment_indent(); ASSERT_TRUE(gen.Generate()) << gen.error(); - EXPECT_EQ(gen.result(), R"(#include + EXPECT_EQ(gen.result(), R"( #include -using namespace metal; + using namespace metal; void my_func() { return; } @@ -62,9 +62,9 @@ TEST_F(MslGeneratorImplTest, Emit_Function_WithParams) { gen.increment_indent(); ASSERT_TRUE(gen.Generate()) << gen.error(); - EXPECT_EQ(gen.result(), R"(#include + EXPECT_EQ(gen.result(), R"( #include -using namespace metal; + using namespace metal; void my_func(float a, int b) { return; } @@ -564,9 +564,9 @@ TEST_F(MslGeneratorImplTest, Emit_Function_WithArrayParams) { gen.increment_indent(); ASSERT_TRUE(gen.Generate()) << gen.error(); - EXPECT_EQ(gen.result(), R"(#include + EXPECT_EQ(gen.result(), R"( #include -using namespace metal; + using namespace metal; struct tint_array_wrapper { float arr[5]; }; @@ -589,9 +589,9 @@ TEST_F(MslGeneratorImplTest, Emit_Function_WithArrayReturn) { gen.increment_indent(); ASSERT_TRUE(gen.Generate()) << gen.error(); - EXPECT_EQ(gen.result(), R"(#include + EXPECT_EQ(gen.result(), R"( #include -using namespace metal; + using namespace metal; struct tint_array_wrapper { float arr[5]; }; diff --git a/src/writer/msl/generator_impl_identifier_test.cc b/src/writer/msl/generator_impl_identifier_test.cc index 13b739ebd7..02754041c3 100644 --- a/src/writer/msl/generator_impl_identifier_test.cc +++ b/src/writer/msl/generator_impl_identifier_test.cc @@ -29,8 +29,9 @@ TEST_F(MslGeneratorImplTest, EmitIdentifierExpression) { GeneratorImpl& gen = Build(); - ASSERT_TRUE(gen.EmitExpression(i)) << gen.error(); - EXPECT_EQ(gen.result(), "foo"); + std::stringstream out; + ASSERT_TRUE(gen.EmitExpression(out, i)) << gen.error(); + EXPECT_EQ(out.str(), "foo"); } } // namespace diff --git a/src/writer/msl/generator_impl_if_test.cc b/src/writer/msl/generator_impl_if_test.cc index 9840b2377f..4bbf950186 100644 --- a/src/writer/msl/generator_impl_if_test.cc +++ b/src/writer/msl/generator_impl_if_test.cc @@ -50,8 +50,10 @@ TEST_F(MslGeneratorImplTest, Emit_IfWithElseIf) { ASSERT_TRUE(gen.EmitStatement(i)) << gen.error(); EXPECT_EQ(gen.result(), R"( if (cond) { return; - } else if (else_cond) { - return; + } else { + if (else_cond) { + return; + } } )"); } @@ -88,10 +90,12 @@ TEST_F(MslGeneratorImplTest, Emit_IfWithMultiple) { ASSERT_TRUE(gen.EmitStatement(i)) << gen.error(); EXPECT_EQ(gen.result(), R"( if (cond) { return; - } else if (else_cond) { - return; } else { - return; + if (else_cond) { + return; + } else { + return; + } } )"); } diff --git a/src/writer/msl/generator_impl_import_test.cc b/src/writer/msl/generator_impl_import_test.cc index 6b756dcaf5..ec3ff4dd43 100644 --- a/src/writer/msl/generator_impl_import_test.cc +++ b/src/writer/msl/generator_impl_import_test.cc @@ -81,8 +81,9 @@ TEST_F(MslGeneratorImplTest, MslImportData_SingleParamTest_IntScalar) { GeneratorImpl& gen = Build(); - ASSERT_TRUE(gen.EmitCall(expr)) << gen.error(); - EXPECT_EQ(gen.result(), R"(abs(1))"); + std::stringstream out; + ASSERT_TRUE(gen.EmitCall(out, expr)) << gen.error(); + EXPECT_EQ(out.str(), R"(abs(1))"); } using MslImportData_DualParamTest = TestParamHelper; @@ -94,8 +95,9 @@ TEST_P(MslImportData_DualParamTest, FloatScalar) { GeneratorImpl& gen = Build(); - ASSERT_TRUE(gen.EmitCall(expr)) << gen.error(); - EXPECT_EQ(gen.result(), std::string(param.msl_name) + "(1.0f, 2.0f)"); + std::stringstream out; + ASSERT_TRUE(gen.EmitCall(out, expr)) << gen.error(); + EXPECT_EQ(out.str(), std::string(param.msl_name) + "(1.0f, 2.0f)"); } INSTANTIATE_TEST_SUITE_P(MslGeneratorImplTest, MslImportData_DualParamTest, @@ -117,10 +119,11 @@ TEST_P(MslImportData_DualParam_VectorTest, FloatVector) { GeneratorImpl& gen = Build(); - ASSERT_TRUE(gen.EmitCall(expr)) << gen.error(); - EXPECT_EQ(gen.result(), std::string(param.msl_name) + - "(float3(1.0f, 2.0f, 3.0f), " - "float3(4.0f, 5.0f, 6.0f))"); + std::stringstream out; + ASSERT_TRUE(gen.EmitCall(out, expr)) << gen.error(); + EXPECT_EQ(out.str(), std::string(param.msl_name) + + "(float3(1.0f, 2.0f, 3.0f), " + "float3(4.0f, 5.0f, 6.0f))"); } INSTANTIATE_TEST_SUITE_P(MslGeneratorImplTest, MslImportData_DualParam_VectorTest, @@ -135,8 +138,9 @@ TEST_P(MslImportData_DualParam_Int_Test, IntScalar) { GeneratorImpl& gen = Build(); - ASSERT_TRUE(gen.EmitCall(expr)) << gen.error(); - EXPECT_EQ(gen.result(), std::string(param.msl_name) + "(1, 2)"); + std::stringstream out; + ASSERT_TRUE(gen.EmitCall(out, expr)) << gen.error(); + EXPECT_EQ(out.str(), std::string(param.msl_name) + "(1, 2)"); } INSTANTIATE_TEST_SUITE_P(MslGeneratorImplTest, MslImportData_DualParam_Int_Test, @@ -152,8 +156,9 @@ TEST_P(MslImportData_TripleParamTest, FloatScalar) { GeneratorImpl& gen = Build(); - ASSERT_TRUE(gen.EmitCall(expr)) << gen.error(); - EXPECT_EQ(gen.result(), std::string(param.msl_name) + "(1.0f, 2.0f, 3.0f)"); + std::stringstream out; + ASSERT_TRUE(gen.EmitCall(out, expr)) << gen.error(); + EXPECT_EQ(out.str(), std::string(param.msl_name) + "(1.0f, 2.0f, 3.0f)"); } INSTANTIATE_TEST_SUITE_P( MslGeneratorImplTest, @@ -173,8 +178,9 @@ TEST_P(MslImportData_TripleParam_Int_Test, IntScalar) { GeneratorImpl& gen = Build(); - ASSERT_TRUE(gen.EmitCall(expr)) << gen.error(); - EXPECT_EQ(gen.result(), std::string(param.msl_name) + "(1, 2, 3)"); + std::stringstream out; + ASSERT_TRUE(gen.EmitCall(out, expr)) << gen.error(); + EXPECT_EQ(out.str(), std::string(param.msl_name) + "(1, 2, 3)"); } INSTANTIATE_TEST_SUITE_P(MslGeneratorImplTest, MslImportData_TripleParam_Int_Test, @@ -190,8 +196,9 @@ TEST_F(MslGeneratorImplTest, MslImportData_Determinant) { GeneratorImpl& gen = Build(); - ASSERT_TRUE(gen.EmitCall(expr)) << gen.error(); - EXPECT_EQ(gen.result(), std::string("determinant(var)")); + std::stringstream out; + ASSERT_TRUE(gen.EmitCall(out, expr)) << gen.error(); + EXPECT_EQ(out.str(), std::string("determinant(var)")); } } // namespace diff --git a/src/writer/msl/generator_impl_intrinsic_test.cc b/src/writer/msl/generator_impl_intrinsic_test.cc index 0d69beaff2..f2233b0074 100644 --- a/src/writer/msl/generator_impl_intrinsic_test.cc +++ b/src/writer/msl/generator_impl_intrinsic_test.cc @@ -291,9 +291,9 @@ TEST_F(MslGeneratorImplTest, Intrinsic_Call) { GeneratorImpl& gen = Build(); - gen.increment_indent(); - ASSERT_TRUE(gen.EmitExpression(call)) << gen.error(); - EXPECT_EQ(gen.result(), " dot(param1, param2)"); + std::stringstream out; + ASSERT_TRUE(gen.EmitExpression(out, call)) << gen.error(); + EXPECT_EQ(out.str(), "dot(param1, param2)"); } TEST_F(MslGeneratorImplTest, StorageBarrier) { @@ -302,9 +302,9 @@ TEST_F(MslGeneratorImplTest, StorageBarrier) { GeneratorImpl& gen = Build(); - gen.increment_indent(); - ASSERT_TRUE(gen.EmitExpression(call)) << gen.error(); - EXPECT_EQ(gen.result(), " threadgroup_barrier(mem_flags::mem_device)"); + std::stringstream out; + ASSERT_TRUE(gen.EmitExpression(out, call)) << gen.error(); + EXPECT_EQ(out.str(), "threadgroup_barrier(mem_flags::mem_device)"); } TEST_F(MslGeneratorImplTest, WorkgroupBarrier) { @@ -313,9 +313,9 @@ TEST_F(MslGeneratorImplTest, WorkgroupBarrier) { GeneratorImpl& gen = Build(); - gen.increment_indent(); - ASSERT_TRUE(gen.EmitExpression(call)) << gen.error(); - EXPECT_EQ(gen.result(), " threadgroup_barrier(mem_flags::mem_threadgroup)"); + std::stringstream out; + ASSERT_TRUE(gen.EmitExpression(out, call)) << gen.error(); + EXPECT_EQ(out.str(), "threadgroup_barrier(mem_flags::mem_threadgroup)"); } TEST_F(MslGeneratorImplTest, Pack2x16Float) { @@ -325,9 +325,9 @@ TEST_F(MslGeneratorImplTest, Pack2x16Float) { GeneratorImpl& gen = Build(); - gen.increment_indent(); - ASSERT_TRUE(gen.EmitExpression(call)) << gen.error(); - EXPECT_EQ(gen.result(), " as_type(half2(p1))"); + std::stringstream out; + ASSERT_TRUE(gen.EmitExpression(out, call)) << gen.error(); + EXPECT_EQ(out.str(), "as_type(half2(p1))"); } TEST_F(MslGeneratorImplTest, Unpack2x16Float) { @@ -337,9 +337,9 @@ TEST_F(MslGeneratorImplTest, Unpack2x16Float) { GeneratorImpl& gen = Build(); - gen.increment_indent(); - ASSERT_TRUE(gen.EmitExpression(call)) << gen.error(); - EXPECT_EQ(gen.result(), " float2(as_type(p1))"); + std::stringstream out; + ASSERT_TRUE(gen.EmitExpression(out, call)) << gen.error(); + EXPECT_EQ(out.str(), "float2(as_type(p1))"); } TEST_F(MslGeneratorImplTest, Ignore) { diff --git a/src/writer/msl/generator_impl_intrinsic_texture_test.cc b/src/writer/msl/generator_impl_intrinsic_texture_test.cc index bf6958eeab..aba0aacf17 100644 --- a/src/writer/msl/generator_impl_intrinsic_texture_test.cc +++ b/src/writer/msl/generator_impl_intrinsic_texture_test.cc @@ -281,10 +281,11 @@ TEST_P(MslGeneratorIntrinsicTextureTest, Call) { GeneratorImpl& gen = Build(); - ASSERT_TRUE(gen.EmitExpression(call)) << gen.error(); + std::stringstream out; + ASSERT_TRUE(gen.EmitExpression(out, call)) << gen.error(); auto expected = expected_texture_overload(param.overload); - EXPECT_EQ(expected, gen.result()); + EXPECT_EQ(expected, out.str()); } INSTANTIATE_TEST_SUITE_P( diff --git a/src/writer/msl/generator_impl_member_accessor_test.cc b/src/writer/msl/generator_impl_member_accessor_test.cc index 2047e22b18..9623a2b8cd 100644 --- a/src/writer/msl/generator_impl_member_accessor_test.cc +++ b/src/writer/msl/generator_impl_member_accessor_test.cc @@ -29,8 +29,9 @@ TEST_F(MslGeneratorImplTest, EmitExpression_MemberAccessor) { GeneratorImpl& gen = Build(); - ASSERT_TRUE(gen.EmitExpression(expr)) << gen.error(); - EXPECT_EQ(gen.result(), "str.mem"); + std::stringstream out; + ASSERT_TRUE(gen.EmitExpression(out, expr)) << gen.error(); + EXPECT_EQ(out.str(), "str.mem"); } TEST_F(MslGeneratorImplTest, EmitExpression_MemberAccessor_Swizzle_xyz) { @@ -40,8 +41,9 @@ TEST_F(MslGeneratorImplTest, EmitExpression_MemberAccessor_Swizzle_xyz) { WrapInFunction(expr); GeneratorImpl& gen = Build(); - ASSERT_TRUE(gen.EmitExpression(expr)) << gen.error(); - EXPECT_EQ(gen.result(), "my_vec.xyz"); + std::stringstream out; + ASSERT_TRUE(gen.EmitExpression(out, expr)) << gen.error(); + EXPECT_EQ(out.str(), "my_vec.xyz"); } TEST_F(MslGeneratorImplTest, EmitExpression_MemberAccessor_Swizzle_gbr) { @@ -51,8 +53,9 @@ TEST_F(MslGeneratorImplTest, EmitExpression_MemberAccessor_Swizzle_gbr) { WrapInFunction(expr); GeneratorImpl& gen = Build(); - ASSERT_TRUE(gen.EmitExpression(expr)) << gen.error(); - EXPECT_EQ(gen.result(), "my_vec.gbr"); + std::stringstream out; + ASSERT_TRUE(gen.EmitExpression(out, expr)) << gen.error(); + EXPECT_EQ(out.str(), "my_vec.gbr"); } } // namespace diff --git a/src/writer/msl/generator_impl_type_test.cc b/src/writer/msl/generator_impl_type_test.cc index e92e7b540a..d595724a89 100644 --- a/src/writer/msl/generator_impl_type_test.cc +++ b/src/writer/msl/generator_impl_type_test.cc @@ -66,8 +66,9 @@ TEST_F(MslGeneratorImplTest, EmitType_Array) { GeneratorImpl& gen = Build(); - ASSERT_TRUE(gen.EmitType(program->TypeOf(arr), "ary")) << gen.error(); - EXPECT_EQ(gen.result(), "bool ary[4]"); + std::stringstream out; + ASSERT_TRUE(gen.EmitType(out, program->TypeOf(arr), "ary")) << gen.error(); + EXPECT_EQ(out.str(), "bool ary[4]"); } TEST_F(MslGeneratorImplTest, EmitType_ArrayOfArray) { @@ -77,8 +78,9 @@ TEST_F(MslGeneratorImplTest, EmitType_ArrayOfArray) { GeneratorImpl& gen = Build(); - ASSERT_TRUE(gen.EmitType(program->TypeOf(b), "ary")) << gen.error(); - EXPECT_EQ(gen.result(), "bool ary[5][4]"); + std::stringstream out; + ASSERT_TRUE(gen.EmitType(out, program->TypeOf(b), "ary")) << gen.error(); + EXPECT_EQ(out.str(), "bool ary[5][4]"); } TEST_F(MslGeneratorImplTest, EmitType_ArrayOfArrayOfArray) { @@ -89,8 +91,9 @@ TEST_F(MslGeneratorImplTest, EmitType_ArrayOfArrayOfArray) { GeneratorImpl& gen = Build(); - ASSERT_TRUE(gen.EmitType(program->TypeOf(c), "ary")) << gen.error(); - EXPECT_EQ(gen.result(), "bool ary[6][5][4]"); + std::stringstream out; + ASSERT_TRUE(gen.EmitType(out, program->TypeOf(c), "ary")) << gen.error(); + EXPECT_EQ(out.str(), "bool ary[6][5][4]"); } TEST_F(MslGeneratorImplTest, EmitType_Array_WithoutName) { @@ -99,8 +102,9 @@ TEST_F(MslGeneratorImplTest, EmitType_Array_WithoutName) { GeneratorImpl& gen = Build(); - ASSERT_TRUE(gen.EmitType(program->TypeOf(arr), "")) << gen.error(); - EXPECT_EQ(gen.result(), "bool[4]"); + std::stringstream out; + ASSERT_TRUE(gen.EmitType(out, program->TypeOf(arr), "")) << gen.error(); + EXPECT_EQ(out.str(), "bool[4]"); } TEST_F(MslGeneratorImplTest, EmitType_RuntimeArray) { @@ -109,8 +113,9 @@ TEST_F(MslGeneratorImplTest, EmitType_RuntimeArray) { GeneratorImpl& gen = Build(); - ASSERT_TRUE(gen.EmitType(program->TypeOf(arr), "ary")) << gen.error(); - EXPECT_EQ(gen.result(), "bool ary[1]"); + std::stringstream out; + ASSERT_TRUE(gen.EmitType(out, program->TypeOf(arr), "ary")) << gen.error(); + EXPECT_EQ(out.str(), "bool ary[1]"); } TEST_F(MslGeneratorImplTest, EmitType_ArrayWithStride) { @@ -143,8 +148,9 @@ TEST_F(MslGeneratorImplTest, EmitType_Bool) { GeneratorImpl& gen = Build(); - ASSERT_TRUE(gen.EmitType(bool_, "")) << gen.error(); - EXPECT_EQ(gen.result(), "bool"); + std::stringstream out; + ASSERT_TRUE(gen.EmitType(out, bool_, "")) << gen.error(); + EXPECT_EQ(out.str(), "bool"); } TEST_F(MslGeneratorImplTest, EmitType_F32) { @@ -152,8 +158,9 @@ TEST_F(MslGeneratorImplTest, EmitType_F32) { GeneratorImpl& gen = Build(); - ASSERT_TRUE(gen.EmitType(f32, "")) << gen.error(); - EXPECT_EQ(gen.result(), "float"); + std::stringstream out; + ASSERT_TRUE(gen.EmitType(out, f32, "")) << gen.error(); + EXPECT_EQ(out.str(), "float"); } TEST_F(MslGeneratorImplTest, EmitType_I32) { @@ -161,8 +168,9 @@ TEST_F(MslGeneratorImplTest, EmitType_I32) { GeneratorImpl& gen = Build(); - ASSERT_TRUE(gen.EmitType(i32, "")) << gen.error(); - EXPECT_EQ(gen.result(), "int"); + std::stringstream out; + ASSERT_TRUE(gen.EmitType(out, i32, "")) << gen.error(); + EXPECT_EQ(out.str(), "int"); } TEST_F(MslGeneratorImplTest, EmitType_Matrix) { @@ -172,8 +180,9 @@ TEST_F(MslGeneratorImplTest, EmitType_Matrix) { GeneratorImpl& gen = Build(); - ASSERT_TRUE(gen.EmitType(mat2x3, "")) << gen.error(); - EXPECT_EQ(gen.result(), "float2x3"); + std::stringstream out; + ASSERT_TRUE(gen.EmitType(out, mat2x3, "")) << gen.error(); + EXPECT_EQ(out.str(), "float2x3"); } TEST_F(MslGeneratorImplTest, EmitType_Pointer) { @@ -183,8 +192,9 @@ TEST_F(MslGeneratorImplTest, EmitType_Pointer) { GeneratorImpl& gen = Build(); - ASSERT_TRUE(gen.EmitType(p, "")) << gen.error(); - EXPECT_EQ(gen.result(), "threadgroup float* "); + std::stringstream out; + ASSERT_TRUE(gen.EmitType(out, p, "")) << gen.error(); + EXPECT_EQ(out.str(), "threadgroup float* "); } TEST_F(MslGeneratorImplTest, EmitType_Struct) { @@ -195,8 +205,9 @@ TEST_F(MslGeneratorImplTest, EmitType_Struct) { GeneratorImpl& gen = Build(); - ASSERT_TRUE(gen.EmitType(program->TypeOf(s), "")) << gen.error(); - EXPECT_EQ(gen.result(), "S"); + std::stringstream out; + ASSERT_TRUE(gen.EmitType(out, program->TypeOf(s), "")) << gen.error(); + EXPECT_EQ(out.str(), "S"); } TEST_F(MslGeneratorImplTest, EmitType_StructDecl) { @@ -670,8 +681,9 @@ TEST_F(MslGeneratorImplTest, DISABLED_EmitType_Struct_WithDecoration) { GeneratorImpl& gen = Build(); - ASSERT_TRUE(gen.EmitType(program->TypeOf(s), "")) << gen.error(); - EXPECT_EQ(gen.result(), R"(struct { + std::stringstream out; + ASSERT_TRUE(gen.EmitType(out, program->TypeOf(s), "")) << gen.error(); + EXPECT_EQ(out.str(), R"(struct { /* 0x0000 */ int a; /* 0x0004 */ float b; })"); @@ -682,8 +694,9 @@ TEST_F(MslGeneratorImplTest, EmitType_U32) { GeneratorImpl& gen = Build(); - ASSERT_TRUE(gen.EmitType(u32, "")) << gen.error(); - EXPECT_EQ(gen.result(), "uint"); + std::stringstream out; + ASSERT_TRUE(gen.EmitType(out, u32, "")) << gen.error(); + EXPECT_EQ(out.str(), "uint"); } TEST_F(MslGeneratorImplTest, EmitType_Vector) { @@ -692,8 +705,9 @@ TEST_F(MslGeneratorImplTest, EmitType_Vector) { GeneratorImpl& gen = Build(); - ASSERT_TRUE(gen.EmitType(vec3, "")) << gen.error(); - EXPECT_EQ(gen.result(), "float3"); + std::stringstream out; + ASSERT_TRUE(gen.EmitType(out, vec3, "")) << gen.error(); + EXPECT_EQ(out.str(), "float3"); } TEST_F(MslGeneratorImplTest, EmitType_Void) { @@ -701,8 +715,9 @@ TEST_F(MslGeneratorImplTest, EmitType_Void) { GeneratorImpl& gen = Build(); - ASSERT_TRUE(gen.EmitType(void_, "")) << gen.error(); - EXPECT_EQ(gen.result(), "void"); + std::stringstream out; + ASSERT_TRUE(gen.EmitType(out, void_, "")) << gen.error(); + EXPECT_EQ(out.str(), "void"); } TEST_F(MslGeneratorImplTest, EmitType_Sampler) { @@ -710,8 +725,9 @@ TEST_F(MslGeneratorImplTest, EmitType_Sampler) { GeneratorImpl& gen = Build(); - ASSERT_TRUE(gen.EmitType(sampler, "")) << gen.error(); - EXPECT_EQ(gen.result(), "sampler"); + std::stringstream out; + ASSERT_TRUE(gen.EmitType(out, sampler, "")) << gen.error(); + EXPECT_EQ(out.str(), "sampler"); } TEST_F(MslGeneratorImplTest, EmitType_SamplerComparison) { @@ -719,8 +735,9 @@ TEST_F(MslGeneratorImplTest, EmitType_SamplerComparison) { GeneratorImpl& gen = Build(); - ASSERT_TRUE(gen.EmitType(sampler, "")) << gen.error(); - EXPECT_EQ(gen.result(), "sampler"); + std::stringstream out; + ASSERT_TRUE(gen.EmitType(out, sampler, "")) << gen.error(); + EXPECT_EQ(out.str(), "sampler"); } struct MslDepthTextureData { @@ -739,8 +756,9 @@ TEST_P(MslDepthTexturesTest, Emit) { GeneratorImpl& gen = Build(); - ASSERT_TRUE(gen.EmitType(&s, "")) << gen.error(); - EXPECT_EQ(gen.result(), params.result); + std::stringstream out; + ASSERT_TRUE(gen.EmitType(out, &s, "")) << gen.error(); + EXPECT_EQ(out.str(), params.result); } INSTANTIATE_TEST_SUITE_P( MslGeneratorImplTest, @@ -772,8 +790,9 @@ TEST_P(MslSampledtexturesTest, Emit) { GeneratorImpl& gen = Build(); - ASSERT_TRUE(gen.EmitType(s, "")) << gen.error(); - EXPECT_EQ(gen.result(), params.result); + std::stringstream out; + ASSERT_TRUE(gen.EmitType(out, s, "")) << gen.error(); + EXPECT_EQ(out.str(), params.result); } INSTANTIATE_TEST_SUITE_P( MslGeneratorImplTest, @@ -798,8 +817,9 @@ TEST_F(MslGeneratorImplTest, Emit_TypeMultisampledTexture) { GeneratorImpl& gen = Build(); - ASSERT_TRUE(gen.EmitType(ms, "")) << gen.error(); - EXPECT_EQ(gen.result(), "texture2d_ms"); + std::stringstream out; + ASSERT_TRUE(gen.EmitType(out, ms, "")) << gen.error(); + EXPECT_EQ(out.str(), "texture2d_ms"); } struct MslStorageTextureData { @@ -826,8 +846,9 @@ TEST_P(MslStorageTexturesTest, Emit) { GeneratorImpl& gen = Build(); - ASSERT_TRUE(gen.EmitType(program->TypeOf(s), "")) << gen.error(); - EXPECT_EQ(gen.result(), params.result); + std::stringstream out; + ASSERT_TRUE(gen.EmitType(out, program->TypeOf(s), "")) << gen.error(); + EXPECT_EQ(out.str(), params.result); } INSTANTIATE_TEST_SUITE_P( MslGeneratorImplTest, diff --git a/src/writer/msl/generator_impl_unary_op_test.cc b/src/writer/msl/generator_impl_unary_op_test.cc index 2dfe8a9d8e..9254494084 100644 --- a/src/writer/msl/generator_impl_unary_op_test.cc +++ b/src/writer/msl/generator_impl_unary_op_test.cc @@ -29,8 +29,9 @@ TEST_F(MslUnaryOpTest, AddressOf) { GeneratorImpl& gen = Build(); - ASSERT_TRUE(gen.EmitExpression(op)) << gen.error(); - EXPECT_EQ(gen.result(), "&(expr)"); + std::stringstream out; + ASSERT_TRUE(gen.EmitExpression(out, op)) << gen.error(); + EXPECT_EQ(out.str(), "&(expr)"); } TEST_F(MslUnaryOpTest, Complement) { @@ -41,8 +42,9 @@ TEST_F(MslUnaryOpTest, Complement) { GeneratorImpl& gen = Build(); - ASSERT_TRUE(gen.EmitExpression(op)) << gen.error(); - EXPECT_EQ(gen.result(), "~(expr)"); + std::stringstream out; + ASSERT_TRUE(gen.EmitExpression(out, op)) << gen.error(); + EXPECT_EQ(out.str(), "~(expr)"); } TEST_F(MslUnaryOpTest, Indirection) { @@ -56,8 +58,9 @@ TEST_F(MslUnaryOpTest, Indirection) { GeneratorImpl& gen = Build(); - ASSERT_TRUE(gen.EmitExpression(op)) << gen.error(); - EXPECT_EQ(gen.result(), "*(expr)"); + std::stringstream out; + ASSERT_TRUE(gen.EmitExpression(out, op)) << gen.error(); + EXPECT_EQ(out.str(), "*(expr)"); } TEST_F(MslUnaryOpTest, Not) { @@ -67,8 +70,9 @@ TEST_F(MslUnaryOpTest, Not) { GeneratorImpl& gen = Build(); - ASSERT_TRUE(gen.EmitExpression(op)) << gen.error(); - EXPECT_EQ(gen.result(), "!(expr)"); + std::stringstream out; + ASSERT_TRUE(gen.EmitExpression(out, op)) << gen.error(); + EXPECT_EQ(out.str(), "!(expr)"); } TEST_F(MslUnaryOpTest, Negation) { @@ -79,8 +83,9 @@ TEST_F(MslUnaryOpTest, Negation) { GeneratorImpl& gen = Build(); - ASSERT_TRUE(gen.EmitExpression(op)) << gen.error(); - EXPECT_EQ(gen.result(), "-(expr)"); + std::stringstream out; + ASSERT_TRUE(gen.EmitExpression(out, op)) << gen.error(); + EXPECT_EQ(out.str(), "-(expr)"); } } // namespace diff --git a/src/writer/text_generator.cc b/src/writer/text_generator.cc index 624d72cf13..a3ec05c5f6 100644 --- a/src/writer/text_generator.cc +++ b/src/writer/text_generator.cc @@ -44,8 +44,9 @@ TextGenerator::LineWriter::~LineWriter() { auto str = os.str(); if (!str.empty()) { gen->make_indent(); - gen->out_ << str << std::endl; + gen->out_ << str; } + gen->out_ << std::endl; } } diff --git a/test/bug/dawn/947.wgsl.expected.msl b/test/bug/dawn/947.wgsl.expected.msl index b33557aba7..2ad00ea14f 100644 --- a/test/bug/dawn/947.wgsl.expected.msl +++ b/test/bug/dawn/947.wgsl.expected.msl @@ -39,8 +39,8 @@ vertex tint_symbol_1 vs_main(uint VertexIndex [[vertex_id]], constant Uniforms& fragment tint_symbol_4 fs_main(texture2d tint_symbol_7 [[texture(2)]], sampler tint_symbol_8 [[sampler(1)]], tint_symbol_3 tint_symbol_2 [[stage_in]]) { float2 const texcoord = tint_symbol_2.texcoord; - float2 clampedTexcoord = clamp(texcoord, float2(0.0f, 0.0f), float2(1.0f, 1.0f)); - if (!( all((clampedTexcoord == texcoord)))) { + float2 clampedTexcoord = clamp(texcoord, float2(0.0f, 0.0f), float2(1.0f, 1.0f)); + if (!(all((clampedTexcoord == texcoord)))) { discard_fragment(); } float4 srcColor = tint_symbol_7.sample(tint_symbol_8, texcoord); diff --git a/test/bug/tint/749.spvasm.expected.msl b/test/bug/tint/749.spvasm.expected.msl index 1e5e8500d6..9e417f047b 100644 --- a/test/bug/tint/749.spvasm.expected.msl +++ b/test/bug/tint/749.spvasm.expected.msl @@ -1451,7 +1451,7 @@ void main_1(constant buf0& x_188, thread QuicksortObject* const tint_symbol_86, int const x_909 = (*(tint_symbol_86)).numbers.arr[4]; (*(tint_symbol_86)).numbers.arr[4] = 0; (*(tint_symbol_86)).numbers.arr[4] = x_909; - if (( fabs((x_308 - x_310)) < 0.25f)) { + if ((fabs((x_308 - x_310)) < 0.25f)) { float const x_910 = uv.x; uv.x = 0.0f; uv.x = x_910; @@ -1505,7 +1505,7 @@ void main_1(constant buf0& x_188, thread QuicksortObject* const tint_symbol_86, uv[0] = 0.0f; uv[0] = x_922; float3 const x_519 = float3(x_447.x, x_446.x, x_446.y); - float3 const x_326 = normalize(x_325); + float3 const x_326 = normalize(x_325); float const x_923 = uv.x; uv.x = 0.0f; uv.x = x_923; diff --git a/test/bug/tint/913.wgsl.expected.msl b/test/bug/tint/913.wgsl.expected.msl index e30f694978..87536c30f7 100644 --- a/test/bug/tint/913.wgsl.expected.msl +++ b/test/bug/tint/913.wgsl.expected.msl @@ -13,7 +13,7 @@ struct OutputBuf { }; bool aboutEqual(float value, float expect) { - return ( fabs((value - expect)) < 0.001f); + return (fabs((value - expect)) < 0.001f); } kernel void tint_symbol(texture2d tint_symbol_2 [[texture(0)]], texture2d tint_symbol_3 [[texture(1)]], uint3 GlobalInvocationID [[thread_position_in_grid]], constant Uniforms& uniforms [[buffer(3)]], device OutputBuf& output [[buffer(2)]]) { @@ -23,7 +23,7 @@ kernel void tint_symbol(texture2d tint_symbol_2 [[texture float4 const nonCoveredColor = float4(0.0f, 1.0f, 0.0f, 1.0f); bool success = true; if (((((dstTexCoord.x < uniforms.dstCopyOrigin.x) || (dstTexCoord.y < uniforms.dstCopyOrigin.y)) || (dstTexCoord.x >= (uniforms.dstCopyOrigin.x + uniforms.copySize.x))) || (dstTexCoord.y >= (uniforms.dstCopyOrigin.y + uniforms.copySize.y)))) { - success = (success && all((tint_symbol_3.read(uint2(int2(dstTexCoord)), 0) == nonCoveredColor))); + success = (success && all((tint_symbol_3.read(uint2(int2(dstTexCoord)), 0) == nonCoveredColor))); } else { uint2 srcTexCoord = ((dstTexCoord - uniforms.dstCopyOrigin) + uniforms.srcCopyOrigin); if ((uniforms.dstTextureFlipY == 1u)) { diff --git a/test/bug/tint/914.wgsl.expected.msl b/test/bug/tint/914.wgsl.expected.msl index bdb650c53d..d9a4b829bc 100644 --- a/test/bug/tint/914.wgsl.expected.msl +++ b/test/bug/tint/914.wgsl.expected.msl @@ -59,7 +59,7 @@ kernel void tint_symbol(uint3 local_id [[thread_position_in_threadgroup]], uint3 tint_array_wrapper const tint_symbol_3 = {.arr={}}; tint_symbol_5 = tint_symbol_3; } - threadgroup_barrier(mem_flags::mem_threadgroup); + threadgroup_barrier(mem_flags::mem_threadgroup); uint const tileRow = (local_id.y * RowPerThread); uint const tileCol = (local_id.x * ColPerThread); uint const globalRow = (global_id.y * RowPerThread); @@ -140,7 +140,7 @@ kernel void tint_symbol(uint3 local_id [[thread_position_in_threadgroup]], uint3 } } } - threadgroup_barrier(mem_flags::mem_threadgroup); + threadgroup_barrier(mem_flags::mem_threadgroup); { uint k = 0u; while (true) { @@ -189,7 +189,7 @@ kernel void tint_symbol(uint3 local_id [[thread_position_in_threadgroup]], uint3 } } } - threadgroup_barrier(mem_flags::mem_threadgroup); + threadgroup_barrier(mem_flags::mem_threadgroup); { t = (t + 1u); } diff --git a/test/intrinsics/gen/abs/002533.wgsl.expected.msl b/test/intrinsics/gen/abs/002533.wgsl.expected.msl index 1258a267d9..84bfd68ba1 100644 --- a/test/intrinsics/gen/abs/002533.wgsl.expected.msl +++ b/test/intrinsics/gen/abs/002533.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void abs_002533() { - float4 res = fabs(float4()); + float4 res = fabs(float4()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/abs/005174.wgsl.expected.msl b/test/intrinsics/gen/abs/005174.wgsl.expected.msl index 3babfb79ba..05c04900f5 100644 --- a/test/intrinsics/gen/abs/005174.wgsl.expected.msl +++ b/test/intrinsics/gen/abs/005174.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void abs_005174() { - float3 res = fabs(float3()); + float3 res = fabs(float3()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/abs/1ce782.wgsl.expected.msl b/test/intrinsics/gen/abs/1ce782.wgsl.expected.msl index 987b8fb8f1..0efe44222d 100644 --- a/test/intrinsics/gen/abs/1ce782.wgsl.expected.msl +++ b/test/intrinsics/gen/abs/1ce782.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void abs_1ce782() { - uint4 res = abs(uint4()); + uint4 res = abs(uint4()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/abs/1e9d53.wgsl.expected.msl b/test/intrinsics/gen/abs/1e9d53.wgsl.expected.msl index 944edf8b6e..82d59b8303 100644 --- a/test/intrinsics/gen/abs/1e9d53.wgsl.expected.msl +++ b/test/intrinsics/gen/abs/1e9d53.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void abs_1e9d53() { - float2 res = fabs(float2()); + float2 res = fabs(float2()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/abs/467cd1.wgsl.expected.msl b/test/intrinsics/gen/abs/467cd1.wgsl.expected.msl index 76477c2074..3764d7fa76 100644 --- a/test/intrinsics/gen/abs/467cd1.wgsl.expected.msl +++ b/test/intrinsics/gen/abs/467cd1.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void abs_467cd1() { - uint res = abs(1u); + uint res = abs(1u); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/abs/4ad288.wgsl.expected.msl b/test/intrinsics/gen/abs/4ad288.wgsl.expected.msl index 081a99450d..e9edc03acd 100644 --- a/test/intrinsics/gen/abs/4ad288.wgsl.expected.msl +++ b/test/intrinsics/gen/abs/4ad288.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void abs_4ad288() { - int res = abs(1); + int res = abs(1); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/abs/5ad50a.wgsl.expected.msl b/test/intrinsics/gen/abs/5ad50a.wgsl.expected.msl index bcc027bc62..dd6bdd7282 100644 --- a/test/intrinsics/gen/abs/5ad50a.wgsl.expected.msl +++ b/test/intrinsics/gen/abs/5ad50a.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void abs_5ad50a() { - int3 res = abs(int3()); + int3 res = abs(int3()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/abs/7326de.wgsl.expected.msl b/test/intrinsics/gen/abs/7326de.wgsl.expected.msl index 3de8a49b67..e17b21e931 100644 --- a/test/intrinsics/gen/abs/7326de.wgsl.expected.msl +++ b/test/intrinsics/gen/abs/7326de.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void abs_7326de() { - uint3 res = abs(uint3()); + uint3 res = abs(uint3()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/abs/7f28e6.wgsl.expected.msl b/test/intrinsics/gen/abs/7f28e6.wgsl.expected.msl index 9c154aa4ad..471ff1525f 100644 --- a/test/intrinsics/gen/abs/7f28e6.wgsl.expected.msl +++ b/test/intrinsics/gen/abs/7f28e6.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void abs_7f28e6() { - uint2 res = abs(uint2()); + uint2 res = abs(uint2()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/abs/7faa9e.wgsl.expected.msl b/test/intrinsics/gen/abs/7faa9e.wgsl.expected.msl index d4e466898c..1738b04870 100644 --- a/test/intrinsics/gen/abs/7faa9e.wgsl.expected.msl +++ b/test/intrinsics/gen/abs/7faa9e.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void abs_7faa9e() { - int2 res = abs(int2()); + int2 res = abs(int2()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/abs/9c80a6.wgsl.expected.msl b/test/intrinsics/gen/abs/9c80a6.wgsl.expected.msl index 09179b9031..87ef75d202 100644 --- a/test/intrinsics/gen/abs/9c80a6.wgsl.expected.msl +++ b/test/intrinsics/gen/abs/9c80a6.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void abs_9c80a6() { - int4 res = abs(int4()); + int4 res = abs(int4()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/abs/b96037.wgsl.expected.msl b/test/intrinsics/gen/abs/b96037.wgsl.expected.msl index 86cbf29612..a8928f17b2 100644 --- a/test/intrinsics/gen/abs/b96037.wgsl.expected.msl +++ b/test/intrinsics/gen/abs/b96037.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void abs_b96037() { - float res = fabs(1.0f); + float res = fabs(1.0f); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/acos/489247.wgsl.expected.msl b/test/intrinsics/gen/acos/489247.wgsl.expected.msl index 8a12c8abee..f0b164fa72 100644 --- a/test/intrinsics/gen/acos/489247.wgsl.expected.msl +++ b/test/intrinsics/gen/acos/489247.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void acos_489247() { - float res = acos(1.0f); + float res = acos(1.0f); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/acos/8e2acf.wgsl.expected.msl b/test/intrinsics/gen/acos/8e2acf.wgsl.expected.msl index fe56d67e19..99d4c08928 100644 --- a/test/intrinsics/gen/acos/8e2acf.wgsl.expected.msl +++ b/test/intrinsics/gen/acos/8e2acf.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void acos_8e2acf() { - float4 res = acos(float4()); + float4 res = acos(float4()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/acos/a610c4.wgsl.expected.msl b/test/intrinsics/gen/acos/a610c4.wgsl.expected.msl index aaf328f029..e1d07a9c14 100644 --- a/test/intrinsics/gen/acos/a610c4.wgsl.expected.msl +++ b/test/intrinsics/gen/acos/a610c4.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void acos_a610c4() { - float3 res = acos(float3()); + float3 res = acos(float3()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/acos/dfc915.wgsl.expected.msl b/test/intrinsics/gen/acos/dfc915.wgsl.expected.msl index 9257d33cb2..48e93aaec3 100644 --- a/test/intrinsics/gen/acos/dfc915.wgsl.expected.msl +++ b/test/intrinsics/gen/acos/dfc915.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void acos_dfc915() { - float2 res = acos(float2()); + float2 res = acos(float2()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/all/986c7b.wgsl.expected.msl b/test/intrinsics/gen/all/986c7b.wgsl.expected.msl index 022b58ec1a..032da5325a 100644 --- a/test/intrinsics/gen/all/986c7b.wgsl.expected.msl +++ b/test/intrinsics/gen/all/986c7b.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void all_986c7b() { - bool res = all(bool4()); + bool res = all(bool4()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/all/bd2dba.wgsl.expected.msl b/test/intrinsics/gen/all/bd2dba.wgsl.expected.msl index 9ad60e35d7..6c7a2fb4f1 100644 --- a/test/intrinsics/gen/all/bd2dba.wgsl.expected.msl +++ b/test/intrinsics/gen/all/bd2dba.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void all_bd2dba() { - bool res = all(bool3()); + bool res = all(bool3()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/all/f46790.wgsl.expected.msl b/test/intrinsics/gen/all/f46790.wgsl.expected.msl index f2813f5ce4..9b337fb74d 100644 --- a/test/intrinsics/gen/all/f46790.wgsl.expected.msl +++ b/test/intrinsics/gen/all/f46790.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void all_f46790() { - bool res = all(bool2()); + bool res = all(bool2()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/any/083428.wgsl.expected.msl b/test/intrinsics/gen/any/083428.wgsl.expected.msl index 3b69c0a901..e76e344bf7 100644 --- a/test/intrinsics/gen/any/083428.wgsl.expected.msl +++ b/test/intrinsics/gen/any/083428.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void any_083428() { - bool res = any(bool4()); + bool res = any(bool4()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/any/0e3e58.wgsl.expected.msl b/test/intrinsics/gen/any/0e3e58.wgsl.expected.msl index 8efaca17de..9933be14c5 100644 --- a/test/intrinsics/gen/any/0e3e58.wgsl.expected.msl +++ b/test/intrinsics/gen/any/0e3e58.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void any_0e3e58() { - bool res = any(bool2()); + bool res = any(bool2()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/any/e755c1.wgsl.expected.msl b/test/intrinsics/gen/any/e755c1.wgsl.expected.msl index 0814a030b4..a789697749 100644 --- a/test/intrinsics/gen/any/e755c1.wgsl.expected.msl +++ b/test/intrinsics/gen/any/e755c1.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void any_e755c1() { - bool res = any(bool3()); + bool res = any(bool3()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/asin/064953.wgsl.expected.msl b/test/intrinsics/gen/asin/064953.wgsl.expected.msl index 3a5bbebedb..e5ae5349de 100644 --- a/test/intrinsics/gen/asin/064953.wgsl.expected.msl +++ b/test/intrinsics/gen/asin/064953.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void asin_064953() { - float4 res = asin(float4()); + float4 res = asin(float4()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/asin/7b6a44.wgsl.expected.msl b/test/intrinsics/gen/asin/7b6a44.wgsl.expected.msl index ae9dd4839c..bccf8b968b 100644 --- a/test/intrinsics/gen/asin/7b6a44.wgsl.expected.msl +++ b/test/intrinsics/gen/asin/7b6a44.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void asin_7b6a44() { - float2 res = asin(float2()); + float2 res = asin(float2()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/asin/8cd9c9.wgsl.expected.msl b/test/intrinsics/gen/asin/8cd9c9.wgsl.expected.msl index e246b62035..9fdb5c6927 100644 --- a/test/intrinsics/gen/asin/8cd9c9.wgsl.expected.msl +++ b/test/intrinsics/gen/asin/8cd9c9.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void asin_8cd9c9() { - float3 res = asin(float3()); + float3 res = asin(float3()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/asin/c0c272.wgsl.expected.msl b/test/intrinsics/gen/asin/c0c272.wgsl.expected.msl index 8a7e083a2a..9467bedca7 100644 --- a/test/intrinsics/gen/asin/c0c272.wgsl.expected.msl +++ b/test/intrinsics/gen/asin/c0c272.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void asin_c0c272() { - float res = asin(1.0f); + float res = asin(1.0f); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/atan/02979a.wgsl.expected.msl b/test/intrinsics/gen/atan/02979a.wgsl.expected.msl index 411c3bd718..d7f68f1f50 100644 --- a/test/intrinsics/gen/atan/02979a.wgsl.expected.msl +++ b/test/intrinsics/gen/atan/02979a.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void atan_02979a() { - float res = atan(1.0f); + float res = atan(1.0f); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/atan/331e6d.wgsl.expected.msl b/test/intrinsics/gen/atan/331e6d.wgsl.expected.msl index 0978363178..2474bece5d 100644 --- a/test/intrinsics/gen/atan/331e6d.wgsl.expected.msl +++ b/test/intrinsics/gen/atan/331e6d.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void atan_331e6d() { - float3 res = atan(float3()); + float3 res = atan(float3()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/atan/a8b696.wgsl.expected.msl b/test/intrinsics/gen/atan/a8b696.wgsl.expected.msl index 16ab64acdd..a985ca9815 100644 --- a/test/intrinsics/gen/atan/a8b696.wgsl.expected.msl +++ b/test/intrinsics/gen/atan/a8b696.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void atan_a8b696() { - float4 res = atan(float4()); + float4 res = atan(float4()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/atan/ad96e4.wgsl.expected.msl b/test/intrinsics/gen/atan/ad96e4.wgsl.expected.msl index 080c24a78d..3301ece9cb 100644 --- a/test/intrinsics/gen/atan/ad96e4.wgsl.expected.msl +++ b/test/intrinsics/gen/atan/ad96e4.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void atan_ad96e4() { - float2 res = atan(float2()); + float2 res = atan(float2()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/atan2/57fb13.wgsl.expected.msl b/test/intrinsics/gen/atan2/57fb13.wgsl.expected.msl index f647ab6511..75f47599f5 100644 --- a/test/intrinsics/gen/atan2/57fb13.wgsl.expected.msl +++ b/test/intrinsics/gen/atan2/57fb13.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void atan2_57fb13() { - float2 res = atan2(float2(), float2()); + float2 res = atan2(float2(), float2()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/atan2/96057c.wgsl.expected.msl b/test/intrinsics/gen/atan2/96057c.wgsl.expected.msl index eda44b5e1b..ca9d89e31d 100644 --- a/test/intrinsics/gen/atan2/96057c.wgsl.expected.msl +++ b/test/intrinsics/gen/atan2/96057c.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void atan2_96057c() { - float res = atan2(1.0f, 1.0f); + float res = atan2(1.0f, 1.0f); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/atan2/a70d0d.wgsl.expected.msl b/test/intrinsics/gen/atan2/a70d0d.wgsl.expected.msl index 6a52430850..041777f7fc 100644 --- a/test/intrinsics/gen/atan2/a70d0d.wgsl.expected.msl +++ b/test/intrinsics/gen/atan2/a70d0d.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void atan2_a70d0d() { - float3 res = atan2(float3(), float3()); + float3 res = atan2(float3(), float3()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/atan2/ae713e.wgsl.expected.msl b/test/intrinsics/gen/atan2/ae713e.wgsl.expected.msl index 9aa0aa7869..5823a5321f 100644 --- a/test/intrinsics/gen/atan2/ae713e.wgsl.expected.msl +++ b/test/intrinsics/gen/atan2/ae713e.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void atan2_ae713e() { - float4 res = atan2(float4(), float4()); + float4 res = atan2(float4(), float4()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/ceil/34064b.wgsl.expected.msl b/test/intrinsics/gen/ceil/34064b.wgsl.expected.msl index 6a9eba075a..5593646cbf 100644 --- a/test/intrinsics/gen/ceil/34064b.wgsl.expected.msl +++ b/test/intrinsics/gen/ceil/34064b.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void ceil_34064b() { - float3 res = ceil(float3()); + float3 res = ceil(float3()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/ceil/678655.wgsl.expected.msl b/test/intrinsics/gen/ceil/678655.wgsl.expected.msl index 1dc8a90376..fdc9079935 100644 --- a/test/intrinsics/gen/ceil/678655.wgsl.expected.msl +++ b/test/intrinsics/gen/ceil/678655.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void ceil_678655() { - float res = ceil(1.0f); + float res = ceil(1.0f); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/ceil/96f597.wgsl.expected.msl b/test/intrinsics/gen/ceil/96f597.wgsl.expected.msl index 355e7c3d9c..0e7d8d7795 100644 --- a/test/intrinsics/gen/ceil/96f597.wgsl.expected.msl +++ b/test/intrinsics/gen/ceil/96f597.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void ceil_96f597() { - float2 res = ceil(float2()); + float2 res = ceil(float2()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/ceil/b74c16.wgsl.expected.msl b/test/intrinsics/gen/ceil/b74c16.wgsl.expected.msl index 982d1d0f31..baef3dfe57 100644 --- a/test/intrinsics/gen/ceil/b74c16.wgsl.expected.msl +++ b/test/intrinsics/gen/ceil/b74c16.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void ceil_b74c16() { - float4 res = ceil(float4()); + float4 res = ceil(float4()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/clamp/0acf8f.wgsl.expected.msl b/test/intrinsics/gen/clamp/0acf8f.wgsl.expected.msl index dce861e9fc..601db260b9 100644 --- a/test/intrinsics/gen/clamp/0acf8f.wgsl.expected.msl +++ b/test/intrinsics/gen/clamp/0acf8f.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void clamp_0acf8f() { - float2 res = clamp(float2(), float2(), float2()); + float2 res = clamp(float2(), float2(), float2()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/clamp/1a32e3.wgsl.expected.msl b/test/intrinsics/gen/clamp/1a32e3.wgsl.expected.msl index 062a582920..faac6ae53f 100644 --- a/test/intrinsics/gen/clamp/1a32e3.wgsl.expected.msl +++ b/test/intrinsics/gen/clamp/1a32e3.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void clamp_1a32e3() { - int4 res = clamp(int4(), int4(), int4()); + int4 res = clamp(int4(), int4(), int4()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/clamp/2bd567.wgsl.expected.msl b/test/intrinsics/gen/clamp/2bd567.wgsl.expected.msl index 533e9e400d..676b575173 100644 --- a/test/intrinsics/gen/clamp/2bd567.wgsl.expected.msl +++ b/test/intrinsics/gen/clamp/2bd567.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void clamp_2bd567() { - float res = clamp(1.0f, 1.0f, 1.0f); + float res = clamp(1.0f, 1.0f, 1.0f); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/clamp/2bde41.wgsl.expected.msl b/test/intrinsics/gen/clamp/2bde41.wgsl.expected.msl index aa99935b57..1db29d64a9 100644 --- a/test/intrinsics/gen/clamp/2bde41.wgsl.expected.msl +++ b/test/intrinsics/gen/clamp/2bde41.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void clamp_2bde41() { - float4 res = clamp(float4(), float4(), float4()); + float4 res = clamp(float4(), float4(), float4()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/clamp/548fc7.wgsl.expected.msl b/test/intrinsics/gen/clamp/548fc7.wgsl.expected.msl index ecfc1ad54a..633a63a28f 100644 --- a/test/intrinsics/gen/clamp/548fc7.wgsl.expected.msl +++ b/test/intrinsics/gen/clamp/548fc7.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void clamp_548fc7() { - uint3 res = clamp(uint3(), uint3(), uint3()); + uint3 res = clamp(uint3(), uint3(), uint3()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/clamp/5f0819.wgsl.expected.msl b/test/intrinsics/gen/clamp/5f0819.wgsl.expected.msl index 5a6317d5d7..22d535b28d 100644 --- a/test/intrinsics/gen/clamp/5f0819.wgsl.expected.msl +++ b/test/intrinsics/gen/clamp/5f0819.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void clamp_5f0819() { - int3 res = clamp(int3(), int3(), int3()); + int3 res = clamp(int3(), int3(), int3()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/clamp/6c1749.wgsl.expected.msl b/test/intrinsics/gen/clamp/6c1749.wgsl.expected.msl index 654a545a37..87c439cd49 100644 --- a/test/intrinsics/gen/clamp/6c1749.wgsl.expected.msl +++ b/test/intrinsics/gen/clamp/6c1749.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void clamp_6c1749() { - int2 res = clamp(int2(), int2(), int2()); + int2 res = clamp(int2(), int2(), int2()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/clamp/7706d7.wgsl.expected.msl b/test/intrinsics/gen/clamp/7706d7.wgsl.expected.msl index 634bdf5bd5..f2bf5f6019 100644 --- a/test/intrinsics/gen/clamp/7706d7.wgsl.expected.msl +++ b/test/intrinsics/gen/clamp/7706d7.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void clamp_7706d7() { - uint2 res = clamp(uint2(), uint2(), uint2()); + uint2 res = clamp(uint2(), uint2(), uint2()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/clamp/867397.wgsl.expected.msl b/test/intrinsics/gen/clamp/867397.wgsl.expected.msl index 6c8eeef453..a020584125 100644 --- a/test/intrinsics/gen/clamp/867397.wgsl.expected.msl +++ b/test/intrinsics/gen/clamp/867397.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void clamp_867397() { - float3 res = clamp(float3(), float3(), float3()); + float3 res = clamp(float3(), float3(), float3()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/clamp/a2de25.wgsl.expected.msl b/test/intrinsics/gen/clamp/a2de25.wgsl.expected.msl index 00bbc2ac35..1e92fe76ac 100644 --- a/test/intrinsics/gen/clamp/a2de25.wgsl.expected.msl +++ b/test/intrinsics/gen/clamp/a2de25.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void clamp_a2de25() { - uint res = clamp(1u, 1u, 1u); + uint res = clamp(1u, 1u, 1u); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/clamp/b07c65.wgsl.expected.msl b/test/intrinsics/gen/clamp/b07c65.wgsl.expected.msl index 15d67e6f22..f702d9f55e 100644 --- a/test/intrinsics/gen/clamp/b07c65.wgsl.expected.msl +++ b/test/intrinsics/gen/clamp/b07c65.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void clamp_b07c65() { - int res = clamp(1, 1, 1); + int res = clamp(1, 1, 1); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/clamp/bd43ce.wgsl.expected.msl b/test/intrinsics/gen/clamp/bd43ce.wgsl.expected.msl index 7e2562c01c..e77477084c 100644 --- a/test/intrinsics/gen/clamp/bd43ce.wgsl.expected.msl +++ b/test/intrinsics/gen/clamp/bd43ce.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void clamp_bd43ce() { - uint4 res = clamp(uint4(), uint4(), uint4()); + uint4 res = clamp(uint4(), uint4(), uint4()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/cos/16dc15.wgsl.expected.msl b/test/intrinsics/gen/cos/16dc15.wgsl.expected.msl index 4aeac90625..083cc8e010 100644 --- a/test/intrinsics/gen/cos/16dc15.wgsl.expected.msl +++ b/test/intrinsics/gen/cos/16dc15.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void cos_16dc15() { - float3 res = cos(float3()); + float3 res = cos(float3()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/cos/29d66d.wgsl.expected.msl b/test/intrinsics/gen/cos/29d66d.wgsl.expected.msl index 9c74fa231c..432218b217 100644 --- a/test/intrinsics/gen/cos/29d66d.wgsl.expected.msl +++ b/test/intrinsics/gen/cos/29d66d.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void cos_29d66d() { - float4 res = cos(float4()); + float4 res = cos(float4()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/cos/c3b486.wgsl.expected.msl b/test/intrinsics/gen/cos/c3b486.wgsl.expected.msl index fa7aafc8ec..c09cc0281e 100644 --- a/test/intrinsics/gen/cos/c3b486.wgsl.expected.msl +++ b/test/intrinsics/gen/cos/c3b486.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void cos_c3b486() { - float2 res = cos(float2()); + float2 res = cos(float2()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/cos/c5c28e.wgsl.expected.msl b/test/intrinsics/gen/cos/c5c28e.wgsl.expected.msl index 1650815c02..547bb12240 100644 --- a/test/intrinsics/gen/cos/c5c28e.wgsl.expected.msl +++ b/test/intrinsics/gen/cos/c5c28e.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void cos_c5c28e() { - float res = cos(1.0f); + float res = cos(1.0f); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/cosh/377652.wgsl.expected.msl b/test/intrinsics/gen/cosh/377652.wgsl.expected.msl index f52361fa32..b9dd371ae1 100644 --- a/test/intrinsics/gen/cosh/377652.wgsl.expected.msl +++ b/test/intrinsics/gen/cosh/377652.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void cosh_377652() { - float3 res = cosh(float3()); + float3 res = cosh(float3()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/cosh/c13756.wgsl.expected.msl b/test/intrinsics/gen/cosh/c13756.wgsl.expected.msl index 7cf7bca17c..1cb1cc9d36 100644 --- a/test/intrinsics/gen/cosh/c13756.wgsl.expected.msl +++ b/test/intrinsics/gen/cosh/c13756.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void cosh_c13756() { - float2 res = cosh(float2()); + float2 res = cosh(float2()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/cosh/da92dd.wgsl.expected.msl b/test/intrinsics/gen/cosh/da92dd.wgsl.expected.msl index 88231f23ac..9a53964819 100644 --- a/test/intrinsics/gen/cosh/da92dd.wgsl.expected.msl +++ b/test/intrinsics/gen/cosh/da92dd.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void cosh_da92dd() { - float res = cosh(1.0f); + float res = cosh(1.0f); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/cosh/e0c1de.wgsl.expected.msl b/test/intrinsics/gen/cosh/e0c1de.wgsl.expected.msl index 9bc5d43d4a..30c334b185 100644 --- a/test/intrinsics/gen/cosh/e0c1de.wgsl.expected.msl +++ b/test/intrinsics/gen/cosh/e0c1de.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void cosh_e0c1de() { - float4 res = cosh(float4()); + float4 res = cosh(float4()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/countOneBits/0d0e46.wgsl.expected.msl b/test/intrinsics/gen/countOneBits/0d0e46.wgsl.expected.msl index c08490e8f4..010ad8217f 100644 --- a/test/intrinsics/gen/countOneBits/0d0e46.wgsl.expected.msl +++ b/test/intrinsics/gen/countOneBits/0d0e46.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void countOneBits_0d0e46() { - uint4 res = popcount(uint4()); + uint4 res = popcount(uint4()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/countOneBits/0f7980.wgsl.expected.msl b/test/intrinsics/gen/countOneBits/0f7980.wgsl.expected.msl index 25b509df6b..78a9670f26 100644 --- a/test/intrinsics/gen/countOneBits/0f7980.wgsl.expected.msl +++ b/test/intrinsics/gen/countOneBits/0f7980.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void countOneBits_0f7980() { - int4 res = popcount(int4()); + int4 res = popcount(int4()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/countOneBits/65d2ae.wgsl.expected.msl b/test/intrinsics/gen/countOneBits/65d2ae.wgsl.expected.msl index aad3dd4d0d..7bb8d1fafb 100644 --- a/test/intrinsics/gen/countOneBits/65d2ae.wgsl.expected.msl +++ b/test/intrinsics/gen/countOneBits/65d2ae.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void countOneBits_65d2ae() { - int3 res = popcount(int3()); + int3 res = popcount(int3()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/countOneBits/690cfc.wgsl.expected.msl b/test/intrinsics/gen/countOneBits/690cfc.wgsl.expected.msl index 1ead1f95d7..3790052c5e 100644 --- a/test/intrinsics/gen/countOneBits/690cfc.wgsl.expected.msl +++ b/test/intrinsics/gen/countOneBits/690cfc.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void countOneBits_690cfc() { - uint3 res = popcount(uint3()); + uint3 res = popcount(uint3()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/countOneBits/94fd81.wgsl.expected.msl b/test/intrinsics/gen/countOneBits/94fd81.wgsl.expected.msl index 57d94f3f33..6648c06925 100644 --- a/test/intrinsics/gen/countOneBits/94fd81.wgsl.expected.msl +++ b/test/intrinsics/gen/countOneBits/94fd81.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void countOneBits_94fd81() { - uint2 res = popcount(uint2()); + uint2 res = popcount(uint2()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/countOneBits/ae44f9.wgsl.expected.msl b/test/intrinsics/gen/countOneBits/ae44f9.wgsl.expected.msl index 8626141ac4..94e43c8fa7 100644 --- a/test/intrinsics/gen/countOneBits/ae44f9.wgsl.expected.msl +++ b/test/intrinsics/gen/countOneBits/ae44f9.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void countOneBits_ae44f9() { - uint res = popcount(1u); + uint res = popcount(1u); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/countOneBits/af90e2.wgsl.expected.msl b/test/intrinsics/gen/countOneBits/af90e2.wgsl.expected.msl index 3aeaa26856..5b4944e452 100644 --- a/test/intrinsics/gen/countOneBits/af90e2.wgsl.expected.msl +++ b/test/intrinsics/gen/countOneBits/af90e2.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void countOneBits_af90e2() { - int2 res = popcount(int2()); + int2 res = popcount(int2()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/countOneBits/fd88b2.wgsl.expected.msl b/test/intrinsics/gen/countOneBits/fd88b2.wgsl.expected.msl index 7002fce368..74a06216e8 100644 --- a/test/intrinsics/gen/countOneBits/fd88b2.wgsl.expected.msl +++ b/test/intrinsics/gen/countOneBits/fd88b2.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void countOneBits_fd88b2() { - int res = popcount(1); + int res = popcount(1); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/cross/041cb0.wgsl.expected.msl b/test/intrinsics/gen/cross/041cb0.wgsl.expected.msl index a70d5f1578..0b0432b5e8 100644 --- a/test/intrinsics/gen/cross/041cb0.wgsl.expected.msl +++ b/test/intrinsics/gen/cross/041cb0.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void cross_041cb0() { - float3 res = cross(float3(), float3()); + float3 res = cross(float3(), float3()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/determinant/2b62ba.wgsl.expected.msl b/test/intrinsics/gen/determinant/2b62ba.wgsl.expected.msl index d3fd820b1a..aa4fabf128 100644 --- a/test/intrinsics/gen/determinant/2b62ba.wgsl.expected.msl +++ b/test/intrinsics/gen/determinant/2b62ba.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void determinant_2b62ba() { - float res = determinant(float3x3()); + float res = determinant(float3x3()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/determinant/a0a87c.wgsl.expected.msl b/test/intrinsics/gen/determinant/a0a87c.wgsl.expected.msl index c53e2bd017..188a9d3775 100644 --- a/test/intrinsics/gen/determinant/a0a87c.wgsl.expected.msl +++ b/test/intrinsics/gen/determinant/a0a87c.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void determinant_a0a87c() { - float res = determinant(float4x4()); + float res = determinant(float4x4()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/determinant/e19305.wgsl.expected.msl b/test/intrinsics/gen/determinant/e19305.wgsl.expected.msl index 025f8713f5..c902c3841b 100644 --- a/test/intrinsics/gen/determinant/e19305.wgsl.expected.msl +++ b/test/intrinsics/gen/determinant/e19305.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void determinant_e19305() { - float res = determinant(float2x2()); + float res = determinant(float2x2()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/distance/0657d4.wgsl.expected.msl b/test/intrinsics/gen/distance/0657d4.wgsl.expected.msl index a1f835fdb0..3c80f040a4 100644 --- a/test/intrinsics/gen/distance/0657d4.wgsl.expected.msl +++ b/test/intrinsics/gen/distance/0657d4.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void distance_0657d4() { - float res = distance(float3(), float3()); + float res = distance(float3(), float3()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/distance/9646ea.wgsl.expected.msl b/test/intrinsics/gen/distance/9646ea.wgsl.expected.msl index 6b6b77e70e..b9690c3b42 100644 --- a/test/intrinsics/gen/distance/9646ea.wgsl.expected.msl +++ b/test/intrinsics/gen/distance/9646ea.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void distance_9646ea() { - float res = distance(float4(), float4()); + float res = distance(float4(), float4()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/distance/aa4055.wgsl.expected.msl b/test/intrinsics/gen/distance/aa4055.wgsl.expected.msl index bf66f8e384..ae20aaa1f3 100644 --- a/test/intrinsics/gen/distance/aa4055.wgsl.expected.msl +++ b/test/intrinsics/gen/distance/aa4055.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void distance_aa4055() { - float res = distance(float2(), float2()); + float res = distance(float2(), float2()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/dot/0c577b.wgsl.expected.msl b/test/intrinsics/gen/dot/0c577b.wgsl.expected.msl index 4ed24198b4..c354cf70da 100644 --- a/test/intrinsics/gen/dot/0c577b.wgsl.expected.msl +++ b/test/intrinsics/gen/dot/0c577b.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void dot_0c577b() { - float res = dot(float4(), float4()); + float res = dot(float4(), float4()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/dot/883f0e.wgsl.expected.msl b/test/intrinsics/gen/dot/883f0e.wgsl.expected.msl index 4326cadf7d..f099d39348 100644 --- a/test/intrinsics/gen/dot/883f0e.wgsl.expected.msl +++ b/test/intrinsics/gen/dot/883f0e.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void dot_883f0e() { - float res = dot(float2(), float2()); + float res = dot(float2(), float2()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/dot/ba4246.wgsl.expected.msl b/test/intrinsics/gen/dot/ba4246.wgsl.expected.msl index ff18b2d89b..b67deb54b5 100644 --- a/test/intrinsics/gen/dot/ba4246.wgsl.expected.msl +++ b/test/intrinsics/gen/dot/ba4246.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void dot_ba4246() { - float res = dot(float3(), float3()); + float res = dot(float3(), float3()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/dpdx/0763f7.wgsl.expected.msl b/test/intrinsics/gen/dpdx/0763f7.wgsl.expected.msl index 082d92434f..a7719d71bf 100644 --- a/test/intrinsics/gen/dpdx/0763f7.wgsl.expected.msl +++ b/test/intrinsics/gen/dpdx/0763f7.wgsl.expected.msl @@ -2,7 +2,7 @@ using namespace metal; void dpdx_0763f7() { - float3 res = dfdx(float3()); + float3 res = dfdx(float3()); } fragment void fragment_main() { diff --git a/test/intrinsics/gen/dpdx/99edb1.wgsl.expected.msl b/test/intrinsics/gen/dpdx/99edb1.wgsl.expected.msl index 1c389c89ea..c1583821c1 100644 --- a/test/intrinsics/gen/dpdx/99edb1.wgsl.expected.msl +++ b/test/intrinsics/gen/dpdx/99edb1.wgsl.expected.msl @@ -2,7 +2,7 @@ using namespace metal; void dpdx_99edb1() { - float2 res = dfdx(float2()); + float2 res = dfdx(float2()); } fragment void fragment_main() { diff --git a/test/intrinsics/gen/dpdx/c487fa.wgsl.expected.msl b/test/intrinsics/gen/dpdx/c487fa.wgsl.expected.msl index 06e584f6f3..bb43c52cdf 100644 --- a/test/intrinsics/gen/dpdx/c487fa.wgsl.expected.msl +++ b/test/intrinsics/gen/dpdx/c487fa.wgsl.expected.msl @@ -2,7 +2,7 @@ using namespace metal; void dpdx_c487fa() { - float4 res = dfdx(float4()); + float4 res = dfdx(float4()); } fragment void fragment_main() { diff --git a/test/intrinsics/gen/dpdx/e263de.wgsl.expected.msl b/test/intrinsics/gen/dpdx/e263de.wgsl.expected.msl index 9a63d081ba..69792e1c1b 100644 --- a/test/intrinsics/gen/dpdx/e263de.wgsl.expected.msl +++ b/test/intrinsics/gen/dpdx/e263de.wgsl.expected.msl @@ -2,7 +2,7 @@ using namespace metal; void dpdx_e263de() { - float res = dfdx(1.0f); + float res = dfdx(1.0f); } fragment void fragment_main() { diff --git a/test/intrinsics/gen/dpdxCoarse/029152.wgsl.expected.msl b/test/intrinsics/gen/dpdxCoarse/029152.wgsl.expected.msl index fc27f74156..b566d55213 100644 --- a/test/intrinsics/gen/dpdxCoarse/029152.wgsl.expected.msl +++ b/test/intrinsics/gen/dpdxCoarse/029152.wgsl.expected.msl @@ -2,7 +2,7 @@ using namespace metal; void dpdxCoarse_029152() { - float res = dfdx(1.0f); + float res = dfdx(1.0f); } fragment void fragment_main() { diff --git a/test/intrinsics/gen/dpdxCoarse/9581cf.wgsl.expected.msl b/test/intrinsics/gen/dpdxCoarse/9581cf.wgsl.expected.msl index 283a082626..8bbf1acde1 100644 --- a/test/intrinsics/gen/dpdxCoarse/9581cf.wgsl.expected.msl +++ b/test/intrinsics/gen/dpdxCoarse/9581cf.wgsl.expected.msl @@ -2,7 +2,7 @@ using namespace metal; void dpdxCoarse_9581cf() { - float2 res = dfdx(float2()); + float2 res = dfdx(float2()); } fragment void fragment_main() { diff --git a/test/intrinsics/gen/dpdxCoarse/c28641.wgsl.expected.msl b/test/intrinsics/gen/dpdxCoarse/c28641.wgsl.expected.msl index 7134062edf..62b43ef782 100644 --- a/test/intrinsics/gen/dpdxCoarse/c28641.wgsl.expected.msl +++ b/test/intrinsics/gen/dpdxCoarse/c28641.wgsl.expected.msl @@ -2,7 +2,7 @@ using namespace metal; void dpdxCoarse_c28641() { - float4 res = dfdx(float4()); + float4 res = dfdx(float4()); } fragment void fragment_main() { diff --git a/test/intrinsics/gen/dpdxCoarse/f64d7b.wgsl.expected.msl b/test/intrinsics/gen/dpdxCoarse/f64d7b.wgsl.expected.msl index e04364e491..8c4d03840c 100644 --- a/test/intrinsics/gen/dpdxCoarse/f64d7b.wgsl.expected.msl +++ b/test/intrinsics/gen/dpdxCoarse/f64d7b.wgsl.expected.msl @@ -2,7 +2,7 @@ using namespace metal; void dpdxCoarse_f64d7b() { - float3 res = dfdx(float3()); + float3 res = dfdx(float3()); } fragment void fragment_main() { diff --git a/test/intrinsics/gen/dpdxFine/8c5069.wgsl.expected.msl b/test/intrinsics/gen/dpdxFine/8c5069.wgsl.expected.msl index c4a18edc94..6b2bc94ac8 100644 --- a/test/intrinsics/gen/dpdxFine/8c5069.wgsl.expected.msl +++ b/test/intrinsics/gen/dpdxFine/8c5069.wgsl.expected.msl @@ -2,7 +2,7 @@ using namespace metal; void dpdxFine_8c5069() { - float4 res = dfdx(float4()); + float4 res = dfdx(float4()); } fragment void fragment_main() { diff --git a/test/intrinsics/gen/dpdxFine/9631de.wgsl.expected.msl b/test/intrinsics/gen/dpdxFine/9631de.wgsl.expected.msl index be6ed51adc..60055fb30b 100644 --- a/test/intrinsics/gen/dpdxFine/9631de.wgsl.expected.msl +++ b/test/intrinsics/gen/dpdxFine/9631de.wgsl.expected.msl @@ -2,7 +2,7 @@ using namespace metal; void dpdxFine_9631de() { - float2 res = dfdx(float2()); + float2 res = dfdx(float2()); } fragment void fragment_main() { diff --git a/test/intrinsics/gen/dpdxFine/f401a2.wgsl.expected.msl b/test/intrinsics/gen/dpdxFine/f401a2.wgsl.expected.msl index b618db991d..26f6c10832 100644 --- a/test/intrinsics/gen/dpdxFine/f401a2.wgsl.expected.msl +++ b/test/intrinsics/gen/dpdxFine/f401a2.wgsl.expected.msl @@ -2,7 +2,7 @@ using namespace metal; void dpdxFine_f401a2() { - float res = dfdx(1.0f); + float res = dfdx(1.0f); } fragment void fragment_main() { diff --git a/test/intrinsics/gen/dpdxFine/f92fb6.wgsl.expected.msl b/test/intrinsics/gen/dpdxFine/f92fb6.wgsl.expected.msl index f19db0993c..8149873f7c 100644 --- a/test/intrinsics/gen/dpdxFine/f92fb6.wgsl.expected.msl +++ b/test/intrinsics/gen/dpdxFine/f92fb6.wgsl.expected.msl @@ -2,7 +2,7 @@ using namespace metal; void dpdxFine_f92fb6() { - float3 res = dfdx(float3()); + float3 res = dfdx(float3()); } fragment void fragment_main() { diff --git a/test/intrinsics/gen/dpdy/699a05.wgsl.expected.msl b/test/intrinsics/gen/dpdy/699a05.wgsl.expected.msl index 9a2a776841..f99636537f 100644 --- a/test/intrinsics/gen/dpdy/699a05.wgsl.expected.msl +++ b/test/intrinsics/gen/dpdy/699a05.wgsl.expected.msl @@ -2,7 +2,7 @@ using namespace metal; void dpdy_699a05() { - float4 res = dfdy(float4()); + float4 res = dfdy(float4()); } fragment void fragment_main() { diff --git a/test/intrinsics/gen/dpdy/7f8d84.wgsl.expected.msl b/test/intrinsics/gen/dpdy/7f8d84.wgsl.expected.msl index 5efaf9e876..d4f274e4e5 100644 --- a/test/intrinsics/gen/dpdy/7f8d84.wgsl.expected.msl +++ b/test/intrinsics/gen/dpdy/7f8d84.wgsl.expected.msl @@ -2,7 +2,7 @@ using namespace metal; void dpdy_7f8d84() { - float res = dfdy(1.0f); + float res = dfdy(1.0f); } fragment void fragment_main() { diff --git a/test/intrinsics/gen/dpdy/a8b56e.wgsl.expected.msl b/test/intrinsics/gen/dpdy/a8b56e.wgsl.expected.msl index 74fa55114a..98a29ea033 100644 --- a/test/intrinsics/gen/dpdy/a8b56e.wgsl.expected.msl +++ b/test/intrinsics/gen/dpdy/a8b56e.wgsl.expected.msl @@ -2,7 +2,7 @@ using namespace metal; void dpdy_a8b56e() { - float2 res = dfdy(float2()); + float2 res = dfdy(float2()); } fragment void fragment_main() { diff --git a/test/intrinsics/gen/dpdy/feb40f.wgsl.expected.msl b/test/intrinsics/gen/dpdy/feb40f.wgsl.expected.msl index 5c4fdf7b86..d0236bac27 100644 --- a/test/intrinsics/gen/dpdy/feb40f.wgsl.expected.msl +++ b/test/intrinsics/gen/dpdy/feb40f.wgsl.expected.msl @@ -2,7 +2,7 @@ using namespace metal; void dpdy_feb40f() { - float3 res = dfdy(float3()); + float3 res = dfdy(float3()); } fragment void fragment_main() { diff --git a/test/intrinsics/gen/dpdyCoarse/3e1ab4.wgsl.expected.msl b/test/intrinsics/gen/dpdyCoarse/3e1ab4.wgsl.expected.msl index 55be7be34c..83cceec856 100644 --- a/test/intrinsics/gen/dpdyCoarse/3e1ab4.wgsl.expected.msl +++ b/test/intrinsics/gen/dpdyCoarse/3e1ab4.wgsl.expected.msl @@ -2,7 +2,7 @@ using namespace metal; void dpdyCoarse_3e1ab4() { - float2 res = dfdy(float2()); + float2 res = dfdy(float2()); } fragment void fragment_main() { diff --git a/test/intrinsics/gen/dpdyCoarse/445d24.wgsl.expected.msl b/test/intrinsics/gen/dpdyCoarse/445d24.wgsl.expected.msl index 32038ddcbe..cbc5f5021e 100644 --- a/test/intrinsics/gen/dpdyCoarse/445d24.wgsl.expected.msl +++ b/test/intrinsics/gen/dpdyCoarse/445d24.wgsl.expected.msl @@ -2,7 +2,7 @@ using namespace metal; void dpdyCoarse_445d24() { - float4 res = dfdy(float4()); + float4 res = dfdy(float4()); } fragment void fragment_main() { diff --git a/test/intrinsics/gen/dpdyCoarse/870a7e.wgsl.expected.msl b/test/intrinsics/gen/dpdyCoarse/870a7e.wgsl.expected.msl index 42c9c5dc7e..f77b1225af 100644 --- a/test/intrinsics/gen/dpdyCoarse/870a7e.wgsl.expected.msl +++ b/test/intrinsics/gen/dpdyCoarse/870a7e.wgsl.expected.msl @@ -2,7 +2,7 @@ using namespace metal; void dpdyCoarse_870a7e() { - float res = dfdy(1.0f); + float res = dfdy(1.0f); } fragment void fragment_main() { diff --git a/test/intrinsics/gen/dpdyCoarse/ae1873.wgsl.expected.msl b/test/intrinsics/gen/dpdyCoarse/ae1873.wgsl.expected.msl index 9f1ea7f7b4..048ceeebf4 100644 --- a/test/intrinsics/gen/dpdyCoarse/ae1873.wgsl.expected.msl +++ b/test/intrinsics/gen/dpdyCoarse/ae1873.wgsl.expected.msl @@ -2,7 +2,7 @@ using namespace metal; void dpdyCoarse_ae1873() { - float3 res = dfdy(float3()); + float3 res = dfdy(float3()); } fragment void fragment_main() { diff --git a/test/intrinsics/gen/dpdyFine/1fb7ab.wgsl.expected.msl b/test/intrinsics/gen/dpdyFine/1fb7ab.wgsl.expected.msl index bc48a42d16..cfbdf5daf1 100644 --- a/test/intrinsics/gen/dpdyFine/1fb7ab.wgsl.expected.msl +++ b/test/intrinsics/gen/dpdyFine/1fb7ab.wgsl.expected.msl @@ -2,7 +2,7 @@ using namespace metal; void dpdyFine_1fb7ab() { - float3 res = dfdy(float3()); + float3 res = dfdy(float3()); } fragment void fragment_main() { diff --git a/test/intrinsics/gen/dpdyFine/6eb673.wgsl.expected.msl b/test/intrinsics/gen/dpdyFine/6eb673.wgsl.expected.msl index a30960ec4f..38d8c93ca9 100644 --- a/test/intrinsics/gen/dpdyFine/6eb673.wgsl.expected.msl +++ b/test/intrinsics/gen/dpdyFine/6eb673.wgsl.expected.msl @@ -2,7 +2,7 @@ using namespace metal; void dpdyFine_6eb673() { - float res = dfdy(1.0f); + float res = dfdy(1.0f); } fragment void fragment_main() { diff --git a/test/intrinsics/gen/dpdyFine/d0a648.wgsl.expected.msl b/test/intrinsics/gen/dpdyFine/d0a648.wgsl.expected.msl index 93ecdf6b28..b728bff555 100644 --- a/test/intrinsics/gen/dpdyFine/d0a648.wgsl.expected.msl +++ b/test/intrinsics/gen/dpdyFine/d0a648.wgsl.expected.msl @@ -2,7 +2,7 @@ using namespace metal; void dpdyFine_d0a648() { - float4 res = dfdy(float4()); + float4 res = dfdy(float4()); } fragment void fragment_main() { diff --git a/test/intrinsics/gen/dpdyFine/df33aa.wgsl.expected.msl b/test/intrinsics/gen/dpdyFine/df33aa.wgsl.expected.msl index a8dcab854f..a2e88c9d9c 100644 --- a/test/intrinsics/gen/dpdyFine/df33aa.wgsl.expected.msl +++ b/test/intrinsics/gen/dpdyFine/df33aa.wgsl.expected.msl @@ -2,7 +2,7 @@ using namespace metal; void dpdyFine_df33aa() { - float2 res = dfdy(float2()); + float2 res = dfdy(float2()); } fragment void fragment_main() { diff --git a/test/intrinsics/gen/exp/0f70eb.wgsl.expected.msl b/test/intrinsics/gen/exp/0f70eb.wgsl.expected.msl index 53549b7ad0..022ea5d9fb 100644 --- a/test/intrinsics/gen/exp/0f70eb.wgsl.expected.msl +++ b/test/intrinsics/gen/exp/0f70eb.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void exp_0f70eb() { - float4 res = exp(float4()); + float4 res = exp(float4()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/exp/1951e7.wgsl.expected.msl b/test/intrinsics/gen/exp/1951e7.wgsl.expected.msl index 726f80d7e6..2123f97cf0 100644 --- a/test/intrinsics/gen/exp/1951e7.wgsl.expected.msl +++ b/test/intrinsics/gen/exp/1951e7.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void exp_1951e7() { - float2 res = exp(float2()); + float2 res = exp(float2()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/exp/771fd2.wgsl.expected.msl b/test/intrinsics/gen/exp/771fd2.wgsl.expected.msl index 0a161db50c..345a5f89f3 100644 --- a/test/intrinsics/gen/exp/771fd2.wgsl.expected.msl +++ b/test/intrinsics/gen/exp/771fd2.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void exp_771fd2() { - float res = exp(1.0f); + float res = exp(1.0f); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/exp/d98450.wgsl.expected.msl b/test/intrinsics/gen/exp/d98450.wgsl.expected.msl index 1ec8727331..073deec29b 100644 --- a/test/intrinsics/gen/exp/d98450.wgsl.expected.msl +++ b/test/intrinsics/gen/exp/d98450.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void exp_d98450() { - float3 res = exp(float3()); + float3 res = exp(float3()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/exp2/1f8680.wgsl.expected.msl b/test/intrinsics/gen/exp2/1f8680.wgsl.expected.msl index 057b984aa8..4929bd0701 100644 --- a/test/intrinsics/gen/exp2/1f8680.wgsl.expected.msl +++ b/test/intrinsics/gen/exp2/1f8680.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void exp2_1f8680() { - float3 res = exp2(float3()); + float3 res = exp2(float3()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/exp2/a9d0a7.wgsl.expected.msl b/test/intrinsics/gen/exp2/a9d0a7.wgsl.expected.msl index ed2faacb88..d727ef8e4c 100644 --- a/test/intrinsics/gen/exp2/a9d0a7.wgsl.expected.msl +++ b/test/intrinsics/gen/exp2/a9d0a7.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void exp2_a9d0a7() { - float4 res = exp2(float4()); + float4 res = exp2(float4()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/exp2/d6777c.wgsl.expected.msl b/test/intrinsics/gen/exp2/d6777c.wgsl.expected.msl index 6149c4d5bd..71e01861a3 100644 --- a/test/intrinsics/gen/exp2/d6777c.wgsl.expected.msl +++ b/test/intrinsics/gen/exp2/d6777c.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void exp2_d6777c() { - float2 res = exp2(float2()); + float2 res = exp2(float2()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/exp2/dea523.wgsl.expected.msl b/test/intrinsics/gen/exp2/dea523.wgsl.expected.msl index 491945c6f6..7eba951e91 100644 --- a/test/intrinsics/gen/exp2/dea523.wgsl.expected.msl +++ b/test/intrinsics/gen/exp2/dea523.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void exp2_dea523() { - float res = exp2(1.0f); + float res = exp2(1.0f); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/faceForward/5afbd5.wgsl.expected.msl b/test/intrinsics/gen/faceForward/5afbd5.wgsl.expected.msl index fcd07b6dc1..8e29e8927d 100644 --- a/test/intrinsics/gen/faceForward/5afbd5.wgsl.expected.msl +++ b/test/intrinsics/gen/faceForward/5afbd5.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void faceForward_5afbd5() { - float3 res = faceforward(float3(), float3(), float3()); + float3 res = faceforward(float3(), float3(), float3()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/faceForward/b316e5.wgsl.expected.msl b/test/intrinsics/gen/faceForward/b316e5.wgsl.expected.msl index 1048b00e83..1ca663acdf 100644 --- a/test/intrinsics/gen/faceForward/b316e5.wgsl.expected.msl +++ b/test/intrinsics/gen/faceForward/b316e5.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void faceForward_b316e5() { - float4 res = faceforward(float4(), float4(), float4()); + float4 res = faceforward(float4(), float4(), float4()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/faceForward/e6908b.wgsl.expected.msl b/test/intrinsics/gen/faceForward/e6908b.wgsl.expected.msl index ca8e6ef3b2..0136e3ae15 100644 --- a/test/intrinsics/gen/faceForward/e6908b.wgsl.expected.msl +++ b/test/intrinsics/gen/faceForward/e6908b.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void faceForward_e6908b() { - float2 res = faceforward(float2(), float2(), float2()); + float2 res = faceforward(float2(), float2(), float2()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/floor/3bccc4.wgsl.expected.msl b/test/intrinsics/gen/floor/3bccc4.wgsl.expected.msl index 7802674e52..50ec31e178 100644 --- a/test/intrinsics/gen/floor/3bccc4.wgsl.expected.msl +++ b/test/intrinsics/gen/floor/3bccc4.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void floor_3bccc4() { - float4 res = floor(float4()); + float4 res = floor(float4()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/floor/5fc9ac.wgsl.expected.msl b/test/intrinsics/gen/floor/5fc9ac.wgsl.expected.msl index 36b78f84ea..f50587a43e 100644 --- a/test/intrinsics/gen/floor/5fc9ac.wgsl.expected.msl +++ b/test/intrinsics/gen/floor/5fc9ac.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void floor_5fc9ac() { - float2 res = floor(float2()); + float2 res = floor(float2()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/floor/60d7ea.wgsl.expected.msl b/test/intrinsics/gen/floor/60d7ea.wgsl.expected.msl index 95b42aa3c8..8ed07d4106 100644 --- a/test/intrinsics/gen/floor/60d7ea.wgsl.expected.msl +++ b/test/intrinsics/gen/floor/60d7ea.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void floor_60d7ea() { - float3 res = floor(float3()); + float3 res = floor(float3()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/floor/66f154.wgsl.expected.msl b/test/intrinsics/gen/floor/66f154.wgsl.expected.msl index c93a90e1dd..a5b9f9d1e9 100644 --- a/test/intrinsics/gen/floor/66f154.wgsl.expected.msl +++ b/test/intrinsics/gen/floor/66f154.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void floor_66f154() { - float res = floor(1.0f); + float res = floor(1.0f); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/fma/26a7a9.wgsl.expected.msl b/test/intrinsics/gen/fma/26a7a9.wgsl.expected.msl index 2acc8ac01c..f9349e962e 100644 --- a/test/intrinsics/gen/fma/26a7a9.wgsl.expected.msl +++ b/test/intrinsics/gen/fma/26a7a9.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void fma_26a7a9() { - float2 res = fma(float2(), float2(), float2()); + float2 res = fma(float2(), float2(), float2()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/fma/6a3283.wgsl.expected.msl b/test/intrinsics/gen/fma/6a3283.wgsl.expected.msl index 962630d693..f964054f23 100644 --- a/test/intrinsics/gen/fma/6a3283.wgsl.expected.msl +++ b/test/intrinsics/gen/fma/6a3283.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void fma_6a3283() { - float4 res = fma(float4(), float4(), float4()); + float4 res = fma(float4(), float4(), float4()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/fma/c10ba3.wgsl.expected.msl b/test/intrinsics/gen/fma/c10ba3.wgsl.expected.msl index b0409f3442..0f9a195f23 100644 --- a/test/intrinsics/gen/fma/c10ba3.wgsl.expected.msl +++ b/test/intrinsics/gen/fma/c10ba3.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void fma_c10ba3() { - float res = fma(1.0f, 1.0f, 1.0f); + float res = fma(1.0f, 1.0f, 1.0f); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/fma/e17c5c.wgsl.expected.msl b/test/intrinsics/gen/fma/e17c5c.wgsl.expected.msl index c40dff0e04..e606075d32 100644 --- a/test/intrinsics/gen/fma/e17c5c.wgsl.expected.msl +++ b/test/intrinsics/gen/fma/e17c5c.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void fma_e17c5c() { - float3 res = fma(float3(), float3(), float3()); + float3 res = fma(float3(), float3(), float3()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/fract/8bc1e9.wgsl.expected.msl b/test/intrinsics/gen/fract/8bc1e9.wgsl.expected.msl index d4d52b27a7..b78669667f 100644 --- a/test/intrinsics/gen/fract/8bc1e9.wgsl.expected.msl +++ b/test/intrinsics/gen/fract/8bc1e9.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void fract_8bc1e9() { - float4 res = fract(float4()); + float4 res = fract(float4()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/fract/943cb1.wgsl.expected.msl b/test/intrinsics/gen/fract/943cb1.wgsl.expected.msl index 1c895839de..c8596ab584 100644 --- a/test/intrinsics/gen/fract/943cb1.wgsl.expected.msl +++ b/test/intrinsics/gen/fract/943cb1.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void fract_943cb1() { - float2 res = fract(float2()); + float2 res = fract(float2()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/fract/a49758.wgsl.expected.msl b/test/intrinsics/gen/fract/a49758.wgsl.expected.msl index 400fc0a035..1dbebec91a 100644 --- a/test/intrinsics/gen/fract/a49758.wgsl.expected.msl +++ b/test/intrinsics/gen/fract/a49758.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void fract_a49758() { - float3 res = fract(float3()); + float3 res = fract(float3()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/fract/fa5c71.wgsl.expected.msl b/test/intrinsics/gen/fract/fa5c71.wgsl.expected.msl index 5d6f2fcc21..03f3ed285c 100644 --- a/test/intrinsics/gen/fract/fa5c71.wgsl.expected.msl +++ b/test/intrinsics/gen/fract/fa5c71.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void fract_fa5c71() { - float res = fract(1.0f); + float res = fract(1.0f); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/fwidth/5d1b39.wgsl.expected.msl b/test/intrinsics/gen/fwidth/5d1b39.wgsl.expected.msl index 28a57ced31..671ca4878d 100644 --- a/test/intrinsics/gen/fwidth/5d1b39.wgsl.expected.msl +++ b/test/intrinsics/gen/fwidth/5d1b39.wgsl.expected.msl @@ -2,7 +2,7 @@ using namespace metal; void fwidth_5d1b39() { - float3 res = fwidth(float3()); + float3 res = fwidth(float3()); } fragment void fragment_main() { diff --git a/test/intrinsics/gen/fwidth/b83ebb.wgsl.expected.msl b/test/intrinsics/gen/fwidth/b83ebb.wgsl.expected.msl index 303cfba656..2dce76c754 100644 --- a/test/intrinsics/gen/fwidth/b83ebb.wgsl.expected.msl +++ b/test/intrinsics/gen/fwidth/b83ebb.wgsl.expected.msl @@ -2,7 +2,7 @@ using namespace metal; void fwidth_b83ebb() { - float2 res = fwidth(float2()); + float2 res = fwidth(float2()); } fragment void fragment_main() { diff --git a/test/intrinsics/gen/fwidth/d2ab9a.wgsl.expected.msl b/test/intrinsics/gen/fwidth/d2ab9a.wgsl.expected.msl index 16b46fcd06..076783c53b 100644 --- a/test/intrinsics/gen/fwidth/d2ab9a.wgsl.expected.msl +++ b/test/intrinsics/gen/fwidth/d2ab9a.wgsl.expected.msl @@ -2,7 +2,7 @@ using namespace metal; void fwidth_d2ab9a() { - float4 res = fwidth(float4()); + float4 res = fwidth(float4()); } fragment void fragment_main() { diff --git a/test/intrinsics/gen/fwidth/df38ef.wgsl.expected.msl b/test/intrinsics/gen/fwidth/df38ef.wgsl.expected.msl index 21b2f40052..3af325aa75 100644 --- a/test/intrinsics/gen/fwidth/df38ef.wgsl.expected.msl +++ b/test/intrinsics/gen/fwidth/df38ef.wgsl.expected.msl @@ -2,7 +2,7 @@ using namespace metal; void fwidth_df38ef() { - float res = fwidth(1.0f); + float res = fwidth(1.0f); } fragment void fragment_main() { diff --git a/test/intrinsics/gen/fwidthCoarse/159c8a.wgsl.expected.msl b/test/intrinsics/gen/fwidthCoarse/159c8a.wgsl.expected.msl index 82190f39ca..31ad6a1926 100644 --- a/test/intrinsics/gen/fwidthCoarse/159c8a.wgsl.expected.msl +++ b/test/intrinsics/gen/fwidthCoarse/159c8a.wgsl.expected.msl @@ -2,7 +2,7 @@ using namespace metal; void fwidthCoarse_159c8a() { - float res = fwidth(1.0f); + float res = fwidth(1.0f); } fragment void fragment_main() { diff --git a/test/intrinsics/gen/fwidthCoarse/1e59d9.wgsl.expected.msl b/test/intrinsics/gen/fwidthCoarse/1e59d9.wgsl.expected.msl index 621c23760f..b2f9f1e3e2 100644 --- a/test/intrinsics/gen/fwidthCoarse/1e59d9.wgsl.expected.msl +++ b/test/intrinsics/gen/fwidthCoarse/1e59d9.wgsl.expected.msl @@ -2,7 +2,7 @@ using namespace metal; void fwidthCoarse_1e59d9() { - float3 res = fwidth(float3()); + float3 res = fwidth(float3()); } fragment void fragment_main() { diff --git a/test/intrinsics/gen/fwidthCoarse/4e4fc4.wgsl.expected.msl b/test/intrinsics/gen/fwidthCoarse/4e4fc4.wgsl.expected.msl index 29dba71d51..88298ddaa4 100644 --- a/test/intrinsics/gen/fwidthCoarse/4e4fc4.wgsl.expected.msl +++ b/test/intrinsics/gen/fwidthCoarse/4e4fc4.wgsl.expected.msl @@ -2,7 +2,7 @@ using namespace metal; void fwidthCoarse_4e4fc4() { - float4 res = fwidth(float4()); + float4 res = fwidth(float4()); } fragment void fragment_main() { diff --git a/test/intrinsics/gen/fwidthCoarse/e653f7.wgsl.expected.msl b/test/intrinsics/gen/fwidthCoarse/e653f7.wgsl.expected.msl index cfd97035bc..63409de801 100644 --- a/test/intrinsics/gen/fwidthCoarse/e653f7.wgsl.expected.msl +++ b/test/intrinsics/gen/fwidthCoarse/e653f7.wgsl.expected.msl @@ -2,7 +2,7 @@ using namespace metal; void fwidthCoarse_e653f7() { - float2 res = fwidth(float2()); + float2 res = fwidth(float2()); } fragment void fragment_main() { diff --git a/test/intrinsics/gen/fwidthFine/523fdc.wgsl.expected.msl b/test/intrinsics/gen/fwidthFine/523fdc.wgsl.expected.msl index aa1d73d174..ba43d3cd2a 100644 --- a/test/intrinsics/gen/fwidthFine/523fdc.wgsl.expected.msl +++ b/test/intrinsics/gen/fwidthFine/523fdc.wgsl.expected.msl @@ -2,7 +2,7 @@ using namespace metal; void fwidthFine_523fdc() { - float3 res = fwidth(float3()); + float3 res = fwidth(float3()); } fragment void fragment_main() { diff --git a/test/intrinsics/gen/fwidthFine/68f4ef.wgsl.expected.msl b/test/intrinsics/gen/fwidthFine/68f4ef.wgsl.expected.msl index b7c53d9613..7d756f8139 100644 --- a/test/intrinsics/gen/fwidthFine/68f4ef.wgsl.expected.msl +++ b/test/intrinsics/gen/fwidthFine/68f4ef.wgsl.expected.msl @@ -2,7 +2,7 @@ using namespace metal; void fwidthFine_68f4ef() { - float4 res = fwidth(float4()); + float4 res = fwidth(float4()); } fragment void fragment_main() { diff --git a/test/intrinsics/gen/fwidthFine/f1742d.wgsl.expected.msl b/test/intrinsics/gen/fwidthFine/f1742d.wgsl.expected.msl index 5a98fd6073..33102d3bad 100644 --- a/test/intrinsics/gen/fwidthFine/f1742d.wgsl.expected.msl +++ b/test/intrinsics/gen/fwidthFine/f1742d.wgsl.expected.msl @@ -2,7 +2,7 @@ using namespace metal; void fwidthFine_f1742d() { - float res = fwidth(1.0f); + float res = fwidth(1.0f); } fragment void fragment_main() { diff --git a/test/intrinsics/gen/fwidthFine/ff6aa0.wgsl.expected.msl b/test/intrinsics/gen/fwidthFine/ff6aa0.wgsl.expected.msl index 7ebd710906..b7225af28a 100644 --- a/test/intrinsics/gen/fwidthFine/ff6aa0.wgsl.expected.msl +++ b/test/intrinsics/gen/fwidthFine/ff6aa0.wgsl.expected.msl @@ -2,7 +2,7 @@ using namespace metal; void fwidthFine_ff6aa0() { - float2 res = fwidth(float2()); + float2 res = fwidth(float2()); } fragment void fragment_main() { diff --git a/test/intrinsics/gen/inverseSqrt/84407e.wgsl.expected.msl b/test/intrinsics/gen/inverseSqrt/84407e.wgsl.expected.msl index 0ff2cd01ec..07861bce3b 100644 --- a/test/intrinsics/gen/inverseSqrt/84407e.wgsl.expected.msl +++ b/test/intrinsics/gen/inverseSqrt/84407e.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void inverseSqrt_84407e() { - float res = rsqrt(1.0f); + float res = rsqrt(1.0f); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/inverseSqrt/8f2bd2.wgsl.expected.msl b/test/intrinsics/gen/inverseSqrt/8f2bd2.wgsl.expected.msl index beeb2cbee8..fdc64f91d4 100644 --- a/test/intrinsics/gen/inverseSqrt/8f2bd2.wgsl.expected.msl +++ b/test/intrinsics/gen/inverseSqrt/8f2bd2.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void inverseSqrt_8f2bd2() { - float2 res = rsqrt(float2()); + float2 res = rsqrt(float2()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/inverseSqrt/b197b1.wgsl.expected.msl b/test/intrinsics/gen/inverseSqrt/b197b1.wgsl.expected.msl index da0d9714a9..65ebe3acb1 100644 --- a/test/intrinsics/gen/inverseSqrt/b197b1.wgsl.expected.msl +++ b/test/intrinsics/gen/inverseSqrt/b197b1.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void inverseSqrt_b197b1() { - float3 res = rsqrt(float3()); + float3 res = rsqrt(float3()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/inverseSqrt/c22347.wgsl.expected.msl b/test/intrinsics/gen/inverseSqrt/c22347.wgsl.expected.msl index 07deeaad49..891de7ec09 100644 --- a/test/intrinsics/gen/inverseSqrt/c22347.wgsl.expected.msl +++ b/test/intrinsics/gen/inverseSqrt/c22347.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void inverseSqrt_c22347() { - float4 res = rsqrt(float4()); + float4 res = rsqrt(float4()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/isFinite/34d32b.wgsl.expected.msl b/test/intrinsics/gen/isFinite/34d32b.wgsl.expected.msl index be2ba66649..d6adc3b103 100644 --- a/test/intrinsics/gen/isFinite/34d32b.wgsl.expected.msl +++ b/test/intrinsics/gen/isFinite/34d32b.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void isFinite_34d32b() { - bool2 res = isfinite(float2()); + bool2 res = isfinite(float2()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/isFinite/426f9f.wgsl.expected.msl b/test/intrinsics/gen/isFinite/426f9f.wgsl.expected.msl index fc6d588ae0..7b88dba956 100644 --- a/test/intrinsics/gen/isFinite/426f9f.wgsl.expected.msl +++ b/test/intrinsics/gen/isFinite/426f9f.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void isFinite_426f9f() { - bool res = isfinite(1.0f); + bool res = isfinite(1.0f); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/isFinite/8a23ad.wgsl.expected.msl b/test/intrinsics/gen/isFinite/8a23ad.wgsl.expected.msl index 9ecb4a4c33..c0f197bbc3 100644 --- a/test/intrinsics/gen/isFinite/8a23ad.wgsl.expected.msl +++ b/test/intrinsics/gen/isFinite/8a23ad.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void isFinite_8a23ad() { - bool3 res = isfinite(float3()); + bool3 res = isfinite(float3()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/isFinite/f31987.wgsl.expected.msl b/test/intrinsics/gen/isFinite/f31987.wgsl.expected.msl index 0cd88d997f..775a79926e 100644 --- a/test/intrinsics/gen/isFinite/f31987.wgsl.expected.msl +++ b/test/intrinsics/gen/isFinite/f31987.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void isFinite_f31987() { - bool4 res = isfinite(float4()); + bool4 res = isfinite(float4()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/isInf/666f2a.wgsl.expected.msl b/test/intrinsics/gen/isInf/666f2a.wgsl.expected.msl index 39d8aa9c73..61fdda685b 100644 --- a/test/intrinsics/gen/isInf/666f2a.wgsl.expected.msl +++ b/test/intrinsics/gen/isInf/666f2a.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void isInf_666f2a() { - bool3 res = isinf(float3()); + bool3 res = isinf(float3()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/isInf/7bd98f.wgsl.expected.msl b/test/intrinsics/gen/isInf/7bd98f.wgsl.expected.msl index 6cec857d7d..0850ae5886 100644 --- a/test/intrinsics/gen/isInf/7bd98f.wgsl.expected.msl +++ b/test/intrinsics/gen/isInf/7bd98f.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void isInf_7bd98f() { - bool res = isinf(1.0f); + bool res = isinf(1.0f); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/isInf/7e81b5.wgsl.expected.msl b/test/intrinsics/gen/isInf/7e81b5.wgsl.expected.msl index e8636d9025..0362bce8f1 100644 --- a/test/intrinsics/gen/isInf/7e81b5.wgsl.expected.msl +++ b/test/intrinsics/gen/isInf/7e81b5.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void isInf_7e81b5() { - bool4 res = isinf(float4()); + bool4 res = isinf(float4()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/isInf/a46d6f.wgsl.expected.msl b/test/intrinsics/gen/isInf/a46d6f.wgsl.expected.msl index d423213c5c..e5ed9f2bb7 100644 --- a/test/intrinsics/gen/isInf/a46d6f.wgsl.expected.msl +++ b/test/intrinsics/gen/isInf/a46d6f.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void isInf_a46d6f() { - bool2 res = isinf(float2()); + bool2 res = isinf(float2()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/isNan/1280ab.wgsl.expected.msl b/test/intrinsics/gen/isNan/1280ab.wgsl.expected.msl index aa45bd0413..64b9ace655 100644 --- a/test/intrinsics/gen/isNan/1280ab.wgsl.expected.msl +++ b/test/intrinsics/gen/isNan/1280ab.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void isNan_1280ab() { - bool3 res = isnan(float3()); + bool3 res = isnan(float3()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/isNan/4d280d.wgsl.expected.msl b/test/intrinsics/gen/isNan/4d280d.wgsl.expected.msl index 28fc710cc2..b8a2e22fe5 100644 --- a/test/intrinsics/gen/isNan/4d280d.wgsl.expected.msl +++ b/test/intrinsics/gen/isNan/4d280d.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void isNan_4d280d() { - bool4 res = isnan(float4()); + bool4 res = isnan(float4()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/isNan/67ecd3.wgsl.expected.msl b/test/intrinsics/gen/isNan/67ecd3.wgsl.expected.msl index 12439ba984..932d0cc2ee 100644 --- a/test/intrinsics/gen/isNan/67ecd3.wgsl.expected.msl +++ b/test/intrinsics/gen/isNan/67ecd3.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void isNan_67ecd3() { - bool2 res = isnan(float2()); + bool2 res = isnan(float2()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/isNan/e4978e.wgsl.expected.msl b/test/intrinsics/gen/isNan/e4978e.wgsl.expected.msl index cad8c71f99..c94a9afc01 100644 --- a/test/intrinsics/gen/isNan/e4978e.wgsl.expected.msl +++ b/test/intrinsics/gen/isNan/e4978e.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void isNan_e4978e() { - bool res = isnan(1.0f); + bool res = isnan(1.0f); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/isNormal/863dcd.wgsl.expected.msl b/test/intrinsics/gen/isNormal/863dcd.wgsl.expected.msl index 67595de1b5..b086c06a73 100644 --- a/test/intrinsics/gen/isNormal/863dcd.wgsl.expected.msl +++ b/test/intrinsics/gen/isNormal/863dcd.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void isNormal_863dcd() { - bool4 res = isnormal(float4()); + bool4 res = isnormal(float4()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/isNormal/b00ab1.wgsl.expected.msl b/test/intrinsics/gen/isNormal/b00ab1.wgsl.expected.msl index 898dd73597..6bcb39256f 100644 --- a/test/intrinsics/gen/isNormal/b00ab1.wgsl.expected.msl +++ b/test/intrinsics/gen/isNormal/b00ab1.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void isNormal_b00ab1() { - bool2 res = isnormal(float2()); + bool2 res = isnormal(float2()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/isNormal/c286b7.wgsl.expected.msl b/test/intrinsics/gen/isNormal/c286b7.wgsl.expected.msl index e7bac05a89..f3e7527344 100644 --- a/test/intrinsics/gen/isNormal/c286b7.wgsl.expected.msl +++ b/test/intrinsics/gen/isNormal/c286b7.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void isNormal_c286b7() { - bool3 res = isnormal(float3()); + bool3 res = isnormal(float3()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/isNormal/c6e880.wgsl.expected.msl b/test/intrinsics/gen/isNormal/c6e880.wgsl.expected.msl index 2df6a245b7..e5b54cb1ef 100644 --- a/test/intrinsics/gen/isNormal/c6e880.wgsl.expected.msl +++ b/test/intrinsics/gen/isNormal/c6e880.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void isNormal_c6e880() { - bool res = isnormal(1.0f); + bool res = isnormal(1.0f); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/ldexp/a31cdc.wgsl.expected.msl b/test/intrinsics/gen/ldexp/a31cdc.wgsl.expected.msl index 12ec93616b..ad04640ea4 100644 --- a/test/intrinsics/gen/ldexp/a31cdc.wgsl.expected.msl +++ b/test/intrinsics/gen/ldexp/a31cdc.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void ldexp_a31cdc() { - float3 res = ldexp(float3(), int3()); + float3 res = ldexp(float3(), int3()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/ldexp/abd718.wgsl.expected.msl b/test/intrinsics/gen/ldexp/abd718.wgsl.expected.msl index 2fa4009f29..ca0e3a5d2a 100644 --- a/test/intrinsics/gen/ldexp/abd718.wgsl.expected.msl +++ b/test/intrinsics/gen/ldexp/abd718.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void ldexp_abd718() { - float2 res = ldexp(float2(), int2()); + float2 res = ldexp(float2(), int2()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/ldexp/cc9cde.wgsl.expected.msl b/test/intrinsics/gen/ldexp/cc9cde.wgsl.expected.msl index c8a2dc950c..5a3b8110bb 100644 --- a/test/intrinsics/gen/ldexp/cc9cde.wgsl.expected.msl +++ b/test/intrinsics/gen/ldexp/cc9cde.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void ldexp_cc9cde() { - float4 res = ldexp(float4(), int4()); + float4 res = ldexp(float4(), int4()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/ldexp/db8b49.wgsl.expected.msl b/test/intrinsics/gen/ldexp/db8b49.wgsl.expected.msl index cc7fbc1250..650cce2849 100644 --- a/test/intrinsics/gen/ldexp/db8b49.wgsl.expected.msl +++ b/test/intrinsics/gen/ldexp/db8b49.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void ldexp_db8b49() { - float res = ldexp(1.0f, 1); + float res = ldexp(1.0f, 1); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/ldexp/f54ff2.wgsl.expected.msl b/test/intrinsics/gen/ldexp/f54ff2.wgsl.expected.msl index 9cef87efe3..e8613892e0 100644 --- a/test/intrinsics/gen/ldexp/f54ff2.wgsl.expected.msl +++ b/test/intrinsics/gen/ldexp/f54ff2.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void ldexp_f54ff2() { - float res = ldexp(1.0f, 1u); + float res = ldexp(1.0f, 1u); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/length/056071.wgsl.expected.msl b/test/intrinsics/gen/length/056071.wgsl.expected.msl index bddb507941..fb40a90ad7 100644 --- a/test/intrinsics/gen/length/056071.wgsl.expected.msl +++ b/test/intrinsics/gen/length/056071.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void length_056071() { - float res = length(float3()); + float res = length(float3()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/length/afde8b.wgsl.expected.msl b/test/intrinsics/gen/length/afde8b.wgsl.expected.msl index 19022642ce..6587bc0067 100644 --- a/test/intrinsics/gen/length/afde8b.wgsl.expected.msl +++ b/test/intrinsics/gen/length/afde8b.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void length_afde8b() { - float res = length(float2()); + float res = length(float2()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/length/becebf.wgsl.expected.msl b/test/intrinsics/gen/length/becebf.wgsl.expected.msl index 9cd6341109..4fa8cd2036 100644 --- a/test/intrinsics/gen/length/becebf.wgsl.expected.msl +++ b/test/intrinsics/gen/length/becebf.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void length_becebf() { - float res = length(float4()); + float res = length(float4()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/log/3da25a.wgsl.expected.msl b/test/intrinsics/gen/log/3da25a.wgsl.expected.msl index 87551df830..c5e7404f30 100644 --- a/test/intrinsics/gen/log/3da25a.wgsl.expected.msl +++ b/test/intrinsics/gen/log/3da25a.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void log_3da25a() { - float4 res = log(float4()); + float4 res = log(float4()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/log/7114a6.wgsl.expected.msl b/test/intrinsics/gen/log/7114a6.wgsl.expected.msl index ca217059a1..72b940ac35 100644 --- a/test/intrinsics/gen/log/7114a6.wgsl.expected.msl +++ b/test/intrinsics/gen/log/7114a6.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void log_7114a6() { - float res = log(1.0f); + float res = log(1.0f); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/log/b2ce28.wgsl.expected.msl b/test/intrinsics/gen/log/b2ce28.wgsl.expected.msl index 43777d4c2f..576f8af392 100644 --- a/test/intrinsics/gen/log/b2ce28.wgsl.expected.msl +++ b/test/intrinsics/gen/log/b2ce28.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void log_b2ce28() { - float2 res = log(float2()); + float2 res = log(float2()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/log/f4c570.wgsl.expected.msl b/test/intrinsics/gen/log/f4c570.wgsl.expected.msl index 63442469bb..a89a44ba34 100644 --- a/test/intrinsics/gen/log/f4c570.wgsl.expected.msl +++ b/test/intrinsics/gen/log/f4c570.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void log_f4c570() { - float3 res = log(float3()); + float3 res = log(float3()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/log2/4036ed.wgsl.expected.msl b/test/intrinsics/gen/log2/4036ed.wgsl.expected.msl index 49dc07a9a4..a5303ebbb9 100644 --- a/test/intrinsics/gen/log2/4036ed.wgsl.expected.msl +++ b/test/intrinsics/gen/log2/4036ed.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void log2_4036ed() { - float res = log2(1.0f); + float res = log2(1.0f); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/log2/902988.wgsl.expected.msl b/test/intrinsics/gen/log2/902988.wgsl.expected.msl index d7828e6df7..292fbeec2f 100644 --- a/test/intrinsics/gen/log2/902988.wgsl.expected.msl +++ b/test/intrinsics/gen/log2/902988.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void log2_902988() { - float4 res = log2(float4()); + float4 res = log2(float4()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/log2/adb233.wgsl.expected.msl b/test/intrinsics/gen/log2/adb233.wgsl.expected.msl index ee68aabbb2..7ccc7f4b96 100644 --- a/test/intrinsics/gen/log2/adb233.wgsl.expected.msl +++ b/test/intrinsics/gen/log2/adb233.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void log2_adb233() { - float3 res = log2(float3()); + float3 res = log2(float3()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/log2/aea659.wgsl.expected.msl b/test/intrinsics/gen/log2/aea659.wgsl.expected.msl index 4e44b11399..f603d99d38 100644 --- a/test/intrinsics/gen/log2/aea659.wgsl.expected.msl +++ b/test/intrinsics/gen/log2/aea659.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void log2_aea659() { - float2 res = log2(float2()); + float2 res = log2(float2()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/max/0c0aae.wgsl.expected.msl b/test/intrinsics/gen/max/0c0aae.wgsl.expected.msl index 9ebf54afed..2c07924fe9 100644 --- a/test/intrinsics/gen/max/0c0aae.wgsl.expected.msl +++ b/test/intrinsics/gen/max/0c0aae.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void max_0c0aae() { - uint res = max(1u, 1u); + uint res = max(1u, 1u); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/max/25eafe.wgsl.expected.msl b/test/intrinsics/gen/max/25eafe.wgsl.expected.msl index b8eca1d5de..ff0ddf54cf 100644 --- a/test/intrinsics/gen/max/25eafe.wgsl.expected.msl +++ b/test/intrinsics/gen/max/25eafe.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void max_25eafe() { - int3 res = max(int3(), int3()); + int3 res = max(int3(), int3()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/max/320815.wgsl.expected.msl b/test/intrinsics/gen/max/320815.wgsl.expected.msl index 9ecdcb9aaa..4a75eeac30 100644 --- a/test/intrinsics/gen/max/320815.wgsl.expected.msl +++ b/test/intrinsics/gen/max/320815.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void max_320815() { - uint2 res = max(uint2(), uint2()); + uint2 res = max(uint2(), uint2()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/max/44a39d.wgsl.expected.msl b/test/intrinsics/gen/max/44a39d.wgsl.expected.msl index ba3fcf1063..1ed60735fa 100644 --- a/test/intrinsics/gen/max/44a39d.wgsl.expected.msl +++ b/test/intrinsics/gen/max/44a39d.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void max_44a39d() { - float res = fmax(1.0f, 1.0f); + float res = fmax(1.0f, 1.0f); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/max/453e04.wgsl.expected.msl b/test/intrinsics/gen/max/453e04.wgsl.expected.msl index d8b12c678a..8d03301ab6 100644 --- a/test/intrinsics/gen/max/453e04.wgsl.expected.msl +++ b/test/intrinsics/gen/max/453e04.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void max_453e04() { - uint4 res = max(uint4(), uint4()); + uint4 res = max(uint4(), uint4()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/max/462050.wgsl.expected.msl b/test/intrinsics/gen/max/462050.wgsl.expected.msl index ef47fd2a21..be9f1c6ab6 100644 --- a/test/intrinsics/gen/max/462050.wgsl.expected.msl +++ b/test/intrinsics/gen/max/462050.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void max_462050() { - float2 res = fmax(float2(), float2()); + float2 res = fmax(float2(), float2()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/max/4883ac.wgsl.expected.msl b/test/intrinsics/gen/max/4883ac.wgsl.expected.msl index fc31548734..42a266f87f 100644 --- a/test/intrinsics/gen/max/4883ac.wgsl.expected.msl +++ b/test/intrinsics/gen/max/4883ac.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void max_4883ac() { - float3 res = fmax(float3(), float3()); + float3 res = fmax(float3(), float3()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/max/85e6bc.wgsl.expected.msl b/test/intrinsics/gen/max/85e6bc.wgsl.expected.msl index 8606e9ab3c..07283595ac 100644 --- a/test/intrinsics/gen/max/85e6bc.wgsl.expected.msl +++ b/test/intrinsics/gen/max/85e6bc.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void max_85e6bc() { - int4 res = max(int4(), int4()); + int4 res = max(int4(), int4()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/max/a93419.wgsl.expected.msl b/test/intrinsics/gen/max/a93419.wgsl.expected.msl index 056c4b870e..edf5f8497d 100644 --- a/test/intrinsics/gen/max/a93419.wgsl.expected.msl +++ b/test/intrinsics/gen/max/a93419.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void max_a93419() { - float4 res = fmax(float4(), float4()); + float4 res = fmax(float4(), float4()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/max/b1b73a.wgsl.expected.msl b/test/intrinsics/gen/max/b1b73a.wgsl.expected.msl index 3dfa68cc38..401b97fe59 100644 --- a/test/intrinsics/gen/max/b1b73a.wgsl.expected.msl +++ b/test/intrinsics/gen/max/b1b73a.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void max_b1b73a() { - uint3 res = max(uint3(), uint3()); + uint3 res = max(uint3(), uint3()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/max/ce7c30.wgsl.expected.msl b/test/intrinsics/gen/max/ce7c30.wgsl.expected.msl index 4f300ff005..041e1370e1 100644 --- a/test/intrinsics/gen/max/ce7c30.wgsl.expected.msl +++ b/test/intrinsics/gen/max/ce7c30.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void max_ce7c30() { - int res = max(1, 1); + int res = max(1, 1); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/max/e8192f.wgsl.expected.msl b/test/intrinsics/gen/max/e8192f.wgsl.expected.msl index e35eb468e3..5c158fa4e6 100644 --- a/test/intrinsics/gen/max/e8192f.wgsl.expected.msl +++ b/test/intrinsics/gen/max/e8192f.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void max_e8192f() { - int2 res = max(int2(), int2()); + int2 res = max(int2(), int2()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/min/03c7e3.wgsl.expected.msl b/test/intrinsics/gen/min/03c7e3.wgsl.expected.msl index 7ae789a2c7..0d570266fe 100644 --- a/test/intrinsics/gen/min/03c7e3.wgsl.expected.msl +++ b/test/intrinsics/gen/min/03c7e3.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void min_03c7e3() { - int2 res = min(int2(), int2()); + int2 res = min(int2(), int2()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/min/0dc614.wgsl.expected.msl b/test/intrinsics/gen/min/0dc614.wgsl.expected.msl index c50267db25..f179d772ea 100644 --- a/test/intrinsics/gen/min/0dc614.wgsl.expected.msl +++ b/test/intrinsics/gen/min/0dc614.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void min_0dc614() { - uint4 res = min(uint4(), uint4()); + uint4 res = min(uint4(), uint4()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/min/3941e1.wgsl.expected.msl b/test/intrinsics/gen/min/3941e1.wgsl.expected.msl index d7b455088e..cc0012f262 100644 --- a/test/intrinsics/gen/min/3941e1.wgsl.expected.msl +++ b/test/intrinsics/gen/min/3941e1.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void min_3941e1() { - int4 res = min(int4(), int4()); + int4 res = min(int4(), int4()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/min/46c5d3.wgsl.expected.msl b/test/intrinsics/gen/min/46c5d3.wgsl.expected.msl index 60276ceba2..5ab20e37f1 100644 --- a/test/intrinsics/gen/min/46c5d3.wgsl.expected.msl +++ b/test/intrinsics/gen/min/46c5d3.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void min_46c5d3() { - uint res = min(1u, 1u); + uint res = min(1u, 1u); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/min/82b28f.wgsl.expected.msl b/test/intrinsics/gen/min/82b28f.wgsl.expected.msl index 7bd80b5be6..5b2913c90b 100644 --- a/test/intrinsics/gen/min/82b28f.wgsl.expected.msl +++ b/test/intrinsics/gen/min/82b28f.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void min_82b28f() { - uint2 res = min(uint2(), uint2()); + uint2 res = min(uint2(), uint2()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/min/93cfc4.wgsl.expected.msl b/test/intrinsics/gen/min/93cfc4.wgsl.expected.msl index 97dc1cedc3..f102283ee0 100644 --- a/test/intrinsics/gen/min/93cfc4.wgsl.expected.msl +++ b/test/intrinsics/gen/min/93cfc4.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void min_93cfc4() { - float3 res = fmin(float3(), float3()); + float3 res = fmin(float3(), float3()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/min/a45171.wgsl.expected.msl b/test/intrinsics/gen/min/a45171.wgsl.expected.msl index 42a9bf78e6..3f9bfb1154 100644 --- a/test/intrinsics/gen/min/a45171.wgsl.expected.msl +++ b/test/intrinsics/gen/min/a45171.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void min_a45171() { - int3 res = min(int3(), int3()); + int3 res = min(int3(), int3()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/min/aa28ad.wgsl.expected.msl b/test/intrinsics/gen/min/aa28ad.wgsl.expected.msl index 7959144a2d..64cfee3050 100644 --- a/test/intrinsics/gen/min/aa28ad.wgsl.expected.msl +++ b/test/intrinsics/gen/min/aa28ad.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void min_aa28ad() { - float2 res = fmin(float2(), float2()); + float2 res = fmin(float2(), float2()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/min/af326d.wgsl.expected.msl b/test/intrinsics/gen/min/af326d.wgsl.expected.msl index d0e009b9ed..c8d4c23bc1 100644 --- a/test/intrinsics/gen/min/af326d.wgsl.expected.msl +++ b/test/intrinsics/gen/min/af326d.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void min_af326d() { - float res = fmin(1.0f, 1.0f); + float res = fmin(1.0f, 1.0f); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/min/c70bb7.wgsl.expected.msl b/test/intrinsics/gen/min/c70bb7.wgsl.expected.msl index 09c6b44a5b..c1968a2adf 100644 --- a/test/intrinsics/gen/min/c70bb7.wgsl.expected.msl +++ b/test/intrinsics/gen/min/c70bb7.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void min_c70bb7() { - uint3 res = min(uint3(), uint3()); + uint3 res = min(uint3(), uint3()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/min/c73147.wgsl.expected.msl b/test/intrinsics/gen/min/c73147.wgsl.expected.msl index 7ec0d477ba..45fd9b0275 100644 --- a/test/intrinsics/gen/min/c73147.wgsl.expected.msl +++ b/test/intrinsics/gen/min/c73147.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void min_c73147() { - int res = min(1, 1); + int res = min(1, 1); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/min/c76fa6.wgsl.expected.msl b/test/intrinsics/gen/min/c76fa6.wgsl.expected.msl index 015d645054..bed1dc61c1 100644 --- a/test/intrinsics/gen/min/c76fa6.wgsl.expected.msl +++ b/test/intrinsics/gen/min/c76fa6.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void min_c76fa6() { - float4 res = fmin(float4(), float4()); + float4 res = fmin(float4(), float4()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/mix/0c8c33.wgsl.expected.msl b/test/intrinsics/gen/mix/0c8c33.wgsl.expected.msl index 6cc23a6b13..2e50a7053d 100644 --- a/test/intrinsics/gen/mix/0c8c33.wgsl.expected.msl +++ b/test/intrinsics/gen/mix/0c8c33.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void mix_0c8c33() { - float3 res = mix(float3(), float3(), float3()); + float3 res = mix(float3(), float3(), float3()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/mix/4f0b5e.wgsl.expected.msl b/test/intrinsics/gen/mix/4f0b5e.wgsl.expected.msl index 9e549faa14..98d71211d7 100644 --- a/test/intrinsics/gen/mix/4f0b5e.wgsl.expected.msl +++ b/test/intrinsics/gen/mix/4f0b5e.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void mix_4f0b5e() { - float res = mix(1.0f, 1.0f, 1.0f); + float res = mix(1.0f, 1.0f, 1.0f); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/mix/6f8adc.wgsl.expected.msl b/test/intrinsics/gen/mix/6f8adc.wgsl.expected.msl index 34ac943d8e..d205533932 100644 --- a/test/intrinsics/gen/mix/6f8adc.wgsl.expected.msl +++ b/test/intrinsics/gen/mix/6f8adc.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void mix_6f8adc() { - float2 res = mix(float2(), float2(), float2()); + float2 res = mix(float2(), float2(), float2()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/mix/c37ede.wgsl.expected.msl b/test/intrinsics/gen/mix/c37ede.wgsl.expected.msl index 246ff75297..c4434f9db0 100644 --- a/test/intrinsics/gen/mix/c37ede.wgsl.expected.msl +++ b/test/intrinsics/gen/mix/c37ede.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void mix_c37ede() { - float4 res = mix(float4(), float4(), float4()); + float4 res = mix(float4(), float4(), float4()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/normalize/64d8c0.wgsl.expected.msl b/test/intrinsics/gen/normalize/64d8c0.wgsl.expected.msl index 39c646284a..3886bbd2ec 100644 --- a/test/intrinsics/gen/normalize/64d8c0.wgsl.expected.msl +++ b/test/intrinsics/gen/normalize/64d8c0.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void normalize_64d8c0() { - float3 res = normalize(float3()); + float3 res = normalize(float3()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/normalize/9a0aab.wgsl.expected.msl b/test/intrinsics/gen/normalize/9a0aab.wgsl.expected.msl index 2dc22f3929..85b933951c 100644 --- a/test/intrinsics/gen/normalize/9a0aab.wgsl.expected.msl +++ b/test/intrinsics/gen/normalize/9a0aab.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void normalize_9a0aab() { - float4 res = normalize(float4()); + float4 res = normalize(float4()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/normalize/fc2ef1.wgsl.expected.msl b/test/intrinsics/gen/normalize/fc2ef1.wgsl.expected.msl index 7e5afe0827..09c836c903 100644 --- a/test/intrinsics/gen/normalize/fc2ef1.wgsl.expected.msl +++ b/test/intrinsics/gen/normalize/fc2ef1.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void normalize_fc2ef1() { - float2 res = normalize(float2()); + float2 res = normalize(float2()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/pack2x16float/0e97b3.wgsl.expected.msl b/test/intrinsics/gen/pack2x16float/0e97b3.wgsl.expected.msl index 05f90db03b..eaf483e8cd 100644 --- a/test/intrinsics/gen/pack2x16float/0e97b3.wgsl.expected.msl +++ b/test/intrinsics/gen/pack2x16float/0e97b3.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void pack2x16float_0e97b3() { - uint res = as_type(half2(float2())); + uint res = as_type(half2(float2())); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/pack2x16snorm/6c169b.wgsl.expected.msl b/test/intrinsics/gen/pack2x16snorm/6c169b.wgsl.expected.msl index 7e91e3b390..8acd8d921e 100644 --- a/test/intrinsics/gen/pack2x16snorm/6c169b.wgsl.expected.msl +++ b/test/intrinsics/gen/pack2x16snorm/6c169b.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void pack2x16snorm_6c169b() { - uint res = pack_float_to_snorm2x16(float2()); + uint res = pack_float_to_snorm2x16(float2()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/pack2x16unorm/0f08e4.wgsl.expected.msl b/test/intrinsics/gen/pack2x16unorm/0f08e4.wgsl.expected.msl index 5f507aa756..0c21bdc9aa 100644 --- a/test/intrinsics/gen/pack2x16unorm/0f08e4.wgsl.expected.msl +++ b/test/intrinsics/gen/pack2x16unorm/0f08e4.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void pack2x16unorm_0f08e4() { - uint res = pack_float_to_unorm2x16(float2()); + uint res = pack_float_to_unorm2x16(float2()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/pack4x8snorm/4d22e7.wgsl.expected.msl b/test/intrinsics/gen/pack4x8snorm/4d22e7.wgsl.expected.msl index f4311c91a6..e07cd5d09d 100644 --- a/test/intrinsics/gen/pack4x8snorm/4d22e7.wgsl.expected.msl +++ b/test/intrinsics/gen/pack4x8snorm/4d22e7.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void pack4x8snorm_4d22e7() { - uint res = pack_float_to_snorm4x8(float4()); + uint res = pack_float_to_snorm4x8(float4()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/pack4x8unorm/95c456.wgsl.expected.msl b/test/intrinsics/gen/pack4x8unorm/95c456.wgsl.expected.msl index 6edb56f425..91aabb48ba 100644 --- a/test/intrinsics/gen/pack4x8unorm/95c456.wgsl.expected.msl +++ b/test/intrinsics/gen/pack4x8unorm/95c456.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void pack4x8unorm_95c456() { - uint res = pack_float_to_unorm4x8(float4()); + uint res = pack_float_to_unorm4x8(float4()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/pow/04a908.wgsl.expected.msl b/test/intrinsics/gen/pow/04a908.wgsl.expected.msl index 73909be9e6..90e90cdd4f 100644 --- a/test/intrinsics/gen/pow/04a908.wgsl.expected.msl +++ b/test/intrinsics/gen/pow/04a908.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void pow_04a908() { - float4 res = pow(float4(), float4()); + float4 res = pow(float4(), float4()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/pow/46e029.wgsl.expected.msl b/test/intrinsics/gen/pow/46e029.wgsl.expected.msl index d1bd4b930b..84e867b9e6 100644 --- a/test/intrinsics/gen/pow/46e029.wgsl.expected.msl +++ b/test/intrinsics/gen/pow/46e029.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void pow_46e029() { - float res = pow(1.0f, 1.0f); + float res = pow(1.0f, 1.0f); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/pow/4a46c9.wgsl.expected.msl b/test/intrinsics/gen/pow/4a46c9.wgsl.expected.msl index 6765ee73bd..caebacf9b9 100644 --- a/test/intrinsics/gen/pow/4a46c9.wgsl.expected.msl +++ b/test/intrinsics/gen/pow/4a46c9.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void pow_4a46c9() { - float3 res = pow(float3(), float3()); + float3 res = pow(float3(), float3()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/pow/e60ea5.wgsl.expected.msl b/test/intrinsics/gen/pow/e60ea5.wgsl.expected.msl index 7e1c6f7bd2..7bb9fc402f 100644 --- a/test/intrinsics/gen/pow/e60ea5.wgsl.expected.msl +++ b/test/intrinsics/gen/pow/e60ea5.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void pow_e60ea5() { - float2 res = pow(float2(), float2()); + float2 res = pow(float2(), float2()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/reflect/05357e.wgsl.expected.msl b/test/intrinsics/gen/reflect/05357e.wgsl.expected.msl index 10fb0cbb70..b61d634fc7 100644 --- a/test/intrinsics/gen/reflect/05357e.wgsl.expected.msl +++ b/test/intrinsics/gen/reflect/05357e.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void reflect_05357e() { - float4 res = reflect(float4(), float4()); + float4 res = reflect(float4(), float4()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/reflect/b61e10.wgsl.expected.msl b/test/intrinsics/gen/reflect/b61e10.wgsl.expected.msl index e8c412a955..c10208ddaf 100644 --- a/test/intrinsics/gen/reflect/b61e10.wgsl.expected.msl +++ b/test/intrinsics/gen/reflect/b61e10.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void reflect_b61e10() { - float2 res = reflect(float2(), float2()); + float2 res = reflect(float2(), float2()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/reflect/f47fdb.wgsl.expected.msl b/test/intrinsics/gen/reflect/f47fdb.wgsl.expected.msl index c0b9c40e1b..9032ecabf7 100644 --- a/test/intrinsics/gen/reflect/f47fdb.wgsl.expected.msl +++ b/test/intrinsics/gen/reflect/f47fdb.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void reflect_f47fdb() { - float3 res = reflect(float3(), float3()); + float3 res = reflect(float3(), float3()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/reverseBits/222177.wgsl.expected.msl b/test/intrinsics/gen/reverseBits/222177.wgsl.expected.msl index 210f3b392a..525e9d17f0 100644 --- a/test/intrinsics/gen/reverseBits/222177.wgsl.expected.msl +++ b/test/intrinsics/gen/reverseBits/222177.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void reverseBits_222177() { - int2 res = reverse_bits(int2()); + int2 res = reverse_bits(int2()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/reverseBits/35fea9.wgsl.expected.msl b/test/intrinsics/gen/reverseBits/35fea9.wgsl.expected.msl index 2d0b471cde..8aee00a970 100644 --- a/test/intrinsics/gen/reverseBits/35fea9.wgsl.expected.msl +++ b/test/intrinsics/gen/reverseBits/35fea9.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void reverseBits_35fea9() { - uint4 res = reverse_bits(uint4()); + uint4 res = reverse_bits(uint4()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/reverseBits/4dbd6f.wgsl.expected.msl b/test/intrinsics/gen/reverseBits/4dbd6f.wgsl.expected.msl index 5dde8a3cee..966cfe29f9 100644 --- a/test/intrinsics/gen/reverseBits/4dbd6f.wgsl.expected.msl +++ b/test/intrinsics/gen/reverseBits/4dbd6f.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void reverseBits_4dbd6f() { - int4 res = reverse_bits(int4()); + int4 res = reverse_bits(int4()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/reverseBits/7c4269.wgsl.expected.msl b/test/intrinsics/gen/reverseBits/7c4269.wgsl.expected.msl index 5621f10245..ed2c1db19b 100644 --- a/test/intrinsics/gen/reverseBits/7c4269.wgsl.expected.msl +++ b/test/intrinsics/gen/reverseBits/7c4269.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void reverseBits_7c4269() { - int res = reverse_bits(1); + int res = reverse_bits(1); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/reverseBits/a6ccd4.wgsl.expected.msl b/test/intrinsics/gen/reverseBits/a6ccd4.wgsl.expected.msl index 0158aed30c..72fbdb07e9 100644 --- a/test/intrinsics/gen/reverseBits/a6ccd4.wgsl.expected.msl +++ b/test/intrinsics/gen/reverseBits/a6ccd4.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void reverseBits_a6ccd4() { - uint3 res = reverse_bits(uint3()); + uint3 res = reverse_bits(uint3()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/reverseBits/c21bc1.wgsl.expected.msl b/test/intrinsics/gen/reverseBits/c21bc1.wgsl.expected.msl index b8623bc02b..442fcaecaa 100644 --- a/test/intrinsics/gen/reverseBits/c21bc1.wgsl.expected.msl +++ b/test/intrinsics/gen/reverseBits/c21bc1.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void reverseBits_c21bc1() { - int3 res = reverse_bits(int3()); + int3 res = reverse_bits(int3()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/reverseBits/e1f4c1.wgsl.expected.msl b/test/intrinsics/gen/reverseBits/e1f4c1.wgsl.expected.msl index ba544b784f..069f1d2b81 100644 --- a/test/intrinsics/gen/reverseBits/e1f4c1.wgsl.expected.msl +++ b/test/intrinsics/gen/reverseBits/e1f4c1.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void reverseBits_e1f4c1() { - uint2 res = reverse_bits(uint2()); + uint2 res = reverse_bits(uint2()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/reverseBits/e31adf.wgsl.expected.msl b/test/intrinsics/gen/reverseBits/e31adf.wgsl.expected.msl index bc9b4af0f8..14abcb8698 100644 --- a/test/intrinsics/gen/reverseBits/e31adf.wgsl.expected.msl +++ b/test/intrinsics/gen/reverseBits/e31adf.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void reverseBits_e31adf() { - uint res = reverse_bits(1u); + uint res = reverse_bits(1u); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/round/106c0b.wgsl.expected.msl b/test/intrinsics/gen/round/106c0b.wgsl.expected.msl index 2ae782a9c5..280de5dedf 100644 --- a/test/intrinsics/gen/round/106c0b.wgsl.expected.msl +++ b/test/intrinsics/gen/round/106c0b.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void round_106c0b() { - float4 res = rint(float4()); + float4 res = rint(float4()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/round/1c7897.wgsl.expected.msl b/test/intrinsics/gen/round/1c7897.wgsl.expected.msl index 608a2febfa..d9c7757885 100644 --- a/test/intrinsics/gen/round/1c7897.wgsl.expected.msl +++ b/test/intrinsics/gen/round/1c7897.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void round_1c7897() { - float3 res = rint(float3()); + float3 res = rint(float3()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/round/52c84d.wgsl.expected.msl b/test/intrinsics/gen/round/52c84d.wgsl.expected.msl index b9fc56f903..06d2683233 100644 --- a/test/intrinsics/gen/round/52c84d.wgsl.expected.msl +++ b/test/intrinsics/gen/round/52c84d.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void round_52c84d() { - float2 res = rint(float2()); + float2 res = rint(float2()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/round/9edc38.wgsl.expected.msl b/test/intrinsics/gen/round/9edc38.wgsl.expected.msl index 0361b2294d..f970449e5d 100644 --- a/test/intrinsics/gen/round/9edc38.wgsl.expected.msl +++ b/test/intrinsics/gen/round/9edc38.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void round_9edc38() { - float res = rint(1.0f); + float res = rint(1.0f); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/select/00b848.wgsl.expected.msl b/test/intrinsics/gen/select/00b848.wgsl.expected.msl index 2b431a8aaa..4541cbd679 100644 --- a/test/intrinsics/gen/select/00b848.wgsl.expected.msl +++ b/test/intrinsics/gen/select/00b848.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void select_00b848() { - int2 res = select(int2(), int2(), bool2()); + int2 res = select(int2(), int2(), bool2()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/select/01e2cd.wgsl.expected.msl b/test/intrinsics/gen/select/01e2cd.wgsl.expected.msl index 9f29574b79..57e3844b10 100644 --- a/test/intrinsics/gen/select/01e2cd.wgsl.expected.msl +++ b/test/intrinsics/gen/select/01e2cd.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void select_01e2cd() { - int3 res = select(int3(), int3(), bool3()); + int3 res = select(int3(), int3(), bool3()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/select/1e960b.wgsl.expected.msl b/test/intrinsics/gen/select/1e960b.wgsl.expected.msl index 172ac62b47..ed4c2d6ab3 100644 --- a/test/intrinsics/gen/select/1e960b.wgsl.expected.msl +++ b/test/intrinsics/gen/select/1e960b.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void select_1e960b() { - uint2 res = select(uint2(), uint2(), bool2()); + uint2 res = select(uint2(), uint2(), bool2()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/select/266aff.wgsl.expected.msl b/test/intrinsics/gen/select/266aff.wgsl.expected.msl index 347ac2799a..167dca32f1 100644 --- a/test/intrinsics/gen/select/266aff.wgsl.expected.msl +++ b/test/intrinsics/gen/select/266aff.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void select_266aff() { - float2 res = select(float2(), float2(), bool2()); + float2 res = select(float2(), float2(), bool2()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/select/28a27e.wgsl.expected.msl b/test/intrinsics/gen/select/28a27e.wgsl.expected.msl index 667c9a1b34..813376f0e2 100644 --- a/test/intrinsics/gen/select/28a27e.wgsl.expected.msl +++ b/test/intrinsics/gen/select/28a27e.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void select_28a27e() { - uint3 res = select(uint3(), uint3(), bool3()); + uint3 res = select(uint3(), uint3(), bool3()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/select/416e14.wgsl.expected.msl b/test/intrinsics/gen/select/416e14.wgsl.expected.msl index 85cd25a094..728f9e1f1c 100644 --- a/test/intrinsics/gen/select/416e14.wgsl.expected.msl +++ b/test/intrinsics/gen/select/416e14.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void select_416e14() { - float res = select(1.0f, 1.0f, bool()); + float res = select(1.0f, 1.0f, bool()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/select/80a9a9.wgsl.expected.msl b/test/intrinsics/gen/select/80a9a9.wgsl.expected.msl index 3aff43ff29..0e8e4b90ab 100644 --- a/test/intrinsics/gen/select/80a9a9.wgsl.expected.msl +++ b/test/intrinsics/gen/select/80a9a9.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void select_80a9a9() { - bool3 res = select(bool3(), bool3(), bool3()); + bool3 res = select(bool3(), bool3(), bool3()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/select/99f883.wgsl.expected.msl b/test/intrinsics/gen/select/99f883.wgsl.expected.msl index 45e38cfacc..fde3d24f41 100644 --- a/test/intrinsics/gen/select/99f883.wgsl.expected.msl +++ b/test/intrinsics/gen/select/99f883.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void select_99f883() { - uint res = select(1u, 1u, bool()); + uint res = select(1u, 1u, bool()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/select/a2860e.wgsl.expected.msl b/test/intrinsics/gen/select/a2860e.wgsl.expected.msl index d57b00af2c..992519dc32 100644 --- a/test/intrinsics/gen/select/a2860e.wgsl.expected.msl +++ b/test/intrinsics/gen/select/a2860e.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void select_a2860e() { - int4 res = select(int4(), int4(), bool4()); + int4 res = select(int4(), int4(), bool4()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/select/bb8aae.wgsl.expected.msl b/test/intrinsics/gen/select/bb8aae.wgsl.expected.msl index 0ac6179c82..23ef980de5 100644 --- a/test/intrinsics/gen/select/bb8aae.wgsl.expected.msl +++ b/test/intrinsics/gen/select/bb8aae.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void select_bb8aae() { - float4 res = select(float4(), float4(), bool4()); + float4 res = select(float4(), float4(), bool4()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/select/c31f9e.wgsl.expected.msl b/test/intrinsics/gen/select/c31f9e.wgsl.expected.msl index 21695bd673..f348bbb5e5 100644 --- a/test/intrinsics/gen/select/c31f9e.wgsl.expected.msl +++ b/test/intrinsics/gen/select/c31f9e.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void select_c31f9e() { - bool res = select(bool(), bool(), bool()); + bool res = select(bool(), bool(), bool()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/select/c4a4ef.wgsl.expected.msl b/test/intrinsics/gen/select/c4a4ef.wgsl.expected.msl index eb6e007c58..5de96a5217 100644 --- a/test/intrinsics/gen/select/c4a4ef.wgsl.expected.msl +++ b/test/intrinsics/gen/select/c4a4ef.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void select_c4a4ef() { - uint4 res = select(uint4(), uint4(), bool4()); + uint4 res = select(uint4(), uint4(), bool4()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/select/cb9301.wgsl.expected.msl b/test/intrinsics/gen/select/cb9301.wgsl.expected.msl index 846a79f5c0..975962fa67 100644 --- a/test/intrinsics/gen/select/cb9301.wgsl.expected.msl +++ b/test/intrinsics/gen/select/cb9301.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void select_cb9301() { - bool2 res = select(bool2(), bool2(), bool2()); + bool2 res = select(bool2(), bool2(), bool2()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/select/e3e028.wgsl.expected.msl b/test/intrinsics/gen/select/e3e028.wgsl.expected.msl index a1f57f6db2..659778ea88 100644 --- a/test/intrinsics/gen/select/e3e028.wgsl.expected.msl +++ b/test/intrinsics/gen/select/e3e028.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void select_e3e028() { - bool4 res = select(bool4(), bool4(), bool4()); + bool4 res = select(bool4(), bool4(), bool4()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/select/ebfea2.wgsl.expected.msl b/test/intrinsics/gen/select/ebfea2.wgsl.expected.msl index 81db84cc9c..a4c6a1386e 100644 --- a/test/intrinsics/gen/select/ebfea2.wgsl.expected.msl +++ b/test/intrinsics/gen/select/ebfea2.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void select_ebfea2() { - float3 res = select(float3(), float3(), bool3()); + float3 res = select(float3(), float3(), bool3()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/select/ed8a15.wgsl.expected.msl b/test/intrinsics/gen/select/ed8a15.wgsl.expected.msl index 2c84ce4fb8..e2ec08eacc 100644 --- a/test/intrinsics/gen/select/ed8a15.wgsl.expected.msl +++ b/test/intrinsics/gen/select/ed8a15.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void select_ed8a15() { - int res = select(1, 1, bool()); + int res = select(1, 1, bool()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/sign/159665.wgsl.expected.msl b/test/intrinsics/gen/sign/159665.wgsl.expected.msl index 9a0fcb01a3..63ef07d823 100644 --- a/test/intrinsics/gen/sign/159665.wgsl.expected.msl +++ b/test/intrinsics/gen/sign/159665.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void sign_159665() { - float3 res = sign(float3()); + float3 res = sign(float3()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/sign/b8f634.wgsl.expected.msl b/test/intrinsics/gen/sign/b8f634.wgsl.expected.msl index b13803aea9..ede912796a 100644 --- a/test/intrinsics/gen/sign/b8f634.wgsl.expected.msl +++ b/test/intrinsics/gen/sign/b8f634.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void sign_b8f634() { - float4 res = sign(float4()); + float4 res = sign(float4()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/sign/d065d8.wgsl.expected.msl b/test/intrinsics/gen/sign/d065d8.wgsl.expected.msl index dc48e611fa..dfe0aa945d 100644 --- a/test/intrinsics/gen/sign/d065d8.wgsl.expected.msl +++ b/test/intrinsics/gen/sign/d065d8.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void sign_d065d8() { - float2 res = sign(float2()); + float2 res = sign(float2()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/sign/dd790e.wgsl.expected.msl b/test/intrinsics/gen/sign/dd790e.wgsl.expected.msl index b77013acbc..756a81278a 100644 --- a/test/intrinsics/gen/sign/dd790e.wgsl.expected.msl +++ b/test/intrinsics/gen/sign/dd790e.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void sign_dd790e() { - float res = sign(1.0f); + float res = sign(1.0f); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/sin/01f241.wgsl.expected.msl b/test/intrinsics/gen/sin/01f241.wgsl.expected.msl index 72d06c0477..656086c6d4 100644 --- a/test/intrinsics/gen/sin/01f241.wgsl.expected.msl +++ b/test/intrinsics/gen/sin/01f241.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void sin_01f241() { - float3 res = sin(float3()); + float3 res = sin(float3()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/sin/4e3979.wgsl.expected.msl b/test/intrinsics/gen/sin/4e3979.wgsl.expected.msl index 8490349a9d..fbce7644da 100644 --- a/test/intrinsics/gen/sin/4e3979.wgsl.expected.msl +++ b/test/intrinsics/gen/sin/4e3979.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void sin_4e3979() { - float4 res = sin(float4()); + float4 res = sin(float4()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/sin/b78c91.wgsl.expected.msl b/test/intrinsics/gen/sin/b78c91.wgsl.expected.msl index b3564835dd..2b5020fa5a 100644 --- a/test/intrinsics/gen/sin/b78c91.wgsl.expected.msl +++ b/test/intrinsics/gen/sin/b78c91.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void sin_b78c91() { - float res = sin(1.0f); + float res = sin(1.0f); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/sin/fc8bc4.wgsl.expected.msl b/test/intrinsics/gen/sin/fc8bc4.wgsl.expected.msl index e66435a28e..63129b82cd 100644 --- a/test/intrinsics/gen/sin/fc8bc4.wgsl.expected.msl +++ b/test/intrinsics/gen/sin/fc8bc4.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void sin_fc8bc4() { - float2 res = sin(float2()); + float2 res = sin(float2()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/sinh/445e33.wgsl.expected.msl b/test/intrinsics/gen/sinh/445e33.wgsl.expected.msl index aa9548284c..78d2be043b 100644 --- a/test/intrinsics/gen/sinh/445e33.wgsl.expected.msl +++ b/test/intrinsics/gen/sinh/445e33.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void sinh_445e33() { - float4 res = sinh(float4()); + float4 res = sinh(float4()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/sinh/7bb598.wgsl.expected.msl b/test/intrinsics/gen/sinh/7bb598.wgsl.expected.msl index e6c5990863..79ca78da5a 100644 --- a/test/intrinsics/gen/sinh/7bb598.wgsl.expected.msl +++ b/test/intrinsics/gen/sinh/7bb598.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void sinh_7bb598() { - float res = sinh(1.0f); + float res = sinh(1.0f); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/sinh/b9860e.wgsl.expected.msl b/test/intrinsics/gen/sinh/b9860e.wgsl.expected.msl index 5bc5bc4c1c..2122b1801d 100644 --- a/test/intrinsics/gen/sinh/b9860e.wgsl.expected.msl +++ b/test/intrinsics/gen/sinh/b9860e.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void sinh_b9860e() { - float2 res = sinh(float2()); + float2 res = sinh(float2()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/sinh/c9a5eb.wgsl.expected.msl b/test/intrinsics/gen/sinh/c9a5eb.wgsl.expected.msl index 05558c73ad..27475f4207 100644 --- a/test/intrinsics/gen/sinh/c9a5eb.wgsl.expected.msl +++ b/test/intrinsics/gen/sinh/c9a5eb.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void sinh_c9a5eb() { - float3 res = sinh(float3()); + float3 res = sinh(float3()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/smoothStep/5f615b.wgsl.expected.msl b/test/intrinsics/gen/smoothStep/5f615b.wgsl.expected.msl index 22a3ab7944..8ab52a30b5 100644 --- a/test/intrinsics/gen/smoothStep/5f615b.wgsl.expected.msl +++ b/test/intrinsics/gen/smoothStep/5f615b.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void smoothStep_5f615b() { - float4 res = smoothstep(float4(), float4(), float4()); + float4 res = smoothstep(float4(), float4(), float4()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/smoothStep/658be3.wgsl.expected.msl b/test/intrinsics/gen/smoothStep/658be3.wgsl.expected.msl index 42d4a3ac03..097061cfbf 100644 --- a/test/intrinsics/gen/smoothStep/658be3.wgsl.expected.msl +++ b/test/intrinsics/gen/smoothStep/658be3.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void smoothStep_658be3() { - float3 res = smoothstep(float3(), float3(), float3()); + float3 res = smoothstep(float3(), float3(), float3()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/smoothStep/c11eef.wgsl.expected.msl b/test/intrinsics/gen/smoothStep/c11eef.wgsl.expected.msl index 7788c35041..2d1f4a400d 100644 --- a/test/intrinsics/gen/smoothStep/c11eef.wgsl.expected.msl +++ b/test/intrinsics/gen/smoothStep/c11eef.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void smoothStep_c11eef() { - float2 res = smoothstep(float2(), float2(), float2()); + float2 res = smoothstep(float2(), float2(), float2()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/smoothStep/cb0bfb.wgsl.expected.msl b/test/intrinsics/gen/smoothStep/cb0bfb.wgsl.expected.msl index f963d98678..dda677caa3 100644 --- a/test/intrinsics/gen/smoothStep/cb0bfb.wgsl.expected.msl +++ b/test/intrinsics/gen/smoothStep/cb0bfb.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void smoothStep_cb0bfb() { - float res = smoothstep(1.0f, 1.0f, 1.0f); + float res = smoothstep(1.0f, 1.0f, 1.0f); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/sqrt/20c74e.wgsl.expected.msl b/test/intrinsics/gen/sqrt/20c74e.wgsl.expected.msl index ebe9cc5e61..c8dff4ad9f 100644 --- a/test/intrinsics/gen/sqrt/20c74e.wgsl.expected.msl +++ b/test/intrinsics/gen/sqrt/20c74e.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void sqrt_20c74e() { - float res = sqrt(1.0f); + float res = sqrt(1.0f); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/sqrt/8c7024.wgsl.expected.msl b/test/intrinsics/gen/sqrt/8c7024.wgsl.expected.msl index c6e76d03b0..f36c0bca4e 100644 --- a/test/intrinsics/gen/sqrt/8c7024.wgsl.expected.msl +++ b/test/intrinsics/gen/sqrt/8c7024.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void sqrt_8c7024() { - float2 res = sqrt(float2()); + float2 res = sqrt(float2()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/sqrt/aa0d7a.wgsl.expected.msl b/test/intrinsics/gen/sqrt/aa0d7a.wgsl.expected.msl index 7de1194bf3..d0b0a614dc 100644 --- a/test/intrinsics/gen/sqrt/aa0d7a.wgsl.expected.msl +++ b/test/intrinsics/gen/sqrt/aa0d7a.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void sqrt_aa0d7a() { - float4 res = sqrt(float4()); + float4 res = sqrt(float4()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/sqrt/f8c59a.wgsl.expected.msl b/test/intrinsics/gen/sqrt/f8c59a.wgsl.expected.msl index a0281f7b75..b39cb0ce53 100644 --- a/test/intrinsics/gen/sqrt/f8c59a.wgsl.expected.msl +++ b/test/intrinsics/gen/sqrt/f8c59a.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void sqrt_f8c59a() { - float3 res = sqrt(float3()); + float3 res = sqrt(float3()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/step/0b073b.wgsl.expected.msl b/test/intrinsics/gen/step/0b073b.wgsl.expected.msl index 0a76b20d41..b5d5d028c5 100644 --- a/test/intrinsics/gen/step/0b073b.wgsl.expected.msl +++ b/test/intrinsics/gen/step/0b073b.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void step_0b073b() { - float res = step(1.0f, 1.0f); + float res = step(1.0f, 1.0f); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/step/19accd.wgsl.expected.msl b/test/intrinsics/gen/step/19accd.wgsl.expected.msl index a26cee555b..51c0088565 100644 --- a/test/intrinsics/gen/step/19accd.wgsl.expected.msl +++ b/test/intrinsics/gen/step/19accd.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void step_19accd() { - float2 res = step(float2(), float2()); + float2 res = step(float2(), float2()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/step/334303.wgsl.expected.msl b/test/intrinsics/gen/step/334303.wgsl.expected.msl index 8594bfcb7a..82916a6c7a 100644 --- a/test/intrinsics/gen/step/334303.wgsl.expected.msl +++ b/test/intrinsics/gen/step/334303.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void step_334303() { - float3 res = step(float3(), float3()); + float3 res = step(float3(), float3()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/step/e2b337.wgsl.expected.msl b/test/intrinsics/gen/step/e2b337.wgsl.expected.msl index d35db64bef..cb536dbbfe 100644 --- a/test/intrinsics/gen/step/e2b337.wgsl.expected.msl +++ b/test/intrinsics/gen/step/e2b337.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void step_e2b337() { - float4 res = step(float4(), float4()); + float4 res = step(float4(), float4()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/storageBarrier/d87211.wgsl.expected.msl b/test/intrinsics/gen/storageBarrier/d87211.wgsl.expected.msl index daafd40a2b..53da7477a2 100644 --- a/test/intrinsics/gen/storageBarrier/d87211.wgsl.expected.msl +++ b/test/intrinsics/gen/storageBarrier/d87211.wgsl.expected.msl @@ -2,7 +2,7 @@ using namespace metal; void storageBarrier_d87211() { - threadgroup_barrier(mem_flags::mem_device); + threadgroup_barrier(mem_flags::mem_device); } kernel void compute_main() { diff --git a/test/intrinsics/gen/tan/244e2a.wgsl.expected.msl b/test/intrinsics/gen/tan/244e2a.wgsl.expected.msl index 71c4d77e10..d1b34a4a84 100644 --- a/test/intrinsics/gen/tan/244e2a.wgsl.expected.msl +++ b/test/intrinsics/gen/tan/244e2a.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void tan_244e2a() { - float4 res = tan(float4()); + float4 res = tan(float4()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/tan/2f030e.wgsl.expected.msl b/test/intrinsics/gen/tan/2f030e.wgsl.expected.msl index 10fd660866..81c0766561 100644 --- a/test/intrinsics/gen/tan/2f030e.wgsl.expected.msl +++ b/test/intrinsics/gen/tan/2f030e.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void tan_2f030e() { - float res = tan(1.0f); + float res = tan(1.0f); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/tan/7ea104.wgsl.expected.msl b/test/intrinsics/gen/tan/7ea104.wgsl.expected.msl index f4ef8364eb..89db1ac6fd 100644 --- a/test/intrinsics/gen/tan/7ea104.wgsl.expected.msl +++ b/test/intrinsics/gen/tan/7ea104.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void tan_7ea104() { - float3 res = tan(float3()); + float3 res = tan(float3()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/tan/8ce3e9.wgsl.expected.msl b/test/intrinsics/gen/tan/8ce3e9.wgsl.expected.msl index 89bfdfe871..e460fae70d 100644 --- a/test/intrinsics/gen/tan/8ce3e9.wgsl.expected.msl +++ b/test/intrinsics/gen/tan/8ce3e9.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void tan_8ce3e9() { - float2 res = tan(float2()); + float2 res = tan(float2()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/tanh/5663c5.wgsl.expected.msl b/test/intrinsics/gen/tanh/5663c5.wgsl.expected.msl index 421d1a1635..5a82feb162 100644 --- a/test/intrinsics/gen/tanh/5663c5.wgsl.expected.msl +++ b/test/intrinsics/gen/tanh/5663c5.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void tanh_5663c5() { - float4 res = tanh(float4()); + float4 res = tanh(float4()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/tanh/5724b3.wgsl.expected.msl b/test/intrinsics/gen/tanh/5724b3.wgsl.expected.msl index 90440dac9f..878775fc02 100644 --- a/test/intrinsics/gen/tanh/5724b3.wgsl.expected.msl +++ b/test/intrinsics/gen/tanh/5724b3.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void tanh_5724b3() { - float2 res = tanh(float2()); + float2 res = tanh(float2()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/tanh/9f9fb9.wgsl.expected.msl b/test/intrinsics/gen/tanh/9f9fb9.wgsl.expected.msl index 9e0039be83..b93aca0bfd 100644 --- a/test/intrinsics/gen/tanh/9f9fb9.wgsl.expected.msl +++ b/test/intrinsics/gen/tanh/9f9fb9.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void tanh_9f9fb9() { - float3 res = tanh(float3()); + float3 res = tanh(float3()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/tanh/c15fdb.wgsl.expected.msl b/test/intrinsics/gen/tanh/c15fdb.wgsl.expected.msl index 31287f648b..be4a4b65e0 100644 --- a/test/intrinsics/gen/tanh/c15fdb.wgsl.expected.msl +++ b/test/intrinsics/gen/tanh/c15fdb.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void tanh_c15fdb() { - float res = tanh(1.0f); + float res = tanh(1.0f); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/transpose/2585cd.wgsl.expected.msl b/test/intrinsics/gen/transpose/2585cd.wgsl.expected.msl index 4ee05b0388..6ae1bbd28d 100644 --- a/test/intrinsics/gen/transpose/2585cd.wgsl.expected.msl +++ b/test/intrinsics/gen/transpose/2585cd.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void transpose_2585cd() { - float3x4 res = transpose(float4x3()); + float3x4 res = transpose(float4x3()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/transpose/31d679.wgsl.expected.msl b/test/intrinsics/gen/transpose/31d679.wgsl.expected.msl index 83a7f1650b..f76b6eba48 100644 --- a/test/intrinsics/gen/transpose/31d679.wgsl.expected.msl +++ b/test/intrinsics/gen/transpose/31d679.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void transpose_31d679() { - float2x2 res = transpose(float2x2()); + float2x2 res = transpose(float2x2()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/transpose/31e37e.wgsl.expected.msl b/test/intrinsics/gen/transpose/31e37e.wgsl.expected.msl index 8dad9cdeb2..6549c6053f 100644 --- a/test/intrinsics/gen/transpose/31e37e.wgsl.expected.msl +++ b/test/intrinsics/gen/transpose/31e37e.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void transpose_31e37e() { - float2x4 res = transpose(float4x2()); + float2x4 res = transpose(float4x2()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/transpose/4ce359.wgsl.expected.msl b/test/intrinsics/gen/transpose/4ce359.wgsl.expected.msl index 56e2901f8f..82ad61fb2e 100644 --- a/test/intrinsics/gen/transpose/4ce359.wgsl.expected.msl +++ b/test/intrinsics/gen/transpose/4ce359.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void transpose_4ce359() { - float4x2 res = transpose(float2x4()); + float4x2 res = transpose(float2x4()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/transpose/4dc9a1.wgsl.expected.msl b/test/intrinsics/gen/transpose/4dc9a1.wgsl.expected.msl index d152f3c047..856b2ccc36 100644 --- a/test/intrinsics/gen/transpose/4dc9a1.wgsl.expected.msl +++ b/test/intrinsics/gen/transpose/4dc9a1.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void transpose_4dc9a1() { - float3x2 res = transpose(float2x3()); + float3x2 res = transpose(float2x3()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/transpose/854336.wgsl.expected.msl b/test/intrinsics/gen/transpose/854336.wgsl.expected.msl index 66006f0d12..11184d7922 100644 --- a/test/intrinsics/gen/transpose/854336.wgsl.expected.msl +++ b/test/intrinsics/gen/transpose/854336.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void transpose_854336() { - float3x3 res = transpose(float3x3()); + float3x3 res = transpose(float3x3()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/transpose/c1b600.wgsl.expected.msl b/test/intrinsics/gen/transpose/c1b600.wgsl.expected.msl index 0a3a993133..59920dca8a 100644 --- a/test/intrinsics/gen/transpose/c1b600.wgsl.expected.msl +++ b/test/intrinsics/gen/transpose/c1b600.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void transpose_c1b600() { - float4x4 res = transpose(float4x4()); + float4x4 res = transpose(float4x4()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/transpose/d8f8ba.wgsl.expected.msl b/test/intrinsics/gen/transpose/d8f8ba.wgsl.expected.msl index ff3a0b9dce..98f2384b41 100644 --- a/test/intrinsics/gen/transpose/d8f8ba.wgsl.expected.msl +++ b/test/intrinsics/gen/transpose/d8f8ba.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void transpose_d8f8ba() { - float4x3 res = transpose(float3x4()); + float4x3 res = transpose(float3x4()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/transpose/ed4bdc.wgsl.expected.msl b/test/intrinsics/gen/transpose/ed4bdc.wgsl.expected.msl index 87823dbaf8..4fdec15767 100644 --- a/test/intrinsics/gen/transpose/ed4bdc.wgsl.expected.msl +++ b/test/intrinsics/gen/transpose/ed4bdc.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void transpose_ed4bdc() { - float2x3 res = transpose(float3x2()); + float2x3 res = transpose(float3x2()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/trunc/562d05.wgsl.expected.msl b/test/intrinsics/gen/trunc/562d05.wgsl.expected.msl index 061a926b82..062cae497c 100644 --- a/test/intrinsics/gen/trunc/562d05.wgsl.expected.msl +++ b/test/intrinsics/gen/trunc/562d05.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void trunc_562d05() { - float3 res = trunc(float3()); + float3 res = trunc(float3()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/trunc/e183aa.wgsl.expected.msl b/test/intrinsics/gen/trunc/e183aa.wgsl.expected.msl index 484423549c..847cb9d741 100644 --- a/test/intrinsics/gen/trunc/e183aa.wgsl.expected.msl +++ b/test/intrinsics/gen/trunc/e183aa.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void trunc_e183aa() { - float4 res = trunc(float4()); + float4 res = trunc(float4()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/trunc/eb83df.wgsl.expected.msl b/test/intrinsics/gen/trunc/eb83df.wgsl.expected.msl index 4e8c7ac560..e9b0df0e6c 100644 --- a/test/intrinsics/gen/trunc/eb83df.wgsl.expected.msl +++ b/test/intrinsics/gen/trunc/eb83df.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void trunc_eb83df() { - float res = trunc(1.0f); + float res = trunc(1.0f); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/trunc/f370d3.wgsl.expected.msl b/test/intrinsics/gen/trunc/f370d3.wgsl.expected.msl index 2b58e71e7c..34e6620db2 100644 --- a/test/intrinsics/gen/trunc/f370d3.wgsl.expected.msl +++ b/test/intrinsics/gen/trunc/f370d3.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void trunc_f370d3() { - float2 res = trunc(float2()); + float2 res = trunc(float2()); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/unpack2x16float/32a5cf.wgsl.expected.msl b/test/intrinsics/gen/unpack2x16float/32a5cf.wgsl.expected.msl index 210f23e8d9..e5746f1224 100644 --- a/test/intrinsics/gen/unpack2x16float/32a5cf.wgsl.expected.msl +++ b/test/intrinsics/gen/unpack2x16float/32a5cf.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void unpack2x16float_32a5cf() { - float2 res = float2(as_type(1u)); + float2 res = float2(as_type(1u)); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/unpack2x16snorm/b4aea6.wgsl.expected.msl b/test/intrinsics/gen/unpack2x16snorm/b4aea6.wgsl.expected.msl index 2795c378fd..2374a87602 100644 --- a/test/intrinsics/gen/unpack2x16snorm/b4aea6.wgsl.expected.msl +++ b/test/intrinsics/gen/unpack2x16snorm/b4aea6.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void unpack2x16snorm_b4aea6() { - float2 res = unpack_snorm2x16_to_float(1u); + float2 res = unpack_snorm2x16_to_float(1u); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/unpack2x16unorm/7699c0.wgsl.expected.msl b/test/intrinsics/gen/unpack2x16unorm/7699c0.wgsl.expected.msl index 706b45e22e..45815ca491 100644 --- a/test/intrinsics/gen/unpack2x16unorm/7699c0.wgsl.expected.msl +++ b/test/intrinsics/gen/unpack2x16unorm/7699c0.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void unpack2x16unorm_7699c0() { - float2 res = unpack_unorm2x16_to_float(1u); + float2 res = unpack_unorm2x16_to_float(1u); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/unpack4x8snorm/523fb3.wgsl.expected.msl b/test/intrinsics/gen/unpack4x8snorm/523fb3.wgsl.expected.msl index af4fb45ff5..06cc514180 100644 --- a/test/intrinsics/gen/unpack4x8snorm/523fb3.wgsl.expected.msl +++ b/test/intrinsics/gen/unpack4x8snorm/523fb3.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void unpack4x8snorm_523fb3() { - float4 res = unpack_snorm4x8_to_float(1u); + float4 res = unpack_snorm4x8_to_float(1u); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/unpack4x8unorm/750c74.wgsl.expected.msl b/test/intrinsics/gen/unpack4x8unorm/750c74.wgsl.expected.msl index 5c4da0d306..e6226c8009 100644 --- a/test/intrinsics/gen/unpack4x8unorm/750c74.wgsl.expected.msl +++ b/test/intrinsics/gen/unpack4x8unorm/750c74.wgsl.expected.msl @@ -6,7 +6,7 @@ struct tint_symbol { }; void unpack4x8unorm_750c74() { - float4 res = unpack_unorm4x8_to_float(1u); + float4 res = unpack_unorm4x8_to_float(1u); } vertex tint_symbol vertex_main() { diff --git a/test/intrinsics/gen/workgroupBarrier/a17f7f.wgsl.expected.msl b/test/intrinsics/gen/workgroupBarrier/a17f7f.wgsl.expected.msl index a3dcb47c00..ed5ed22355 100644 --- a/test/intrinsics/gen/workgroupBarrier/a17f7f.wgsl.expected.msl +++ b/test/intrinsics/gen/workgroupBarrier/a17f7f.wgsl.expected.msl @@ -2,7 +2,7 @@ using namespace metal; void workgroupBarrier_a17f7f() { - threadgroup_barrier(mem_flags::mem_threadgroup); + threadgroup_barrier(mem_flags::mem_threadgroup); } kernel void compute_main() { diff --git a/test/ptr_ref/load/local/ptr_workgroup.wgsl.expected.msl b/test/ptr_ref/load/local/ptr_workgroup.wgsl.expected.msl index 124f375918..f8f90317d4 100644 --- a/test/ptr_ref/load/local/ptr_workgroup.wgsl.expected.msl +++ b/test/ptr_ref/load/local/ptr_workgroup.wgsl.expected.msl @@ -6,7 +6,7 @@ kernel void tint_symbol(uint local_invocation_index [[thread_index_in_threadgrou if ((local_invocation_index == 0u)) { tint_symbol_2 = int(); } - threadgroup_barrier(mem_flags::mem_threadgroup); + threadgroup_barrier(mem_flags::mem_threadgroup); tint_symbol_2 = 123; int const use = (tint_symbol_2 + 1); return; diff --git a/test/samples/compute_boids.wgsl.expected.msl b/test/samples/compute_boids.wgsl.expected.msl index f0a1ab8dc0..dae2f1f66f 100644 --- a/test/samples/compute_boids.wgsl.expected.msl +++ b/test/samples/compute_boids.wgsl.expected.msl @@ -36,8 +36,8 @@ vertex tint_symbol_2 vert_main(tint_symbol_1 tint_symbol [[stage_in]]) { float2 const a_particlePos = tint_symbol.a_particlePos; float2 const a_particleVel = tint_symbol.a_particleVel; float2 const a_pos = tint_symbol.a_pos; - float angle = -( atan2(a_particleVel.x, a_particleVel.y)); - float2 pos = float2(((a_pos.x * cos(angle)) - (a_pos.y * sin(angle))), ((a_pos.x * sin(angle)) + (a_pos.y * cos(angle)))); + float angle = -(atan2(a_particleVel.x, a_particleVel.y)); + float2 pos = float2(((a_pos.x * cos(angle)) - (a_pos.y * sin(angle))), ((a_pos.x * sin(angle)) + (a_pos.y * cos(angle)))); tint_symbol_2 const tint_symbol_5 = {.value=float4((pos + a_particlePos), 0.0f, 1.0f)}; return tint_symbol_5; } @@ -75,14 +75,14 @@ kernel void comp_main(uint3 gl_GlobalInvocationID [[thread_position_in_grid]], c } pos = particlesA.particles.arr[i].pos.xy; vel = particlesA.particles.arr[i].vel.xy; - if (( distance(pos, vPos) < params.rule1Distance)) { + if ((distance(pos, vPos) < params.rule1Distance)) { cMass = (cMass + pos); cMassCount = (cMassCount + 1); } - if (( distance(pos, vPos) < params.rule2Distance)) { + if ((distance(pos, vPos) < params.rule2Distance)) { colVel = (colVel - (pos - vPos)); } - if (( distance(pos, vPos) < params.rule3Distance)) { + if ((distance(pos, vPos) < params.rule3Distance)) { cVel = (cVel + vel); cVelCount = (cVelCount + 1); } @@ -98,7 +98,7 @@ kernel void comp_main(uint3 gl_GlobalInvocationID [[thread_position_in_grid]], c cVel = (cVel / float2(float(cVelCount), float(cVelCount))); } vVel = (((vVel + (cMass * params.rule1Scale)) + (colVel * params.rule2Scale)) + (cVel * params.rule3Scale)); - vVel = ( normalize(vVel) * clamp( length(vVel), 0.0f, 0.100000001f)); + vVel = (normalize(vVel) * clamp(length(vVel), 0.0f, 0.100000001f)); vPos = (vPos + (vVel * params.deltaT)); if ((vPos.x < -1.0f)) { vPos.x = 1.0f; diff --git a/test/var/workgroup.wgsl.expected.msl b/test/var/workgroup.wgsl.expected.msl index a0c3800dc0..2105f716cd 100644 --- a/test/var/workgroup.wgsl.expected.msl +++ b/test/var/workgroup.wgsl.expected.msl @@ -29,7 +29,7 @@ kernel void main1(uint local_invocation_index [[thread_index_in_threadgroup]]) { if ((local_invocation_index == 0u)) { tint_symbol_9 = int(); } - threadgroup_barrier(mem_flags::mem_threadgroup); + threadgroup_barrier(mem_flags::mem_threadgroup); tint_symbol_9 = 42; uses_a(&(tint_symbol_9)); return; @@ -40,7 +40,7 @@ kernel void main2(uint local_invocation_index_1 [[thread_index_in_threadgroup]]) if ((local_invocation_index_1 == 0u)) { tint_symbol_10 = int(); } - threadgroup_barrier(mem_flags::mem_threadgroup); + threadgroup_barrier(mem_flags::mem_threadgroup); tint_symbol_10 = 7; uses_b(&(tint_symbol_10)); return; @@ -53,7 +53,7 @@ kernel void main3(uint local_invocation_index_2 [[thread_index_in_threadgroup]]) tint_symbol_11 = int(); tint_symbol_12 = int(); } - threadgroup_barrier(mem_flags::mem_threadgroup); + threadgroup_barrier(mem_flags::mem_threadgroup); outer(&(tint_symbol_11), &(tint_symbol_12)); no_uses(); return;