2021-05-26 15:41:02 +00:00
|
|
|
groupshared int a;
|
|
|
|
groupshared int b;
|
2021-06-16 09:19:36 +00:00
|
|
|
groupshared int c;
|
2021-05-26 15:41:02 +00:00
|
|
|
|
|
|
|
void uses_a() {
|
|
|
|
a = (a + 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
void uses_b() {
|
|
|
|
b = (b * 2);
|
|
|
|
}
|
|
|
|
|
|
|
|
void uses_a_and_b() {
|
|
|
|
b = a;
|
|
|
|
}
|
|
|
|
|
|
|
|
void no_uses() {
|
|
|
|
}
|
|
|
|
|
|
|
|
void outer() {
|
|
|
|
a = 0;
|
|
|
|
uses_a();
|
|
|
|
uses_a_and_b();
|
|
|
|
uses_b();
|
|
|
|
no_uses();
|
|
|
|
}
|
|
|
|
|
2021-06-18 22:44:31 +00:00
|
|
|
struct tint_symbol_1 {
|
|
|
|
uint local_invocation_index : SV_GroupIndex;
|
|
|
|
};
|
|
|
|
|
2021-08-04 22:15:28 +00:00
|
|
|
void main1_inner(uint local_invocation_index) {
|
2021-07-30 14:08:06 +00:00
|
|
|
{
|
2021-06-18 22:44:31 +00:00
|
|
|
a = 0;
|
|
|
|
}
|
|
|
|
GroupMemoryBarrierWithGroupSync();
|
2021-05-26 15:41:02 +00:00
|
|
|
a = 42;
|
|
|
|
uses_a();
|
2021-08-04 22:15:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
[numthreads(1, 1, 1)]
|
|
|
|
void main1(tint_symbol_1 tint_symbol) {
|
|
|
|
main1_inner(tint_symbol.local_invocation_index);
|
2021-05-26 15:41:02 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2021-06-18 22:44:31 +00:00
|
|
|
struct tint_symbol_3 {
|
|
|
|
uint local_invocation_index_1 : SV_GroupIndex;
|
|
|
|
};
|
|
|
|
|
2021-08-04 22:15:28 +00:00
|
|
|
void main2_inner(uint local_invocation_index_1) {
|
2021-07-30 14:08:06 +00:00
|
|
|
{
|
2021-06-18 22:44:31 +00:00
|
|
|
b = 0;
|
|
|
|
}
|
|
|
|
GroupMemoryBarrierWithGroupSync();
|
2021-05-26 15:41:02 +00:00
|
|
|
b = 7;
|
|
|
|
uses_b();
|
2021-08-04 22:15:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
[numthreads(1, 1, 1)]
|
|
|
|
void main2(tint_symbol_3 tint_symbol_2) {
|
|
|
|
main2_inner(tint_symbol_2.local_invocation_index_1);
|
2021-05-26 15:41:02 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2021-06-18 22:44:31 +00:00
|
|
|
struct tint_symbol_5 {
|
|
|
|
uint local_invocation_index_2 : SV_GroupIndex;
|
|
|
|
};
|
|
|
|
|
2021-08-04 22:15:28 +00:00
|
|
|
void main3_inner(uint local_invocation_index_2) {
|
2021-07-30 14:08:06 +00:00
|
|
|
{
|
2021-06-18 22:44:31 +00:00
|
|
|
a = 0;
|
|
|
|
b = 0;
|
|
|
|
}
|
|
|
|
GroupMemoryBarrierWithGroupSync();
|
2021-05-26 15:41:02 +00:00
|
|
|
outer();
|
|
|
|
no_uses();
|
2021-08-04 22:15:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
[numthreads(1, 1, 1)]
|
|
|
|
void main3(tint_symbol_5 tint_symbol_4) {
|
|
|
|
main3_inner(tint_symbol_4.local_invocation_index_2);
|
2021-05-26 15:41:02 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
[numthreads(1, 1, 1)]
|
|
|
|
void main4() {
|
|
|
|
no_uses();
|
|
|
|
return;
|
|
|
|
}
|