2020-12-12 01:01:48 +11:00
|
|
|
// SPDX-License-Identifier: Apache-2.0 OR MIT OR Unlicense
|
|
|
|
|
2020-05-13 06:38:26 +10:00
|
|
|
// Code auto-generated by piet-gpu-derive
|
|
|
|
|
|
|
|
struct BinInstanceRef {
|
|
|
|
uint offset;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct BinInstance {
|
|
|
|
uint element_ix;
|
|
|
|
};
|
|
|
|
|
2020-11-21 04:26:02 +11:00
|
|
|
#define BinInstance_size 4
|
2020-05-13 06:38:26 +10:00
|
|
|
|
|
|
|
BinInstanceRef BinInstance_index(BinInstanceRef ref, uint index) {
|
|
|
|
return BinInstanceRef(ref.offset + index * BinInstance_size);
|
|
|
|
}
|
|
|
|
|
|
|
|
BinInstance BinInstance_read(BinInstanceRef ref) {
|
|
|
|
uint ix = ref.offset >> 2;
|
|
|
|
uint raw0 = bins[ix + 0];
|
|
|
|
BinInstance s;
|
|
|
|
s.element_ix = raw0;
|
|
|
|
return s;
|
|
|
|
}
|
|
|
|
|
|
|
|
void BinInstance_write(BinInstanceRef ref, BinInstance s) {
|
|
|
|
uint ix = ref.offset >> 2;
|
|
|
|
bins[ix + 0] = s.element_ix;
|
|
|
|
}
|
|
|
|
|