Add regression test for RMW optimizations.

This commit is contained in:
Hans-Kristian Arntzen 2017-09-06 09:18:06 +02:00
parent 03db5c4847
commit a2229a0327
2 changed files with 54 additions and 0 deletions

View File

@ -0,0 +1,27 @@
#version 310 es
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
layout(binding = 0, std430) buffer SSBO
{
int a;
} _9;
void main()
{
_9.a += 10;
_9.a -= 10;
_9.a *= 10;
_9.a /= 10;
_9.a = _9.a << 2;
_9.a = _9.a >> 3;
_9.a &= 40;
_9.a ^= 10;
_9.a %= 40;
_9.a |= 1;
bool c = false;
bool d = true;
c = c && d;
d = d || c;
_9.a = int(c && d);
}

27
shaders/comp/rmw-opt.comp Normal file
View File

@ -0,0 +1,27 @@
#version 310 es
layout(local_size_x = 1) in;
layout(std430, binding = 0) buffer SSBO
{
int a;
};
void main()
{
a += 10;
a -= 10;
a *= 10;
a /= 10;
a <<= 2;
a >>= 3;
a &= 40;
a ^= 10;
a %= 40;
a |= 1;
bool c = false;
bool d = true;
c = c && d;
d = d || c;
a = c && d ? 1 : 0;
}