I should correct myself: In GL 4.3 (and I'm pretty certain in 4.2 as well), early fragment tests have to be explicitly enabled to really happen before fragment shader execution. This includes per-fragment depth tests. Otherwise the tests will happen after execution of the fragment shader.