xref: /aosp_15_r20/external/skia/tests/sksl/compute/ModuleStructInExpression.metal (revision c8dee2aa9b3f27cf6c858bd81872bdeb2c07ed17)
1#include <metal_stdlib>
2#include <simd/simd.h>
3#ifdef __clang__
4#pragma clang diagnostic ignored "-Wall"
5#endif
6using namespace metal;
7struct IndirectDispatchArgs {
8    int x;
9    int y;
10    int z;
11};
12struct Inputs {
13};
14struct Threadgroups {
15    int outX;
16    int outY;
17    int outZ;
18};
19int one_i() {
20    return 1;
21}
22int two_i() {
23    return 2;
24}
25int three_i() {
26    return 3;
27}
28kernel void computeMain() {
29    threadgroup Threadgroups _threadgroups{{}, {}, {}};
30    (void)_threadgroups;
31    Inputs _in = {  };
32    _threadgroups.outX = IndirectDispatchArgs{one_i(), two_i(), three_i()}.x;
33    _threadgroups.outY = IndirectDispatchArgs{one_i(), two_i(), three_i()}.y;
34    _threadgroups.outZ = IndirectDispatchArgs{one_i(), two_i(), three_i()}.z;
35    return;
36}
37