SPIRV-Cross/reference/opt/shaders-hlsl/asm/comp/control-flow-hints.asm.comp

33 lines
659 B
Plaintext
Raw Normal View History

2018-06-25 08:33:13 +00:00
RWByteAddressBuffer bar : register(u0);
RWByteAddressBuffer foo : register(u1);
void comp_main()
{
[unroll]
for (int _136 = 0; _136 < 16; )
2018-06-25 08:33:13 +00:00
{
bar.Store4(_136 * 16 + 0, asuint(asfloat(foo.Load4(_136 * 16 + 0))));
_136++;
2018-06-25 08:33:13 +00:00
continue;
}
[loop]
for (int _137 = 0; _137 < 16; )
2018-06-25 08:33:13 +00:00
{
bar.Store4((15 - _137) * 16 + 0, asuint(asfloat(foo.Load4(_137 * 16 + 0))));
_137++;
2018-06-25 08:33:13 +00:00
continue;
}
[branch]
if (asfloat(bar.Load(160)) > 10.0f)
{
foo.Store4(320, asuint(5.0f.xxxx));
}
foo.Store4(320, asuint(20.0f.xxxx));
}
[numthreads(1, 1, 1)]
void main()
{
comp_main();
}