How to create a mask in viewport?

I want to create a mask with special shape (e.g. a 5-pointed star in the center of screen) in viewport, in which nothing should be rendered. Is it possible? How can I achieve such effect?