resolver: Storable types include textures/samplers

Add a Resolver::IsPlain() method to check for plain types, which is
then used instead of IsStorable() for validating array and struct
subtypes.

Remove validation of assignment and constructor RHS types, instead
validating the type of the variable declaration. This catches
additional errors that were previously missed, such as using a pointer
for a var declaration with no constructor.

Change-Id: I5786a262159d2a42cc05b44743c6c26f6b5647c0
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/53960
Auto-Submit: James Price <jrprice@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
This commit is contained in:
James Price
2021-06-09 09:12:57 +00:00
committed by Tint LUCI CQ
parent ad7c2ec355
commit 3b26717377
5 changed files with 35 additions and 36 deletions

View File

@@ -66,7 +66,7 @@ fn f1(p0 : f32, p1 : i32) -> f32 {
var l3 : vec2<u32> = vec2<u32>(u32(l0), u32(l1));
var l4 : S;
var l5 : u32 = l4.m1[5];
var l6 : ptr<private, u32>;
let l6 : ptr<private, u32> = &g0;
loop {
l0 = (p1 + 2);
if (((l0 % 4) == 0)) {