Use depth instead of visinfo->depth.