Move the test from the fragment shader to the vertex shader to avoid relying on the accuracy of the perspective correction implementation.