2021-05-27 16:48:57 +00:00
|
|
|
SKIP: crbug.com/tint/833 loop emission is broken
|
|
|
|
|
2021-05-21 21:01:23 +00:00
|
|
|
#include <metal_stdlib>
|
|
|
|
|
|
|
|
using namespace metal;
|
|
|
|
struct Buf {
|
|
|
|
/* 0x0000 */ uint count;
|
|
|
|
/* 0x0004 */ uint data[50];
|
|
|
|
};
|
|
|
|
|
2021-06-02 21:02:34 +00:00
|
|
|
kernel void tint_symbol(device Buf& b [[buffer(0)]]) {
|
2021-05-21 21:01:23 +00:00
|
|
|
uint i = 0u;
|
|
|
|
{
|
|
|
|
bool tint_msl_is_first_1 = true;
|
|
|
|
device uint* const p;
|
|
|
|
for(;;) {
|
|
|
|
if (!tint_msl_is_first_1) {
|
|
|
|
*(p) = (*(p) * 2u);
|
|
|
|
i = (i + 1u);
|
|
|
|
}
|
|
|
|
tint_msl_is_first_1 = false;
|
|
|
|
|
|
|
|
if ((i >= b.count)) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
p = &(b.data[i]);
|
|
|
|
if (((i % 2u) == 0u)) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
*(p) = 0u;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|