Plumb robust resource init extensions.
This also cleans up a few minor glitches in the extension texts,
and renames the EGL extension for consistency.
It incidentally fixes a bug in our EGL init where we were checking
the wrong client versions for KHR_create_context.
It also implements a new feature for tests which allow them to defer
Context creation until the test body. This allows tests to check for
EGL extension available before trying to create a context with certain
extensions.
BUG=angleproject:1635
Change-Id: I9311991332c357e36214082b16f2a4a57bfa8865
Reviewed-on: https://chromium-review.googlesource.com/450920
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
diff --git a/src/libANGLE/State.cpp b/src/libANGLE/State.cpp
index 5ec2090..c47824c 100644
--- a/src/libANGLE/State.cpp
+++ b/src/libANGLE/State.cpp
@@ -62,7 +62,8 @@
mPrimitiveRestart(false),
mMultiSampling(false),
mSampleAlphaToOne(false),
- mFramebufferSRGB(true)
+ mFramebufferSRGB(true),
+ mRobustResourceInit(false)
{
}
@@ -75,7 +76,8 @@
const Version &clientVersion,
bool debug,
bool bindGeneratesResource,
- bool clientArraysEnabled)
+ bool clientArraysEnabled,
+ bool robustResourceInit)
{
mMaxDrawBuffers = caps.maxDrawBuffers;
mMaxCombinedTextureImageUnits = caps.maxCombinedTextureImageUnits;
@@ -214,6 +216,8 @@
mPathStencilFunc = GL_ALWAYS;
mPathStencilRef = 0;
mPathStencilMask = std::numeric_limits<GLuint>::max();
+
+ mRobustResourceInit = robustResourceInit;
}
void State::reset(const Context *context)
@@ -697,6 +701,8 @@
return areClientArraysEnabled();
case GL_FRAMEBUFFER_SRGB_EXT:
return getFramebufferSRGB();
+ case GL_CONTEXT_ROBUST_RESOURCE_INITIALIZATION_ANGLE:
+ return mRobustResourceInit;
default: UNREACHABLE(); return false;
}
}
@@ -1589,6 +1595,9 @@
case GL_FRAMEBUFFER_SRGB_EXT:
*params = getFramebufferSRGB() ? GL_TRUE : GL_FALSE;
break;
+ case GL_CONTEXT_ROBUST_RESOURCE_INITIALIZATION_ANGLE:
+ *params = mRobustResourceInit ? GL_TRUE : GL_FALSE;
+ break;
default:
UNREACHABLE();
break;