mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 15:45:38 +00:00
0218546161
The piet-gpu project is dual licensed under the Apache 2.0 and MIT, and the shaders themselves are also offered under the UNLICENSE terms. See https://github.com/linebender/piet-gpu#license-and-contributions, as of commit 72e2dfab3da8ae1adf7a0fb056b71ccbc4cfa29a: "The piet-gpu project is dual-licensed under both Apache 2.0 and MIT licenses. In addition, the shaders are provided under the terms of the Unlicense. The intent is for this research to be used in as broad a context as possible." Signed-off-by: Elias Naur <mail@eliasnaur.com>
32 lines
690 B
C
32 lines
690 B
C
// 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);
|
|
}
|
|
|