Skip to main content

Module preliminary_surface_store

Module preliminary_surface_store 

Source
Expand description

share preliminary surface levels across chunks

quart-aligned lookups agree on cached and raw paths, so neighbors can reuse them

Structsยง

PreliminarySurfaceStore
shared surface levels, one atomic word per entry reads see a complete entry or miss; collisions just mean recomputing

Constantsยง

AXIS_BITS ๐Ÿ”’
512 quarts per axis, enough for a 128-chunk span without slot collisions
AXIS_MASK ๐Ÿ”’
COORD_BITS ๐Ÿ”’
Packed slot layout: valid (1) | quart_x (24) | quart_z (24) | level (15).
COORD_MASK ๐Ÿ”’
COORD_MAX ๐Ÿ”’
COORD_MIN ๐Ÿ”’
LEVEL_BITS ๐Ÿ”’
LEVEL_MASK ๐Ÿ”’
LEVEL_MAX ๐Ÿ”’
LEVEL_MIN ๐Ÿ”’
VALID ๐Ÿ”’

Functionsยง

pack_level ๐Ÿ”’
pack the level if it fits
unpack_level ๐Ÿ”’
unpack the level, keeping its sign