2021-07-23 16:44:52 +00:00
|
|
|
cbuffer cbuffer_ubo : register(b0, space0) {
|
|
|
|
uint4 ubo[1];
|
|
|
|
};
|
|
|
|
|
|
|
|
struct S {
|
|
|
|
int data[64];
|
|
|
|
};
|
|
|
|
|
|
|
|
RWByteAddressBuffer result : register(u1, space0);
|
|
|
|
groupshared S s;
|
|
|
|
|
|
|
|
struct tint_symbol_2 {
|
|
|
|
uint local_invocation_index : SV_GroupIndex;
|
|
|
|
};
|
|
|
|
|
2021-08-04 22:15:28 +00:00
|
|
|
void f_inner(uint local_invocation_index) {
|
2021-07-30 14:08:06 +00:00
|
|
|
{
|
2021-11-25 18:44:50 +00:00
|
|
|
[loop] for(uint idx = local_invocation_index; (idx < 64u); idx = (idx + 1u)) {
|
2021-07-30 14:08:06 +00:00
|
|
|
const uint i = idx;
|
|
|
|
s.data[i] = 0;
|
2021-07-23 16:44:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
GroupMemoryBarrierWithGroupSync();
|
|
|
|
s.data[asint(ubo[0].x)] = 1;
|
|
|
|
result.Store(0u, asuint(s.data[3]));
|
2021-08-04 22:15:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
[numthreads(1, 1, 1)]
|
|
|
|
void f(tint_symbol_2 tint_symbol_1) {
|
|
|
|
f_inner(tint_symbol_1.local_invocation_index);
|
2021-07-23 16:44:52 +00:00
|
|
|
return;
|
|
|
|
}
|