Bug 1691925 - Block webrender on android devices which don't support GL_OES_EGL_image_external_essl3 r=aosmond

Currently webrender requires the extension
GL_OES_EGL_image_external_essl3 to render video. There exist some
older GLES 3 devices which do not support this extension, and
attempting to render video on these devices results in a shader
compilation error and falling back to OpenGL layers.

In bug 1507074 we will implement a long term solution for such
devices, but in the meantime block webrender on devices which do not
support this extension.

Differential Revision: https://phabricator.services.mozilla.com/D104669
This commit is contained in:
Jamie Nicol 2021-02-10 12:12:43 +00:00
Родитель 32111a8de6
Коммит 34795f555a
1 изменённых файлов: 22 добавлений и 0 удалений

Просмотреть файл

@ -25,6 +25,7 @@ class GfxInfo::GLStrings {
nsCString mVendor;
nsCString mRenderer;
nsCString mVersion;
nsTArray<nsCString> mExtensions;
bool mReady;
public:
@ -57,6 +58,11 @@ class GfxInfo::GLStrings {
// MOZ_GFX_SPOOF_GL_VERSION was set.
void SpoofVersion(const nsCString& s) { mVersion = s; }
const nsTArray<nsCString>& Extensions() {
EnsureInitialized();
return mExtensions;
}
void EnsureInitialized() {
if (mReady) {
return;
@ -104,6 +110,15 @@ class GfxInfo::GLStrings {
}
}
if (mExtensions.IsEmpty()) {
int numExtensions;
gl->fGetIntegerv(LOCAL_GL_NUM_EXTENSIONS, &numExtensions);
mExtensions.SetLength(numExtensions);
for (int i = 0; i < numExtensions; i++) {
mExtensions[i].Assign((const char*)gl->fGetStringi(LOCAL_GL_EXTENSIONS, i));
}
}
mReady = true;
}
};
@ -605,9 +620,16 @@ nsresult GfxInfo::GetFeatureStatusImpl(
gpu.Find("Mali-G76", /*ignoreCase*/ true) == kNotFound &&
gpu.Find("Mali-G31", /*ignoreCase*/ true) == kNotFound;
// Currently webrender requires the extension GL_OES_EGL_image_external_essl3
// to render video. Bug 1507074 tracks removing this requirement.
bool supportsImageExternalEssl3 = mGLStrings->Extensions().Contains("GL_OES_EGL_image_external_essl3"_ns);
if (!isUnblocked) {
*aStatus = nsIGfxInfo::FEATURE_BLOCKED_DEVICE;
aFailureId = "FEATURE_FAILURE_WEBRENDER_BLOCKED_DEVICE";
} else if (!supportsImageExternalEssl3) {
*aStatus = nsIGfxInfo::FEATURE_BLOCKED_DEVICE;
aFailureId = "FEATURE_FAILURE_WEBRENDER_NO_IMAGE_EXTERNAL";
} else {
*aStatus = nsIGfxInfo::FEATURE_ALLOW_QUALIFIED;
}