Builtin Library
- ..
- README.md947 B
- module.wgsl3.4 KB
README.md
tile_layout
How a field of cells is stored as tiles: a tile holds its core cells plus an
apron of copies of its neighbours' cells, and a tile covering the whole field
with no apron is a plain grid with x fastest. The includer states the layout as
a ZtLayout (cells, core and apron, each a vec3<i32> per axis, and
lanes, the f32 values a cell holds) and uses zt_decode (stored cell number to
tile, local and field cell, a ZtStored), zt_owner_index (the core cell that
owns a field cell; a cell past the field reads the edge cell),
zt_neighbour_index (a stored neighbour held to the tile's edge) and
zt_stored_total (the stored cells of the whole field, apron copies included).
zt_tiles, zt_stored, zt_tile_volume, zt_tile_count, zt_stored_index and
zt_inside answer the sizes and indices those are built from. The grid kernel
includes it.
#include "@builtin::systems.procgen.kernels.tile_layout"