SPIRV-Cross/reference/shaders-no-opt/asm/frag/switch-non-default-fallthrough-no-phi.asm.frag
Chip Davis 5547b25afe Interleave undef values with constants and types.
Undef values may be of struct type and may be used in constants.
Therefore, they must be interleaved with constants and types.

Fixes the rest of the Vulkan CTS test
`dEQP-VK.spirv_assembly.instruction.compute.opundef.undefined_spec_constant_composite`.

(Please excuse the churn in the reference output; it's an inevitable
result of this change.)
2022-11-20 02:08:37 -08:00

89 lines
1.6 KiB
JavaScript

#version 450
struct _4
{
uint _m0;
int _m1;
};
struct _5
{
int _m0;
int _m1;
};
_4 _16;
int _21;
layout(location = 0) flat in int _2;
layout(location = 0) out int _3;
void main()
{
bool _25 = false;
do
{
_5 _26;
_26._m0 = 0;
_26._m1 = 10;
_4 _35;
_35 = _16;
int _39;
_4 _36;
bool _59;
int _38 = 0;
for (;;)
{
if (_26._m0 < _26._m1)
{
int _27 = _26._m0;
int _28 = _26._m0 + int(1u);
_26._m0 = _28;
_36 = _4(1u, _27);
}
else
{
_4 _48 = _35;
_48._m0 = 0u;
_36 = _48;
}
bool _45_ladder_break = false;
switch (int(_36._m0))
{
case 0:
{
_3 = _38;
_25 = true;
_59 = true;
_45_ladder_break = true;
break;
}
default:
{
_59 = false;
_45_ladder_break = true;
break;
}
case 1:
{
break;
}
}
if (_45_ladder_break)
{
break;
}
_39 = _38 + _2;
_35 = _36;
_38 = _39;
continue;
}
if (_59)
{
break;
}
break;
} while(false);
}