writer/hlsl: Zero-initialize var declarations

Don't construct these with undefined values

Change-Id: I6225d9be0973ebc1a8594526aa32ec6775b5e865
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/51300
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: David Neto <dneto@google.com>
This commit is contained in:
Ben Clayton
2021-05-17 23:37:47 +00:00
committed by Commit Bot service account
parent bb3d963405
commit 6aa5a92a10
5 changed files with 33 additions and 13 deletions

View File

@@ -1,6 +1,6 @@
[numthreads(1, 1, 1)]
void main() {
float3x3 m;
float3x3 m = float3x3(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
const float3 v = m[1];
const float f = v[1];
return;

View File

@@ -1,6 +1,6 @@
[numthreads(1, 1, 1)]
void main() {
float3 v;
float3 v = float3(0.0f, 0.0f, 0.0f);
const float scalar = v.y;
const float2 swizzle2 = v.xz;
const float3 swizzle3 = v.xzy;