2022-03-31 22:30:10 +00:00
|
|
|
void set_int4(inout int4 vec, int idx, int val) {
|
|
|
|
vec = (idx.xxxx == int4(0, 1, 2, 3)) ? val.xxxx : vec;
|
|
|
|
}
|
2022-03-31 22:30:10 +00:00
|
|
|
|
2022-03-31 22:30:10 +00:00
|
|
|
[numthreads(1, 1, 1)]
|
|
|
|
void unused_entry_point() {
|
|
|
|
return;
|
|
|
|
}
|
2022-03-31 22:30:10 +00:00
|
|
|
|
|
|
|
struct S {
|
2022-03-31 22:30:10 +00:00
|
|
|
int4 a[4];
|
|
|
|
};
|
2022-03-31 22:30:10 +00:00
|
|
|
|
2022-03-31 22:30:10 +00:00
|
|
|
static int counter = 0;
|
2022-03-31 22:30:10 +00:00
|
|
|
|
2022-03-31 22:30:10 +00:00
|
|
|
int foo() {
|
|
|
|
counter = (counter + 1);
|
2022-03-31 22:30:10 +00:00
|
|
|
return counter;
|
|
|
|
}
|
|
|
|
|
2022-03-31 22:30:10 +00:00
|
|
|
int bar() {
|
|
|
|
counter = (counter + 2);
|
2022-03-31 22:30:10 +00:00
|
|
|
return counter;
|
|
|
|
}
|
|
|
|
|
2022-03-31 22:30:10 +00:00
|
|
|
void main() {
|
|
|
|
S x = (S)0;
|
2022-11-09 22:04:11 +00:00
|
|
|
const int tint_symbol_save = foo();
|
2022-03-31 22:30:10 +00:00
|
|
|
const int tint_symbol_1 = bar();
|
2022-11-09 22:04:11 +00:00
|
|
|
{
|
|
|
|
int4 tint_symbol_3[4] = x.a;
|
|
|
|
set_int4(tint_symbol_3[tint_symbol_save], tint_symbol_1, (x.a[tint_symbol_save][tint_symbol_1] + 5));
|
|
|
|
x.a = tint_symbol_3;
|
|
|
|
}
|
2022-03-31 22:30:10 +00:00
|
|
|
}
|