So, have you noticed if it's related to the machine's temperature, or to the CPU/GPU workload?
But seriously- make sure you have an updated backup, run the basic troubleshoot, and run the Apple Hardware Test, or take it to diagnosis.
Something like this happened with my 2007 iMac... it started as a mild intermittent display anomaly, which suddenly quickly deteriorated until it died, taking lots of info with it. If you tend to it soon, it might be a simple problem that doesnt necessarily need a replacement part - e.g. blocked ventilation/trapped heat.
Cheers and good luck.