At the moment, Morton Codes are generated on demand at run time. This isn't great in tight loops, for example inserting many thousands of triangles into a BVH. Instead, the Swift Macro system should be able to generate a LUT at build time representing the value types that the client wants. Then encoding a Morton code should use the LUT for fast "generation".
At the moment, Morton Codes are generated on demand at run time. This isn't great in tight loops, for example inserting many thousands of triangles into a BVH. Instead, the Swift Macro system should be able to generate a LUT at build time representing the value types that the client wants. Then encoding a Morton code should use the LUT for fast "generation".