[hlsl] Emit zero value var initializers
This CL adds emission of zero value initializers for `Var` instructions
to the HLSL IR backend.
Bug: 42251045
Change-Id: I78d0f933ccedb028f64379644c06a770b57949b0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/193643
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Reviewed-by: James Price <jrprice@google.com>
diff --git a/test/tint/statements/compound_assign/function.wgsl.expected.ir.fxc.hlsl b/test/tint/statements/compound_assign/function.wgsl.expected.ir.fxc.hlsl
index cbd5b87..e5265e3 100644
--- a/test/tint/statements/compound_assign/function.wgsl.expected.ir.fxc.hlsl
+++ b/test/tint/statements/compound_assign/function.wgsl.expected.ir.fxc.hlsl
@@ -1,9 +1,15 @@
SKIP: FAILED
-<dawn>/src/tint/lang/hlsl/writer/printer/printer.cc:205 internal compiler error: TINT_UNREACHABLE unimplemented `var` zero initialization
-********************************************************************
-* 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. *
-********************************************************************
+void foo() {
+ int a = 0;
+ float4 b = (0.0f).xxxx;
+ float2x2 c = float2x2((0.0f).xx, (0.0f).xx);
+ a = (a / 2);
+ b = (b * float4x4((0.0f).xxxx, (0.0f).xxxx, (0.0f).xxxx, (0.0f).xxxx));
+ c = (c * 2.0f);
+}
+
+[numthreads(1, 1, 1)]
+void unused_entry_point() {
+}
+