Enable always-available extensions in gl::Context.
We can consolidate exposing these extensions in initCaps. Otherwise
we have to maintain the lists in every Renderer back-end.
Also do the same treatment for select egl::Display extensions.
BUG=angleproject:1319
Change-Id: I529dd120c6d2cdbb789bd9dd20491e796e97f3f6
Reviewed-on: https://chromium-review.googlesource.com/345914
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
diff --git a/src/libANGLE/Context.cpp b/src/libANGLE/Context.cpp
index ab25be8..72ff2a5 100644
--- a/src/libANGLE/Context.cpp
+++ b/src/libANGLE/Context.cpp
@@ -149,7 +149,7 @@
{
ASSERT(!mRobustAccess); // Unimplemented
- initCaps(mClientVersion);
+ initCaps();
mState.initialize(mCaps, mExtensions, mClientVersion, GetDebug(attribs));
@@ -2077,7 +2077,7 @@
return false;
}
-void Context::initCaps(GLuint clientVersion)
+void Context::initCaps()
{
mCaps = mImplementation->getNativeCaps();
@@ -2085,19 +2085,26 @@
mLimitations = mImplementation->getNativeLimitations();
- if (clientVersion < 3)
+ if (mClientVersion < 3)
{
// Disable ES3+ extensions
mExtensions.colorBufferFloat = false;
mExtensions.eglImageExternalEssl3 = false;
}
- if (clientVersion > 2)
+ if (mClientVersion > 2)
{
// FIXME(geofflang): Don't support EXT_sRGB in non-ES2 contexts
//mExtensions.sRGB = false;
}
+ // Some extensions are always available because they are implemented in the GL layer.
+ mExtensions.bindUniformLocation = true;
+ mExtensions.vertexArrayObject = true;
+
+ // Enable the no error extension if the context was created with the flag.
+ mExtensions.noError = mSkipValidation;
+
// Explicitly enable GL_KHR_debug
mExtensions.debug = true;
mExtensions.maxDebugMessageLength = 1024;
@@ -2126,11 +2133,11 @@
// Caps are AND'd with the renderer caps because some core formats are still unsupported in
// ES3.
formatCaps.texturable =
- formatCaps.texturable && formatInfo.textureSupport(clientVersion, mExtensions);
+ formatCaps.texturable && formatInfo.textureSupport(mClientVersion, mExtensions);
formatCaps.renderable =
- formatCaps.renderable && formatInfo.renderSupport(clientVersion, mExtensions);
+ formatCaps.renderable && formatInfo.renderSupport(mClientVersion, mExtensions);
formatCaps.filterable =
- formatCaps.filterable && formatInfo.filterSupport(clientVersion, mExtensions);
+ formatCaps.filterable && formatInfo.filterSupport(mClientVersion, mExtensions);
// OpenGL ES does not support multisampling with integer formats
if (!formatInfo.renderSupport || formatInfo.componentType == GL_INT || formatInfo.componentType == GL_UNSIGNED_INT)