Commit 8b0f0b3b by Geoff Lang

Add a profile mask member to the FunctionsGL structure.

BUG=angleproject:883 Change-Id: I3cdf88391e77a26a77e120de0fd32296a2b079d1 Reviewed-on: https://chromium-review.googlesource.com/286822Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org> Tested-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent 951fffd3
...@@ -773,12 +773,12 @@ void FunctionsGL::initialize() ...@@ -773,12 +773,12 @@ void FunctionsGL::initialize()
{ {
// Grab the version number // Grab the version number
AssignGLEntryPoint(loadProcAddress("glGetString"), &getString); AssignGLEntryPoint(loadProcAddress("glGetString"), &getString);
AssignGLEntryPoint(loadProcAddress("glGetIntegerv"), &getIntegerv);
GetGLVersion(getString, &version, &standard); GetGLVersion(getString, &version, &standard);
// Grab the GL extensions // Grab the GL extensions
if (isAtLeastGL(gl::Version(3, 0))) if (isAtLeastGL(gl::Version(3, 0)))
{ {
AssignGLEntryPoint(loadProcAddress("glGetIntegerv"), &getIntegerv);
AssignGLEntryPoint(loadProcAddress("glGetStringi"), &getStringi); AssignGLEntryPoint(loadProcAddress("glGetStringi"), &getStringi);
extensions = GetIndexedExtensions(getIntegerv, getStringi); extensions = GetIndexedExtensions(getIntegerv, getStringi);
} }
...@@ -788,6 +788,16 @@ void FunctionsGL::initialize() ...@@ -788,6 +788,16 @@ void FunctionsGL::initialize()
angle::SplitStringAlongWhitespace(std::string(exts), &extensions); angle::SplitStringAlongWhitespace(std::string(exts), &extensions);
} }
// Check the context profile
if (isAtLeastGL(gl::Version(3, 2)))
{
getIntegerv(GL_CONTEXT_PROFILE_MASK, &profile);
}
else
{
profile = 0;
}
// 1.0 // 1.0
if (isAtLeastGL(gl::Version(1, 0))) if (isAtLeastGL(gl::Version(1, 0)))
{ {
......
...@@ -34,6 +34,7 @@ class FunctionsGL ...@@ -34,6 +34,7 @@ class FunctionsGL
// Version information // Version information
gl::Version version; gl::Version version;
StandardGL standard; StandardGL standard;
GLint profile;
bool isAtLeastGL(const gl::Version &glVersion) const; bool isAtLeastGL(const gl::Version &glVersion) const;
bool isAtLeastGLES(const gl::Version &glesVersion) const; bool isAtLeastGLES(const gl::Version &glesVersion) const;
......
...@@ -291,6 +291,19 @@ std::string RendererGL::getRendererDescription() const ...@@ -291,6 +291,19 @@ std::string RendererGL::getRendererDescription() const
rendererString << " ES"; rendererString << " ES";
} }
rendererString << " " << mFunctions->version.major << "." << mFunctions->version.minor; rendererString << " " << mFunctions->version.major << "." << mFunctions->version.minor;
if (mFunctions->standard == STANDARD_GL_DESKTOP)
{
// Some drivers (NVIDIA) use a profile mask of 0 when in compatibility profile.
if ((mFunctions->profile & GL_CONTEXT_COMPATIBILITY_PROFILE_BIT) != 0 ||
(mFunctions->isAtLeastGL(gl::Version(3, 2)) && mFunctions->profile == 0))
{
rendererString << " compatibility";
}
else if ((mFunctions->profile & GL_CONTEXT_CORE_PROFILE_BIT) != 0)
{
rendererString << " core";
}
}
return rendererString.str(); return rendererString.str();
} }
......
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