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>
This commit is contained in:
Ben Clayton
2022-12-09 12:34:36 +00:00
committed by Dawn LUCI CQ
parent dd0d45102a
commit f528d33d52
73 changed files with 653 additions and 824 deletions

View File

@@ -1,8 +1,6 @@
[numthreads(1, 1, 1)]
void main() {
int zero[2][3] = (int[2][3])0;
const int tint_symbol[3] = {1, 2, 3};
const int tint_symbol_1[3] = {4, 5, 6};
int init[2][3] = {tint_symbol, tint_symbol_1};
int init[2][3] = {{1, 2, 3}, {4, 5, 6}};
return;
}

View File

@@ -1,8 +1,6 @@
[numthreads(1, 1, 1)]
void main() {
int zero[2][3] = (int[2][3])0;
const int tint_symbol[3] = {1, 2, 3};
const int tint_symbol_1[3] = {4, 5, 6};
int init[2][3] = {tint_symbol, tint_symbol_1};
int init[2][3] = {{1, 2, 3}, {4, 5, 6}};
return;
}

View File

@@ -2,9 +2,7 @@
void tint_symbol() {
int zero[2][3] = int[2][3](int[3](0, 0, 0), int[3](0, 0, 0));
int tint_symbol_1[3] = int[3](1, 2, 3);
int tint_symbol_2[3] = int[3](4, 5, 6);
int init[2][3] = int[2][3](tint_symbol_1, tint_symbol_2);
int init[2][3] = int[2][3](int[3](1, 2, 3), int[3](4, 5, 6));
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;

View File

@@ -16,9 +16,7 @@ struct tint_array {
kernel void tint_symbol() {
tint_array<tint_array<int, 3>, 2> zero = {};
tint_array<int, 3> const tint_symbol_1 = tint_array<int, 3>{1, 2, 3};
tint_array<int, 3> const tint_symbol_2 = tint_array<int, 3>{4, 5, 6};
tint_array<tint_array<int, 3>, 2> init = tint_array<tint_array<int, 3>, 2>{tint_symbol_1, tint_symbol_2};
tint_array<tint_array<int, 3>, 2> init = tint_array<tint_array<int, 3>, 2>{tint_array<int, 3>{1, 2, 3}, tint_array<int, 3>{4, 5, 6}};
return;
}