SPIRV-Cross/reference/opt/shaders-msl/comp/torture-loop.comp
Hans-Kristian Arntzen af0a887997 Add test for false loop init.
Clean up how for loop variables are declared.
2018-01-23 21:15:09 +01:00

80 lines
1.3 KiB
Plaintext

#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
struct SSBO
{
float4x4 mvp;
float4 in_data[1];
};
struct SSBO2
{
float4 out_data[1];
};
constant uint _98 = {};
kernel void main0(uint3 gl_GlobalInvocationID [[thread_position_in_grid]], device SSBO& _24 [[buffer(0)]], device SSBO2& _89 [[buffer(1)]])
{
int _40;
float4 _93;
int _94;
_93 = _24.in_data[gl_GlobalInvocationID.x];
_94 = 0;
int _48;
float4 _46;
for (;;)
{
_40 = _94 + 1;
if (_40 < 10)
{
_46 = _93 * 2.0;
_48 = _40 + 1;
_93 = _46;
_94 = _48;
continue;
}
else
{
break;
}
}
float4 _95;
int _96;
_95 = _93;
_96 = _40;
float4 _100;
uint _101;
uint _99;
for (uint _97 = 0u; _97 < 16u; _95 = _100, _96++, _97++, _99 = _101)
{
_100 = _95;
_101 = 0u;
float4 _71;
for (; _101 < 30u; _100 = _71, _101++)
{
_71 = _24.mvp * _100;
}
}
int _102;
_102 = _96;
int _83;
for (;;)
{
_83 = _102 + 1;
if (_83 > 10)
{
_102 = _83;
continue;
}
else
{
break;
}
}
_89.out_data[gl_GlobalInvocationID.x] = _95;
}