1. A method comprising: splitting graphics primitives into groups; finding a bounding box for each group; building a mini-tree for each of the groups of graphics primitives on a graphics processing unit (GPU); building a sweep-surface-area heuristic (SAH) subtree over the mini-trees in a central processing unit (CPU); and visiting the graphics primitives along a space-filling curve until a stopping criteria is met based on a user-defined threshold based on a maximum number of primitives per group.