Bug 1371190 - (Rebase)Bug 1347866 - Part3: ANGLE patch uplift for bug1325733 draft
authorChih-Yi Leu <cleu@mozilla.com>
Wed, 05 Apr 2017 11:45:11 +0800
changeset 674754 d17f344ae3eb2d2ebae11aab2d7e67cfe083a389
parent 674753 bf4eb544841ed798cb02526e3c5f3e2c984aa607
child 674755 131f18244c4c9d8d0da1d64f092a604954777b8a
push id82933
push userbmo:cleu@mozilla.com
push dateWed, 04 Oct 2017 09:29:28 +0000
bugs1371190, 1347866, 1325733
milestone58.0a1
Bug 1371190 - (Rebase)Bug 1347866 - Part3: ANGLE patch uplift for bug1325733 MozReview-Commit-ID: F9QiJ3hDuoZ --HG-- extra : rebase_source : bce9e62497c8699ac65d81e0cc2d101a36743d7a
gfx/angle/include/platform/WorkaroundsD3D.h
gfx/angle/src/libANGLE/renderer/d3d/d3d11/Clear11.cpp
gfx/angle/src/libANGLE/renderer/d3d/d3d11/renderer11_utils.cpp
--- a/gfx/angle/include/platform/WorkaroundsD3D.h
+++ b/gfx/angle/include/platform/WorkaroundsD3D.h
@@ -95,17 +95,17 @@ struct WorkaroundsD3D
     // this bug, we use an expression to emulate function isnan().
     // Tracking bug: https://crbug.com/650547
     // This driver bug is fixed in 21.20.16.4542.
     bool emulateIsnanFloat = false;
 
     // On some Intel drivers, using clear() may not take effect. One of such situation is to clear
     // a target with width or height < 16. To work around this bug, we call clear() twice on these
     // platforms. Tracking bug: https://crbug.com/655534
-    bool callClearTwiceOnSmallTarget = false;
+    bool callClearTwice = false;
 
     // On some Intel drivers, copying from staging storage to constant buffer storage does not
     // seem to work. Work around this by keeping system memory storage as a canonical reference
     // for buffer data.
     // D3D11-only workaround. See http://crbug.com/593024.
     bool useSystemMemoryForConstantBuffers = false;
 
     // This workaround is for the ANGLE_multiview extension. If enabled the viewport or render
--- a/gfx/angle/src/libANGLE/renderer/d3d/d3d11/Clear11.cpp
+++ b/gfx/angle/src/libANGLE/renderer/d3d/d3d11/Clear11.cpp
@@ -592,35 +592,29 @@ gl::Error Clear11::clearFramebuffer(cons
             if (needScissoredClear)
             {
                 // We shouldn't reach here if deviceContext1 is unavailable.
                 ASSERT(deviceContext1);
                 // There must be at least one scissor rectangle.
                 ASSERT(!scissorRects.empty());
                 deviceContext1->ClearView(framebufferRTV.get(), clearValues, scissorRects.data(),
                                           static_cast<UINT>(scissorRects.size()));
-                if (mRenderer->getWorkarounds().callClearTwiceOnSmallTarget)
+                if (mRenderer->getWorkarounds().callClearTwice)
                 {
-                    if (clearParams.scissor.width <= 16 || clearParams.scissor.height <= 16)
-                    {
-                        deviceContext1->ClearView(framebufferRTV.get(), clearValues,
-                                                  scissorRects.data(),
-                                                  static_cast<UINT>(scissorRects.size()));
-                    }
+                    deviceContext1->ClearView(framebufferRTV.get(), clearValues,
+                                              scissorRects.data(),
+                                              static_cast<UINT>(scissorRects.size()));
                 }
             }
             else
             {
                 deviceContext->ClearRenderTargetView(framebufferRTV.get(), clearValues);
-                if (mRenderer->getWorkarounds().callClearTwiceOnSmallTarget)
+                if (mRenderer->getWorkarounds().callClearTwice)
                 {
-                    if (framebufferSize.width <= 16 || framebufferSize.height <= 16)
-                    {
-                        deviceContext->ClearRenderTargetView(framebufferRTV.get(), clearValues);
-                    }
+                    deviceContext->ClearRenderTargetView(framebufferRTV.get(), clearValues);
                 }
             }
         }
     }
 
     ID3D11DepthStencilView *dsv = nullptr;
 
     if (clearParams.clearDepth || clearParams.clearStencil)
--- a/gfx/angle/src/libANGLE/renderer/d3d/d3d11/renderer11_utils.cpp
+++ b/gfx/angle/src/libANGLE/renderer/d3d/d3d11/renderer11_utils.cpp
@@ -2078,17 +2078,17 @@ angle::WorkaroundsD3D GenerateWorkaround
     if (IsIntel(adapterDesc.VendorId))
     {
         workarounds.preAddTexelFetchOffsets           = true;
         workarounds.useSystemMemoryForConstantBuffers = true;
         workarounds.disableB5G6R5Support =
             d3d11_gl::GetIntelDriverVersion(deviceCaps.driverVersion) < IntelDriverVersion(4539);
         if (IsSkylake(adapterDesc.DeviceId))
         {
-            workarounds.callClearTwiceOnSmallTarget =
+            workarounds.callClearTwice =
                 d3d11_gl::GetIntelDriverVersion(deviceCaps.driverVersion) <
                 IntelDriverVersion(4771);
             workarounds.emulateIsnanFloat =
                 d3d11_gl::GetIntelDriverVersion(deviceCaps.driverVersion) <
                 IntelDriverVersion(4542);
         }
         else if (IsBroadwell(adapterDesc.DeviceId) || IsHaswell(adapterDesc.DeviceId))
         {