xref: /aosp_15_r20/external/skia/resources/sksl/compute/ModuleStructInExpression.compute (revision c8dee2aa9b3f27cf6c858bd81872bdeb2c07ed17)
1layout(local_size_x = 16, local_size_y = 16) in;
2
3workgroup int outX, outY, outZ;
4
5int one()   { return 1; }
6int two()   { return 2; }
7int three() { return 3; }
8
9void main() {
10    // This test is somewhat contrived, but it is possible to use a struct from the modules as part
11    // of an expression, without ever declaring a variable of that type. We need to detect this
12    // usage, and emit the struct type into the finished program.
13    outX = IndirectDispatchArgs(one(), two(), three()).x;
14    outY = IndirectDispatchArgs(one(), two(), three()).y;
15    outZ = IndirectDispatchArgs(one(), two(), three()).z;
16}
17