3 ms·
If you're doing low level graphics programming (processing pixel data) or in some other way dealing with 2D raster type data, you might want to work with data i
by azornathogron 3y ago
If you're doing low level graphics programming (processing pixel data) or in some other way dealing with 2D raster type data, you might want to work with data in Morton order or with Morton order tiles or something similar. Interleaving the bits of the x & y coordinate values helps to put pixels that are close together in your 2D space also close together in memory, which can help with making best use of caches.
See for example https://fgiesen.wordpress.com/2011/01/17/texture-tiling-and-swizzling/ https://fgiesen.wordpress.com/2011/01/17/texture-tiling-and-... (search "Morton" in the page)
There are probably other use-cases that I'm unaware of.