[msl] Add support for clip_distances
The clip distances builtin is an array, but needs to be emitted as a
C-style array instead of using Tint's array wrapper. Additionally, the
builtin attribute needs to be emitted after the member name and before
the array count. The easiest way to achieve this is by special-casing
the logic for emitting this struct member in the printer, rather than
inventing a new MSL array type and special-casing the way we emit that
type to include the name and builtin as part of it.
Bug: 42251016
Change-Id: I1439ffca124287444c4c7c5507a01bab005f6777
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/204680
Commit-Queue: James Price <jrprice@google.com>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
diff --git a/test/tint/builtins/gen/var/bitcast/23c8bd.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/bitcast/23c8bd.wgsl.expected.ir.msl
index f8eb7d1..aba1b51 100644
--- a/test/tint/builtins/gen/var/bitcast/23c8bd.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/bitcast/23c8bd.wgsl.expected.ir.msl
@@ -40,5 +40,8 @@
vertex vertex_main_outputs vertex_main() {
VertexOutput const v = vertex_main_inner();
- return vertex_main_outputs{.VertexOutput_pos=v.pos, .VertexOutput_prevent_dce=v.prevent_dce};
+ vertex_main_outputs tint_wrapper_result = {};
+ tint_wrapper_result.VertexOutput_pos = v.pos;
+ tint_wrapper_result.VertexOutput_prevent_dce = v.prevent_dce;
+ return tint_wrapper_result;
}