Discard fragment doesn't discard Z/Depth?

Just a quick question…, why does the discard command not discard the writing to the depth buffer also?.., I just made a shader with discard at the top of the fragment function and I still get depth information from the objects using the shader…

Maybe I’m doing something silly? Thanks in advance!

ok…, I’m not understanding this completely…, but it seems like it does the depth comparison before the first line in the fragment shader (where I use discard)

Any obvious way to solve this? I’m basically trying to do a cutout based on an alpha texture