Add preliminary logic for depth sort of primitives