[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/literal/textureLoad/4951bb.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureLoad/4951bb.wgsl.expected.ir.msl
index e05aff4..aeb617d 100644
--- a/test/tint/builtins/gen/literal/textureLoad/4951bb.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureLoad/4951bb.wgsl.expected.ir.msl
@@ -41,5 +41,8 @@
vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read> arg_0 [[texture(0)]]) {
tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
VertexOutput const v = vertex_main_inner(tint_module_vars);
- 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;
}