Bug 1003293 - Addition: Properly detect optimus on all different build. r=bas

This commit is contained in:
Vladimir Vukicevic 2014-05-10 12:43:01 -04:00
parent c7b4c78ee5
commit 24ef8f30ff

View File

@ -1486,7 +1486,18 @@ gfxWindowsPlatform::GetD3D11Device()
bool
gfxWindowsPlatform::IsOptimus()
{
return GetModuleHandleA("nvumdshim.dll");
static int knowIsOptimus = -1;
if (knowIsOptimus == -1) {
// other potential optimus -- nvd3d9wrapx.dll & nvdxgiwrap.dll
if (GetModuleHandleA("nvumdshim.dll") ||
GetModuleHandleA("nvumdshimx.dll"))
{
knowIsOptimus = 1;
} else {
knowIsOptimus = 0;
}
}
return knowIsOptimus;
}
int