Bug 1574299. Allow INTERNAL_THREADING_OPTIMIZATIONS when using WARP. r=aosmond
authorJeff Muizelaar <jrmuizel@gmail.com>
Thu, 15 Aug 2019 22:37:43 +0000
changeset 488421 25abe5d28a6a8d7f70f05449e6a850379877d159
parent 488420 aa2a510029838127f903e0e72fb5190ee427e5fa
child 488422 19443ebbd552f2d4240cbc5fc1a8a6af815f5323
push id36443
push userccoroiu@mozilla.com
push dateFri, 16 Aug 2019 09:48:15 +0000
treeherdermozilla-central@5d4cbfe103bb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaosmond
bugs1574299
milestone70.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1574299. Allow INTERNAL_THREADING_OPTIMIZATIONS when using WARP. r=aosmond This seems to make a big difference when running tests with WARP. e.g. Assertion failure: frameInfo.mDocFramesSeen == frameInfo.mDocFramesTotal, at z:/build/build/src/gfx/webrender_bindings/RenderThread.cpp:303 and various other browser chrome test failures. The original problem that added this flag only impacted AMD hardware as I recall and we are unlikely to ever be running on WARP in production anyways. When WARP is forced we also don't disable INTERNAL_THREADING_OPTIMIZATIONS. Differential Revision: https://phabricator.services.mozilla.com/D42214
gfx/thebes/DeviceManagerDx.cpp
--- a/gfx/thebes/DeviceManagerDx.cpp
+++ b/gfx/thebes/DeviceManagerDx.cpp
@@ -446,20 +446,28 @@ bool DeviceManagerDx::CreateCompositorDe
   // Check if a failure was injected for testing.
   if (StaticPrefs::gfx_testing_device_fail()) {
     aD3d11.SetFailed(FeatureStatus::Failed,
                      "Direct3D11 device failure simulated by preference",
                      NS_LITERAL_CSTRING("FEATURE_FAILURE_D3D11_SIM"));
     return false;
   }
 
-  // Use D3D11_CREATE_DEVICE_PREVENT_INTERNAL_THREADING_OPTIMIZATIONS
-  // to prevent bug 1092260. IE 11 also uses this flag.
-  UINT flags = D3D11_CREATE_DEVICE_BGRA_SUPPORT |
-               D3D11_CREATE_DEVICE_PREVENT_INTERNAL_THREADING_OPTIMIZATIONS;
+  UINT flags = D3D11_CREATE_DEVICE_BGRA_SUPPORT;
+
+  DXGI_ADAPTER_DESC desc;
+  aAdapter->GetDesc(&desc);
+  if (desc.VendorId != 0x1414) {
+    // 0x1414 is Microsoft (e.g. WARP)
+    // When not using WARP, use
+    // D3D11_CREATE_DEVICE_PREVENT_INTERNAL_THREADING_OPTIMIZATIONS to prevent
+    // bug 1092260. IE 11 also uses this flag.
+    flags |= D3D11_CREATE_DEVICE_PREVENT_INTERNAL_THREADING_OPTIMIZATIONS;
+  }
+
   if (aAttemptVideoSupport) {
     flags |= D3D11_CREATE_DEVICE_VIDEO_SUPPORT;
   }
 
   HRESULT hr;
   RefPtr<ID3D11Device> device;
   if (!CreateDevice(aAdapter, D3D_DRIVER_TYPE_UNKNOWN, flags, hr, device)) {
     if (!aAttemptVideoSupport) {