writer/hlsl: Zero initialize with (T) 0

For structures and arrays.
This behaves identically to the per-element zero-initialization, but can be significantly less verbose.

Change-Id: I380ef86f16c2b3f37a9de2820e707f368955b761
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/56764
Auto-Submit: Ben Clayton <bclayton@google.com>
Reviewed-by: David Neto <dneto@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
diff --git a/test/array/assign_to_workgroup_var.wgsl.expected.hlsl b/test/array/assign_to_workgroup_var.wgsl.expected.hlsl
index 4a752ef..14443ac 100644
--- a/test/array/assign_to_workgroup_var.wgsl.expected.hlsl
+++ b/test/array/assign_to_workgroup_var.wgsl.expected.hlsl
@@ -27,7 +27,7 @@
   return tint_symbol_6;
 }
 
-static tint_array_wrapper src_private = {{{0}, {0}, {0}, {0}}};
+static tint_array_wrapper src_private = (tint_array_wrapper)0;
 groupshared tint_array_wrapper src_workgroup;
 cbuffer cbuffer_src_uniform : register(b0, space0) {
   uint4 src_uniform[4];
@@ -48,22 +48,22 @@
 groupshared tint_array_wrapper_1 dst_nested;
 
 tint_array_wrapper ret_arr() {
-  const tint_array_wrapper tint_symbol_7 = {{{0}, {0}, {0}, {0}}};
+  const tint_array_wrapper tint_symbol_7 = {(tint_padded_array_element[4])0};
   return tint_symbol_7;
 }
 
 S ret_struct_arr() {
-  const S tint_symbol_8 = {{{{0}, {0}, {0}, {0}}}};
+  const S tint_symbol_8 = (S)0;
   return tint_symbol_8;
 }
 
 void foo(tint_array_wrapper src_param) {
-  tint_array_wrapper src_function = {{{0}, {0}, {0}, {0}}};
+  tint_array_wrapper src_function = (tint_array_wrapper)0;
   const tint_array_wrapper tint_symbol_9 = {{{1}, {2}, {3}, {3}}};
   tint_symbol = tint_symbol_9;
   tint_symbol = src_param;
   tint_symbol = ret_arr();
-  const tint_array_wrapper src_let = {{{0}, {0}, {0}, {0}}};
+  const tint_array_wrapper src_let = {(tint_padded_array_element[4])0};
   tint_symbol = src_let;
   tint_symbol = src_function;
   tint_symbol = src_private;
@@ -71,6 +71,6 @@
   tint_symbol = ret_struct_arr().arr;
   tint_symbol = tint_symbol_2(src_uniform, 0u);
   tint_symbol = tint_symbol_4(src_storage, 0u);
-  tint_array_wrapper_1 src_nested = {{{{{{0, 0}}, {{0, 0}}, {{0, 0}}}}, {{{{0, 0}}, {{0, 0}}, {{0, 0}}}}, {{{{0, 0}}, {{0, 0}}, {{0, 0}}}}, {{{{0, 0}}, {{0, 0}}, {{0, 0}}}}}};
+  tint_array_wrapper_1 src_nested = (tint_array_wrapper_1)0;
   dst_nested = src_nested;
 }