That means even if the Supreme Court were to declare that the law that denies same-sex married couples federal benefits was unconstitutional — it is expected to weigh in on the issue this month — such a decision could have a perverse effect: workers who may be permitted to add a same-sex spouse to a pension or a health plan, for instance, would be forced to expose their sexuality in a potentially hostile workplace to receive those benefits.

“As gay people are able to participate more in the normal activities and institutions of everyday life, their visibility in the workplace is more apparent and they are a more visible target for employment discrimination,” said Shannon Price Minter, a civil rights lawyer and legal director of the National Center for Lesbian Rights. “We are seeing people run into problems because of that or be fired.”

A patchwork of state and local laws, along with court and agency decisions, provides some protections. Twenty-one states and the District of Columbia prohibit discrimination based on sexual orientation, according to the June report, which was co-written by the Center for American Progress and the Human Rights Campaign.

Sixteen states and Washington, D.C., have expanded their laws to also protect workers on the basis of their gender identity and expression, which affects transgender people. Workers in any of these states can seek recourse and other penalties through state courts. Federal workers, meanwhile, are protected through an executive order and the vast majority of Fortune 500 companies have antidiscrimination policies of their own. Beyond that, many cities and counties have passed their own ordinances, though the researchers say in many cases that these measures either don’t really provide people with effective legal remedies or just fine the employer.

You might think that a discrimination claim based on a person’s sexual orientation would be covered under Title VII of the Civil Rights Act, which prohibits employment discrimination based on race, color, religion, sex and national origin and is enforced by the federal Equal Employment Opportunity Commission. And while some courts are beginning to issue more favorable decisions for gay and transgender workers by interpreting that law more broadly, advocates say that is a slow and expensive process with no guarantees.