Compositor ID Mask not working?
Your setup seems to be correct.

The material you want to use as mask must have an Pass Index number.



In the render layers enable Material Index



Now press F12: YOU HAVE TO RENDER THE IMAGE for this changes to update, and the compositor has the proper information to work with (Sounds simple, but this step is sometimes overlooked).

After that, the node setup could be something like this, where the ID mask index matches the index set for the eye material and is used as a mask for further transformations: