Do not set fwdcompat bit for a compatibility profile QGLFormat

AMD drivers do weird things. Provide a workaround.

Task-number: QTBUG-37909
Change-Id: Idabd6ebb6e1447cb9bd92c7711a50aaa8575b9d6
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
This commit is contained in:
Laszlo Agocs 2014-04-01 13:25:18 +02:00 committed by The Qt Project
parent 0a86c31272
commit d8281a92b8

View File

@ -109,6 +109,11 @@ QSurfaceFormat QGLFormat::toSurfaceFormat(const QGLFormat &format)
retFormat.setMajorVersion(format.majorVersion());
retFormat.setMinorVersion(format.minorVersion());
retFormat.setProfile(static_cast<QSurfaceFormat::OpenGLContextProfile>(format.profile()));
// QGLFormat has no way to set DeprecatedFunctions, that is, to tell that forward
// compatibility should not be requested. Some drivers fail to ignore the fwdcompat
// bit with compatibility profiles so make sure it is not set.
if (format.profile() == QGLFormat::CompatibilityProfile)
retFormat.setOption(QSurfaceFormat::DeprecatedFunctions);
return retFormat;
}