Ben Clayton f528d33d52 tint/transform: fix PromoteInitializersToLet for constant expressions
Fix more edge cases uncovered with tint:1781

Fixed: tint:1781
Change-Id: I58d120185f47c10bc9fe55dd95a198d496c4ec94
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/113024
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Auto-Submit: Ben Clayton <bclayton@google.com>
2022-12-09 12:34:36 +00:00

13 lines
215 B
WebGPU Shading Language

struct Normals {
f : vec3<f32>,
}
const faceNormals = array<Normals, 1>(
Normals(vec3(0, 0, 1)),
);
@vertex
fn main() -> @builtin(position) vec4<f32> {
let zero = 0;
return vec4(faceNormals[zero].f, 1.);
}