Facing directly toward the prayer leader inside the Ka'bah can be valid, though the commentary treats it as disliked without a barrier.

Prayer inside, on, and around the Ka'bah