Dynamic number of passes in a shader

what I want to do when rendering an object is to render it n times with different property values for each pass. where n is some dynamic value in code (in this case the number of a certain type of class of object)

n doesn’t change that frequently.

That’s not possible right now.