SPIRV-Cross/shaders/comp/loop.comp

99 lines
1.4 KiB
Plaintext
Raw Normal View History

2016-03-02 17:09:16 +00:00
#version 310 es
layout(local_size_x = 1) in;
layout(std430, binding = 0) readonly buffer SSBO
{
mat4 mvp;
vec4 in_data[];
};
layout(std430, binding = 1) writeonly buffer SSBO2
{
vec4 out_data[];
};
void main()
{
uint ident = gl_GlobalInvocationID.x;
vec4 idat = in_data[ident];
int k = 0;
uint i = 0u;
if (idat.y == 20.0)
{
do
{
k = k * 2;
i++;
} while (i < ident);
}
switch (k)
{
case 10:
for (;;)
{
i++;
if (i > 10u)
break;
}
break;
default:
for (;;)
{
i += 2u;
if (i > 20u)
break;
}
break;
}
2016-03-02 17:09:16 +00:00
while (k < 10)
{
idat *= 2.0;
k++;
}
for (uint i = 0u; i < 16u; i++, k++)
for (uint j = 0u; j < 30u; j++)
idat = mvp * idat;
k = 0;
for (;;)
{
k++;
if (k > 10)
{
k += 2;
}
else
{
k += 3;
continue;
}
k += 10;
}
k = 0;
do
{
k++;
} while (k > 10);
int l = 0;
for (;; l++)
{
if (l == 5)
{
continue;
}
idat += 1.0;
}
out_data[ident] = idat;
}