SPIRV-Cross/shaders-msl/comp/cfg-preserve-parameter.comp
Bill Hollings 1c18078811 Enhancements to MSL compute and entry point naming.
Support Workgroup (threadgroup) variables.
Mark if SPIRConstant is used as an array length, since it cannot be specialized.
Resolve specialized array length constants.
Support passing an array to MSL function.
Support emitting GLSL array assignments in MSL via an array copy function.
Support for memory and control barriers.
Struct packing enhancements, including packing nested structs.
Enhancements to replacing illegal MSL variable and function names.
Add Compiler::get_entry_point_name_map() function to retrieve entry point renamings.
Remove CompilerGLSL::clean_func_name() as obsolete.
Fixes to types in bitcast MSL functions.
Add Variant::get_id() member function.
Add CompilerMSL::Options::msl_version option.
Add numerous MSL compute tests.
2017-11-05 21:34:42 -05:00

55 lines
813 B
Plaintext

#version 310 es
// We write in all paths (and no reads), so should just be out.
void out_test_0(int cond, inout int i)
{
if (cond == 0)
i = 40;
else
i = 60;
}
// We write in all paths (and no reads), so should just be out.
void out_test_1(int cond, inout int i)
{
switch (cond)
{
case 40:
i = 40;
break;
default:
i = 70;
break;
}
}
// We don't write in all paths, so should be inout.
void inout_test_0(int cond, inout int i)
{
if (cond == 0)
i = 40;
}
void inout_test_1(int cond, inout int i)
{
switch (cond)
{
case 40:
i = 40;
break;
}
}
void main()
{
int cond = 40;
int i = 50;
out_test_0(cond, i);
out_test_1(cond, i);
inout_test_0(cond, i);
inout_test_1(cond, i);
}