SPIRV-Cross/reference/opt/shaders/comp/cfg.comp
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

45 lines
651 B
Plaintext

#version 310 es
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
float _188;
layout(binding = 0, std430) buffer SSBO
{
float data;
} _11;
void main()
{
if (_11.data != 0.0)
{
_11.data = 10.0;
}
else
{
_11.data = 15.0;
}
switch (int(_11.data))
{
case 0:
{
_11.data = 20.0;
break;
}
case 1:
{
_11.data = 30.0;
break;
}
}
float _185;
_185 = _188;
for (int _184 = 0; _184 < 20; )
{
_185 += 10.0;
_184++;
continue;
}
_11.data = _185;
}