Adds checks that it isn't used in an unsupported function and emits the depth_ref as a separate argument.