Fix profile event usage in 3D code