tint: const eval of binary bitwise AND and OR

Bug: tint:1581
Change-Id: Id6a7a1c8e45ee91bede8014dca03a59035b29678
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/102060
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
This commit is contained in:
Antonio Maiorano
2022-09-13 18:13:01 +00:00
committed by Dawn LUCI CQ
parent 5b3707a2d7
commit e53b6f9502
28 changed files with 272 additions and 50 deletions

View File

@@ -1,5 +1,5 @@
[numthreads(1, 1, 1)]
void f() {
const bool r = (true & false);
const bool r = false;
return;
}

View File

@@ -1,5 +1,5 @@
[numthreads(1, 1, 1)]
void f() {
const bool r = (true & false);
const bool r = false;
return;
}

View File

@@ -1,7 +1,7 @@
#version 310 es
void f() {
bool r = bool(uint(true) & uint(false));
bool r = false;
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;

View File

@@ -1,5 +1,5 @@
[numthreads(1, 1, 1)]
void f() {
const int r = (1 & 2);
const int r = 0;
return;
}

View File

@@ -1,5 +1,5 @@
[numthreads(1, 1, 1)]
void f() {
const int r = (1 & 2);
const int r = 0;
return;
}

View File

@@ -1,7 +1,7 @@
#version 310 es
void f() {
int r = (1 & 2);
int r = 0;
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;

View File

@@ -1,5 +1,5 @@
[numthreads(1, 1, 1)]
void f() {
const uint r = (1u & 2u);
const uint r = 0u;
return;
}

View File

@@ -1,5 +1,5 @@
[numthreads(1, 1, 1)]
void f() {
const uint r = (1u & 2u);
const uint r = 0u;
return;
}

View File

@@ -1,7 +1,7 @@
#version 310 es
void f() {
uint r = (1u & 2u);
uint r = 0u;
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;