Alpha Testing in Metal?

Since OpenGL ES 2.0, I always discarded pixels in my pixel shaders on all platforms, but often with strong performance impact. When I asked someone in one of the Metal Labs at WWDC about it, I was told that discard in general is not a good idea and I should use alpha testing instead (not sure why though, because early depth should still not work with it). Now that I finally got around to look into it, it doesn't seem like there is such a thing as alpha testing in metal?

What I did find/am already using for some things is Alpha To Coverage, should I just use that instead? Can I expect it to be faster than discarding fragments? Are there any disadvantages?

On OpenGL ES, alpha testing and using discard will have the same performance impact. (In fact, alpha testing is implemented with discard by the driver). However, alpha blending, which can be used to perform the same effects, can be faster.


You're correct, there is not alpha testing in Metal becasue it can be implmented by the developer with discard.

And what about Alpha to Coverage? I suppose it's not much different from discard, but on a per sample level?

I am using Metal on macOS, can alpha blending have a performance advantage there?

Alpha Testing in Metal?
 
 
Q