Some people say "discard" has not a positive effect on optimization. Other people say it will at least spare the fetches of textures.
if (color.A < 0.1f) {
//discard;
clip(-1);
}
// tons of reads of textures following here
// and loops too
Some people say that "discard" will only mask out the output of the pixel shader, while still evaluates all the statements after the "discard" instruction.
MSN>
discard: Do not output the result of the current pixel.
clip: Discards the current pixel..
<MSN
As usual it is unclear, but it suggests that "clip" could discard the whole pixel(maybe stopping execution too)
I think, that at least, because of termal and energy consuming reasons, GPU should not evaluate the statements after "discard", but some people on internet say that GPU computes the statements anyways. What I am more worried about, are the texture fetches after discard/clip.
(what if after discard, I have an expensive branch decision that makes the approved cheap branch neighbor pixels stall for nothing? this is crazy)