aboutsummaryrefslogtreecommitdiff
path: root/vendor/gioui.org/shader/piet/bins.h
blob: 853adabe0f5c35ee3944263a126db52ec9e8faa9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// SPDX-License-Identifier: Apache-2.0 OR MIT OR Unlicense

// Code auto-generated by piet-gpu-derive

struct BinInstanceRef {
    uint offset;
};

struct BinInstance {
    uint element_ix;
};

#define BinInstance_size 4

BinInstanceRef BinInstance_index(BinInstanceRef ref, uint index) {
    return BinInstanceRef(ref.offset + index * BinInstance_size);
}

BinInstance BinInstance_read(Alloc a, BinInstanceRef ref) {
    uint ix = ref.offset >> 2;
    uint raw0 = read_mem(a, ix + 0);
    BinInstance s;
    s.element_ix = raw0;
    return s;
}

void BinInstance_write(Alloc a, BinInstanceRef ref, BinInstance s) {
    uint ix = ref.offset >> 2;
    write_mem(a, ix + 0, s.element_ix);
}