I have this same issue. mid-2012 rMBP, screen goes black with a GPU panic when switching between integrated and discrete GPU, only started happening upon "upgrading" to Yosemite. I took it in to the "genius" bar and they said they could fix it for $320, but then they called me up later and said that they saw signs of liquid damage (even though I've never spilled anything on the computer), which is, I think, their catch-all get-out-their-responsibilities-free card. They wanted $1200 to fix the computer. I think I'll take that $1200 and buy a non-Apple computer.
Given the large number of people reporting the exact same issue, my guess is that they have a software issue that is unmasking variability in the underlying HW, causing problems. It wouldn't be the first time that Apple had GPU consistency problems (recall the whole NVIDIA GPU-gate debacle). And given how much tacky GPU gewgaw they added to Yosemite, it doesn't surprise me that it's full of unpleasant surprises.
In any event, I've learned my lesson. I'm never going to spend this much on a laptop again. The days when Apple laptops were the most reliable and when Apple had the best customer service are long gone.