In a new interview with Vanity Fair, out actor Luke Macfarlane says he was told he could not take on superhero roles because of his sexuality.

Macfarlane, 42, is currently promoting his latest project, the gay rom-com Bros. Billy Eichner wrote, directed, and stars in the film. Bros opens next month nationwide.

(Related: First Look: Billy Eichner, Luke Macfarlane star in gay rom-com Bros.)

Speaking with Vanity Fair, Macfarlane said that he decided to come out in 2008 as his character on the ABC drama Brothers and Sisters entered a same-sex marriage.

“Having gone through press junkets on shows where I'd never mentioned I was gay – not that I was lying, it was nobody's business – I was like, I've got to say something,” he said, referring to the increasing support for marriage equality as California approved Proposition 8.

The Canadian actor came out in an interview with The Globe and Mail, Canada's second most widely read newspaper.

“I don't know what will happen professionally,” he told the paper at the time. “That is the fear, but I guess I can't really be concerned about what will happen because it's my truth.”

After Brothers & Sisters ended in 2011, Macfarlane sought superhero roles.

I can literally remember an agent once saying to me, 'Superman can't be gay' – like just straight out,” Macfarlane told Vanity Fair.

While Macfarlane has worked steadily – he's appeared in more than a dozen Hallmark movies – he said that he felt frustrated by the roles he was offered, suggesting his coming out hurt his career.

I do remember being frustrated, seeing other actors and straight guys my age – and I never want to make it about that, but – thinking, Why are they getting [the parts]? Why am I not getting them?” he said. “The post–Brothers & Sisters moment was scary, for sure. I was like, ‘Dude, I’m the perfect age for this stuff.’ And it wasn’t clicking, for whatever reason.”

In Bros, Macfarlane landed his first studio movie leading role.

I knew there was never really a place for me, or I never thought there was,” he said. “I hope that there might be some places for me now.”