Resolver: Enforce vector constructor type rules

Added enforcement for vector constructor type rules according to the
table in https://gpuweb.github.io/gpuweb/wgsl.html#type-constructor-expr.

This surfaced a number of existing tests that violated some of these
rules or had a type-declaration related bug, so this CL fixes those as
well (these tests either passed the incorrect number of arguments to a
vector constructor or relied on implicit conversions between numeric
types).

Fixed: tint:632
Fixed: tint:476
Change-Id: I8279be3eeae50b64db486ee7a91a43bd94fdff62
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/44480
Commit-Queue: Arman Uguray <armansito@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
This commit is contained in:
Arman Uguray
2021-03-15 21:21:33 +00:00
committed by Commit Bot service account
parent 2f9ced0341
commit 3549e2ea8c
9 changed files with 1173 additions and 38 deletions

View File

@@ -65,7 +65,7 @@ fn f1(p0 : f32, p1 : i32) -> f32 {
var l0 : i32 = 3;
var l1 : f32 = 8.0;
var l2 : u32 = bitcast<u32>(4);
var l3 : vec2<u32> = vec2<u32>(l0, l1);
var l3 : vec2<u32> = vec2<u32>(u32(l0), u32(l1));
var l4 : S;
var l5 : u32 = l4.m1[5];
var l6 : ptr<private, u32>;