/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// This spoofed value wins, even if the environment variable // MOZ_GFX_SPOOF_GL_RENDERER was set. void SpoofRenderer(const nsCString& s) { mRenderer = s; }
// This spoofed value wins, even if the environment variable // MOZ_GFX_SPOOF_GL_VERSION was set. void SpoofVersion(const nsCString& s) { mVersion = s; }
if (!gl) { // Setting mReady to true here means that we won't retry. Everything will // remain blocklisted forever. Ideally, we would like to update that once // any GLContext is successfully created, like the compositor's GLContext.
mReady = true; return;
}
gl->MakeCurrent();
if (mVendor.IsEmpty()) { constchar* spoofedVendor = PR_GetEnv("MOZ_GFX_SPOOF_GL_VENDOR"); if (spoofedVendor) {
mVendor.Assign(spoofedVendor);
} else {
mVendor.Assign((constchar*)gl->fGetString(LOCAL_GL_VENDOR));
}
}
if (mRenderer.IsEmpty()) { constchar* spoofedRenderer = PR_GetEnv("MOZ_GFX_SPOOF_GL_RENDERER"); if (spoofedRenderer) {
mRenderer.Assign(spoofedRenderer);
} else {
mRenderer.Assign((constchar*)gl->fGetString(LOCAL_GL_RENDERER));
}
}
if (mVersion.IsEmpty()) { constchar* spoofedVersion = PR_GetEnv("MOZ_GFX_SPOOF_GL_VERSION"); if (spoofedVersion) {
mVersion.Assign(spoofedVersion);
} else {
mVersion.Assign((constchar*)gl->fGetString(LOCAL_GL_VERSION));
}
}
if (mExtensions.IsEmpty()) {
nsCString rawExtensions;
rawExtensions.Assign((constchar*)gl->fGetString(LOCAL_GL_EXTENSIONS));
rawExtensions.Trim(" ");
for (auto extension : rawExtensions.Split(' ')) {
mExtensions.AppendElement(extension);
}
}
/* GetD2DEnabled and GetDwriteEnabled shouldn't be called until after * gfxPlatform initialization has occurred because they depend on it for
* information. (See bug 591561) */
nsresult GfxInfo::GetD2DEnabled(bool* aEnabled) { return NS_ERROR_FAILURE; }
// OpenGL layers are never blocklisted on Android. // This early return is so we avoid potentially slow // GLStrings initialization on startup when we initialize GL layers. if (aFeature == nsIGfxInfo::FEATURE_OPENGL_LAYERS) {
*aStatus = nsIGfxInfo::FEATURE_STATUS_OK; return NS_OK;
}
if (isMali4xx) { // Mali 4xx does not support GLES 3.
*aStatus = nsIGfxInfo::FEATURE_BLOCKED_DEVICE;
aFailureId = "FEATURE_FAILURE_NO_GLES_3";
} elseif (isPowerVrG6110) { // Blocked on PowerVR Rogue G6110 due to bug 1742986 and bug 1717863.
*aStatus = nsIGfxInfo::FEATURE_BLOCKED_DEVICE;
aFailureId = "FEATURE_FAILURE_POWERVR_G6110";
} elseif (isVivanteGC7000UL) { // Blocked on Vivante GC7000UL due to bug 1719327.
*aStatus = nsIGfxInfo::FEATURE_BLOCKED_DEVICE;
aFailureId = "FEATURE_FAILURE_VIVANTE_GC7000UL";
} elseif (isPowerVrFenceSyncCrash) { // Blocked on various PowerVR GPUs due to bug 1773128.
*aStatus = nsIGfxInfo::FEATURE_BLOCKED_DEVICE;
aFailureId = "FEATURE_FAILURE_POWERVR_FENCE_SYNC_CRASH";
} else {
*aStatus = nsIGfxInfo::FEATURE_STATUS_OK;
} return NS_OK;
}
if (aFeature == FEATURE_WEBRENDER_SCISSORED_CACHE_CLEARS) { // Emulator with SwiftShader is buggy when attempting to clear picture // cache textures with a scissor rect set. constbool isEmulatorSwiftShader =
mGLStrings->Renderer().Find( "Android Emulator OpenGL ES Translator (Google SwiftShader)") >=
0; if (isEmulatorSwiftShader) {
*aStatus = nsIGfxInfo::FEATURE_BLOCKED_DEVICE;
aFailureId = "FEATURE_FAILURE_BUG_1603515";
} else {
*aStatus = nsIGfxInfo::FEATURE_STATUS_OK;
} return NS_OK;
}
if (aFeature == FEATURE_WEBRENDER_SHADER_CACHE) { // Program binaries are known to be buggy on Adreno 3xx. While we haven't // encountered any correctness or stability issues with them, loading them // fails more often than not, so is a waste of time. Better to just not // even attempt to cache them. See bug 1615574. constbool isAdreno3xx =
mGLStrings->Renderer().LowerCaseFindASCII("adreno (tm) 3") >= 0; if (isAdreno3xx) {
*aStatus = nsIGfxInfo::FEATURE_BLOCKED_DEVICE;
aFailureId = "FEATURE_FAILURE_ADRENO_3XX";
} else {
*aStatus = nsIGfxInfo::FEATURE_STATUS_OK;
}
}
if (aFeature == FEATURE_WEBRENDER_OPTIMIZED_SHADERS) { // Optimized shaders result in completely broken rendering on some Mali-T // devices. We have seen this on T6xx, T7xx, and T8xx on android versions // up to 5.1, and on T6xx on versions up to android 7.1. As a precaution // disable for all Mali-T regardless of version. See bug 1689064 and bug // 1707283 for details. constbool isMaliT =
mGLStrings->Renderer().LowerCaseFindASCII("mali-t") >= 0; if (isMaliT) {
*aStatus = nsIGfxInfo::FEATURE_BLOCKED_DEVICE;
aFailureId = "FEATURE_FAILURE_BUG_1689064";
} else {
*aStatus = nsIGfxInfo::FEATURE_STATUS_OK;
} return NS_OK;
}
if (aFeature == FEATURE_WEBRENDER_PARTIAL_PRESENT) { // Block partial present on some devices due to rendering issues. // On Mali-Txxx due to bug 1680087 and bug 1707815. // On Adreno 3xx GPUs due to bug 1695771. constbool isMaliT =
mGLStrings->Renderer().LowerCaseFindASCII("mali-t") >= 0; constbool isAdreno3xx =
mGLStrings->Renderer().LowerCaseFindASCII("adreno (tm) 3") >= 0; if (isMaliT || isAdreno3xx) {
*aStatus = nsIGfxInfo::FEATURE_BLOCKED_DEVICE;
aFailureId = "FEATURE_FAILURE_BUG_1680087_1695771_1707815";
} else {
*aStatus = nsIGfxInfo::FEATURE_STATUS_OK;
} return NS_OK;
}
}
if (aFeature == FEATURE_GL_SWIZZLE) { // Swizzling appears to be buggy on PowerVR Rogue devices with webrender. // See bug 1704783. constbool isPowerVRRogue =
mGLStrings->Renderer().LowerCaseFindASCII("powervr rogue") >= 0; if (isPowerVRRogue) {
*aStatus = nsIGfxInfo::FEATURE_BLOCKED_DEVICE;
aFailureId = "FEATURE_FAILURE_POWERVR_ROGUE";
} else {
*aStatus = nsIGfxInfo::FEATURE_STATUS_OK;
} return NS_OK;
}
if (aFeature == FEATURE_WEBGPU) { // Ensure WebGPU is disabled by default on Android until it is better // tested.
*aStatus = nsIGfxInfo::FEATURE_BLOCKED_DEVICE;
aFailureId = "FEATURE_FAILURE_WEBGPU_ANDROID"; return NS_OK;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.