How to return from shader the indexes of triangles/vertices that was actually rendered?

I need to do post render analysis, on the vertices themselves (not on texture) and i need this data back to MeshRenderer in c# script as array of indexes that was not discarded during render process.

I didn’t find any solution for this.

@mendi80,
We have the exact same need (post processing on element) and we are facing the exact same problem (how to identify the element in the shader code to set the right color)
Did you find a solution , or a workaround (to set a specific color on each triangle)?
Thanks in advance,Mendi80,
We have the exact same need for our project, and we have the exact same question.
Did you find a solution on your side, or do you have a workaround?
Thanks in advance

Maybe someone can prove me wrong, but I think you are out of luck here. Even though modern Graphic APIs provide the possibility to save shaded per-vertex data before rasterization, like e.g. D3D11, Unity does not expose such a feature, afaik.