Mojo function
morton_decode_2d
morton_decode_2d(flat_idx: UInt32) -> Tuple[UInt32, UInt32]
Decode a linear index to (tile_m, tile_n) via Morton Z-order.
Even bits of flat_idx -> tile_n, odd bits -> tile_m. The decoded pair may fall outside any rectangular grid that isn't a power-of-2 square; the caller checks bounds.
Returns:
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!