Commit dd2eb504 by Geoff Lang

Always use the highest GL version available unless requested.

BUG=angleproject:890 Change-Id: I76a1b1c455cb4be02b4b5c52153f5c87f33d426d Reviewed-on: https://chromium-review.googlesource.com/275008Reviewed-by: 's avatarKenneth Russell <kbr@chromium.org> Tested-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent e44e829d
...@@ -238,17 +238,24 @@ egl::Error DisplayWGL::initialize(egl::Display *display) ...@@ -238,17 +238,24 @@ egl::Error DisplayWGL::initialize(egl::Display *display)
// TODO: handle robustness // TODO: handle robustness
int mask = 0; int mask = 0;
// Request core profile, TODO: Don't request core if requested GL version is less than 3.0 // Request core profile
mask |= WGL_CONTEXT_CORE_PROFILE_BIT_ARB; mask |= WGL_CONTEXT_CORE_PROFILE_BIT_ARB;
std::vector<int> contextCreationAttibutes; std::vector<int> contextCreationAttibutes;
// TODO: create a context version based on the requested version and validate the version numbers // Don't request a specific version unless the user wants one. WGL will return the highest version
contextCreationAttibutes.push_back(WGL_CONTEXT_MAJOR_VERSION_ARB); // that the driver supports if no version is requested.
contextCreationAttibutes.push_back(3); const egl::AttributeMap &displayAttributes = display->getAttributeMap();
EGLint requestedMajorVersion = displayAttributes.get(EGL_PLATFORM_ANGLE_MAX_VERSION_MAJOR_ANGLE, EGL_DONT_CARE);
EGLint requestedMinorVersion = displayAttributes.get(EGL_PLATFORM_ANGLE_MAX_VERSION_MINOR_ANGLE, EGL_DONT_CARE);
if (requestedMajorVersion != EGL_DONT_CARE && requestedMinorVersion != EGL_DONT_CARE)
{
contextCreationAttibutes.push_back(WGL_CONTEXT_MAJOR_VERSION_ARB);
contextCreationAttibutes.push_back(requestedMajorVersion);
contextCreationAttibutes.push_back(WGL_CONTEXT_MINOR_VERSION_ARB); contextCreationAttibutes.push_back(WGL_CONTEXT_MINOR_VERSION_ARB);
contextCreationAttibutes.push_back(1); contextCreationAttibutes.push_back(requestedMinorVersion);
}
// Set the flag attributes // Set the flag attributes
if (flags != 0) if (flags != 0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment