writer/msl: Implement interpolate attributes
Bug: tint:746
Change-Id: Ia96da94b948c0e2c6d99452d5e152113e2af1264
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/56245
Kokoro: Kokoro <noreply+kokoro@google.com>
Auto-Submit: James Price <jrprice@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
diff --git a/test/shader_io/interpolate_input_struct.wgsl.expected.msl b/test/shader_io/interpolate_input_struct.wgsl.expected.msl
index 41cb1fa..285f608 100644
--- a/test/shader_io/interpolate_input_struct.wgsl.expected.msl
+++ b/test/shader_io/interpolate_input_struct.wgsl.expected.msl
@@ -1,10 +1,29 @@
-SKIP: FAILED
+#include <metal_stdlib>
-../../src/writer/msl/generator_impl.cc:1782 internal compiler error: TINT_UNIMPLEMENTED interpolate decoration
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
+using namespace metal;
+struct In {
+ float none;
+ float flat;
+ float perspective_center;
+ float perspective_centroid;
+ float perspective_sample;
+ float linear_center;
+ float linear_centroid;
+ float linear_sample;
+};
+struct tint_symbol_2 {
+ float none [[user(locn0)]];
+ float flat [[user(locn1)]] [[flat]];
+ float perspective_center [[user(locn2)]] [[center_perspective]];
+ float perspective_centroid [[user(locn3)]] [[centroid_perspective]];
+ float perspective_sample [[user(locn4)]] [[sample_perspective]];
+ float linear_center [[user(locn5)]] [[center_no_perspective]];
+ float linear_centroid [[user(locn6)]] [[centroid_no_perspective]];
+ float linear_sample [[user(locn7)]] [[sample_no_perspective]];
+};
+
+fragment void tint_symbol(tint_symbol_2 tint_symbol_1 [[stage_in]]) {
+ In const in = {.none=tint_symbol_1.none, .flat=tint_symbol_1.flat, .perspective_center=tint_symbol_1.perspective_center, .perspective_centroid=tint_symbol_1.perspective_centroid, .perspective_sample=tint_symbol_1.perspective_sample, .linear_center=tint_symbol_1.linear_center, .linear_centroid=tint_symbol_1.linear_centroid, .linear_sample=tint_symbol_1.linear_sample};
+ return;
+}