Skip to main content

Mojo function

create_hilbert_lut

create_hilbert_lut(ctx: DeviceContext, grid_x: Int, grid_y: Int) -> DeviceBuffer[uint32]

Precompute Hilbert-curve block swizzle lookup-table for a rectangular grid.

The returned device pointer refers to a 1-D UInt32 array of length grid_x * grid_y. For linear (row-major) block id id, the packed value at lut[id] encodes the swizzled coordinates: upper 16-bits = y, lower 16-bits = x.

Was this page helpful?