зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1339256 - Double-check robustness. - r=daoshengmu
MozReview-Commit-ID: 20csUTf7q6e
This commit is contained in:
Родитель
0e274f58a3
Коммит
0846c32c64
|
@ -1009,6 +1009,11 @@ GLContext::InitWithPrefixImpl(const char* prefix, bool trygl)
|
|||
|
||||
////////////////
|
||||
|
||||
const auto err = mSymbols.fGetError();
|
||||
MOZ_RELEASE_ASSERT(!err);
|
||||
if (err)
|
||||
return false;
|
||||
|
||||
LoadMoreSymbols(prefix, trygl);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -1145,6 +1150,14 @@ GLContext::LoadMoreSymbols(const char* prefix, bool trygl)
|
|||
return fnLoadForFeature(list, feature);
|
||||
};
|
||||
|
||||
if (IsSupported(GLFeature::robustness)) {
|
||||
const auto resetStrategy = GetIntAs<GLuint>(LOCAL_GL_RESET_NOTIFICATION_STRATEGY);
|
||||
if (resetStrategy != LOCAL_GL_LOSE_CONTEXT_ON_RESET) {
|
||||
MOZ_ASSERT(resetStrategy == LOCAL_GL_NO_RESET_NOTIFICATION);
|
||||
NS_WARNING("Robustness supported, but not active!");
|
||||
MarkUnsupported(GLFeature::robustness);
|
||||
}
|
||||
}
|
||||
if (IsSupported(GLFeature::robustness)) {
|
||||
const SymLoadStruct symbols[] = {
|
||||
{ (PRFuncPtr*) &mSymbols.fGetGraphicsResetStatus, { "GetGraphicsResetStatus",
|
||||
|
@ -1154,7 +1167,13 @@ GLContext::LoadMoreSymbols(const char* prefix, bool trygl)
|
|||
nullptr } },
|
||||
END_SYMBOLS
|
||||
};
|
||||
fnLoadForFeature(symbols, GLFeature::sync);
|
||||
if (fnLoadForFeature(symbols, GLFeature::robustness)) {
|
||||
const auto status = mSymbols.fGetGraphicsResetStatus();
|
||||
MOZ_ALWAYS_TRUE(!status);
|
||||
|
||||
const auto err = mSymbols.fGetError();
|
||||
MOZ_ALWAYS_TRUE(!err);
|
||||
}
|
||||
}
|
||||
|
||||
if (IsSupported(GLFeature::sync)) {
|
||||
|
|
|
@ -81,7 +81,9 @@
|
|||
// Others
|
||||
#define LOCAL_EGL_PRESERVED_RESOURCES 0x3030
|
||||
#define LOCAL_EGL_CONTEXT_RESET_NOTIFICATION_STRATEGY_EXT 0x3138
|
||||
#define LOCAL_GL_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB 0x8256
|
||||
#define LOCAL_GL_RESET_NOTIFICATION_STRATEGY 0x8256
|
||||
#define LOCAL_GL_LOSE_CONTEXT_ON_RESET 0x8252
|
||||
#define LOCAL_GL_NO_RESET_NOTIFICATION 0x8261
|
||||
#define LOCAL_GL_CONTEXT_LOST 0x9242
|
||||
#define LOCAL_GL_CONTEXT_FLAGS_ARB 0x2094
|
||||
#define LOCAL_GL_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001
|
||||
|
|
Загрузка…
Ссылка в новой задаче