mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 760675 - update adreno blacklisting to not use the global context - r=jrmuizel
The current Adreno blacklists hard-asserts (even in release builds) that there is a global context, as it needs it to get renderer info. That was done as, at the time (bug 736123) there were GL context creation crashes there. However, without share groups, I can't reproduce the context creation crashes anymore, so this approach doesn't seem to be needed anymore. If we were unlucky and there still were context creation crashes, the solution would be the java thread thing mentioned in comment 0, anyway.
This commit is contained in:
parent
0ccf130a40
commit
0cbd1cb517
@ -473,41 +473,6 @@ WebGLContext::SetDimensions(PRInt32 width, PRInt32 height)
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef ANDROID
|
||||
// bug 736123, blacklist WebGL on Adreno
|
||||
//
|
||||
// The Adreno driver in WebGL context creation, specifically in the first MakeCurrent
|
||||
// call on the newly created OpenGL context.
|
||||
//
|
||||
// Notice that we can't rely on GfxInfo for this blacklisting,
|
||||
// as GfxInfo on Android currently doesn't know the GL strings, which are,
|
||||
// AFAIK, the only way to identify Adreno GPUs.
|
||||
//
|
||||
// Somehow, the Layers' OpenGL context creation doesn't crash, and neither does
|
||||
// the global GL context creation. So we currently use the Renderer() id from the
|
||||
// global context. This is not future-proof, as the plan is to get rid of the global
|
||||
// context soon with OMTC. We need to replace this by getting the renderer id from
|
||||
// the Layers' GL context, but as with OMTC the LayerManager lives on a different
|
||||
// thread, this will have to involve some message-passing.
|
||||
if (!forceEnabled) {
|
||||
GLContext *globalContext = GLContextProvider::GetGlobalContext();
|
||||
if (!globalContext) {
|
||||
// make sure that we don't forget to update this code once the globalContext
|
||||
// is removed
|
||||
NS_RUNTIMEABORT("No global context anymore? Then you need to update "
|
||||
"this code, or force-enable WebGL.");
|
||||
}
|
||||
int renderer = globalContext->Renderer();
|
||||
if (renderer == gl::GLContext::RendererAdreno200 ||
|
||||
renderer == gl::GLContext::RendererAdreno205)
|
||||
{
|
||||
GenerateWarning("WebGL blocked on this Adreno driver!");
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// if we're forcing osmesa, do it first
|
||||
if (forceOSMesa) {
|
||||
gl = gl::GLContextProviderOSMesa::CreateOffscreen(gfxIntSize(width, height), format);
|
||||
|
@ -597,6 +597,20 @@ WebGLContext::InitAndValidateGL()
|
||||
return false;
|
||||
}
|
||||
|
||||
#ifdef ANDROID
|
||||
// bug 736123, blacklist WebGL on Adreno
|
||||
bool forceEnabled = Preferences::GetBool("webgl.force-enabled", false);
|
||||
if (!forceEnabled) {
|
||||
int renderer = gl->Renderer();
|
||||
if (renderer == gl::GLContext::RendererAdreno200 ||
|
||||
renderer == gl::GLContext::RendererAdreno205)
|
||||
{
|
||||
GenerateWarning("WebGL blocked on this Adreno driver!");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
mMinCapability = Preferences::GetBool("webgl.min_capability_mode", false);
|
||||
mDisableExtensions = Preferences::GetBool("webgl.disable-extensions", false);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user