Bug 1347866 - Part3: ANGLE patch uplift for bug1325733; r?jgilbert draft
authorChih-Yi Leu <cleu@mozilla.com>
Wed, 05 Apr 2017 11:45:11 +0800
changeset 559629 7b2bb0148f3c408d1ed3bc3cbabb7637518d460f
parent 559628 5a5f0f04246bd5766d54c7a9526fd0c44b927192
child 559630 ff3cf53520145a5f977ef8df7e344cf8f4630bd5
push id53134
push userbmo:cleu@mozilla.com
push dateMon, 10 Apr 2017 08:50:37 +0000
reviewersjgilbert
bugs1347866, 1325733
milestone55.0a1
Bug 1347866 - Part3: ANGLE patch uplift for bug1325733; r?jgilbert MozReview-Commit-ID: F9QiJ3hDuoZ
gfx/angle/src/libANGLE/renderer/d3d/WorkaroundsD3D.h
gfx/angle/src/libANGLE/renderer/d3d/d3d11/Clear11.cpp
gfx/angle/src/libANGLE/renderer/d3d/d3d11/renderer11_utils.cpp
--- a/gfx/angle/src/libANGLE/renderer/d3d/WorkaroundsD3D.h
+++ b/gfx/angle/src/libANGLE/renderer/d3d/WorkaroundsD3D.h
@@ -90,20 +90,19 @@ struct WorkaroundsD3D
     // vertex shaders. To work around this bug, we translate -(int) into ~(int)+1.
     bool rewriteUnaryMinusOperator = false;
 
     // On some Intel drivers, using isnan() on highp float will get wrong answer. To work around
     // this bug, we use an expression to emulate function isnan(). Tracking bug:
     // https://crbug.com/650547
     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;
+    // On some Intel drivers, using clear() may not take effect. To work around this bug, we call
+    // clear() twice on these platforms. Tracking bug: https://crbug.com/655534
+    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;
 };
 
--- a/gfx/angle/src/libANGLE/renderer/d3d/d3d11/Clear11.cpp
+++ b/gfx/angle/src/libANGLE/renderer/d3d/d3d11/Clear11.cpp
@@ -366,33 +366,29 @@ gl::Error Clear11::clearFramebuffer(cons
 
                     D3D11_RECT rect;
                     rect.left   = clearParams.scissor.x;
                     rect.right  = clearParams.scissor.x + clearParams.scissor.width;
                     rect.top    = clearParams.scissor.y;
                     rect.bottom = clearParams.scissor.y + clearParams.scissor.height;
 
                     deviceContext1->ClearView(framebufferRTV, clearValues, &rect, 1);
-                    if (mRenderer->getWorkarounds().callClearTwiceOnSmallTarget)
+
+                    if (mRenderer->getWorkarounds().callClearTwice)
                     {
-                        if (clearParams.scissor.width <= 16 || clearParams.scissor.height <= 16)
-                        {
-                            deviceContext1->ClearView(framebufferRTV, clearValues, &rect, 1);
-                        }
+                        deviceContext1->ClearView(framebufferRTV, clearValues, &rect, 1);
                     }
                 }
                 else
                 {
                     deviceContext->ClearRenderTargetView(framebufferRTV, clearValues);
-                    if (mRenderer->getWorkarounds().callClearTwiceOnSmallTarget)
+
+                    if (mRenderer->getWorkarounds().callClearTwice)
                     {
-                        if (framebufferSize.width <= 16 || framebufferSize.height <= 16)
-                        {
-                            deviceContext->ClearRenderTargetView(framebufferRTV, clearValues);
-                        }
+                        deviceContext->ClearRenderTargetView(framebufferRTV, clearValues);
                     }
                 }
             }
         }
     }
 
     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
@@ -1854,17 +1854,17 @@ WorkaroundsD3D GenerateWorkarounds(const
 
     workarounds.preAddTexelFetchOffsets = IsIntel(adapterDesc.VendorId);
     workarounds.disableB5G6R5Support    = IsIntel(adapterDesc.VendorId);
     workarounds.rewriteUnaryMinusOperator =
         IsIntel(adapterDesc.VendorId) &&
         (IsBroadwell(adapterDesc.DeviceId) || IsHaswell(adapterDesc.DeviceId));
     workarounds.emulateIsnanFloat =
         IsIntel(adapterDesc.VendorId) && IsSkylake(adapterDesc.DeviceId);
-    workarounds.callClearTwiceOnSmallTarget =
+    workarounds.callClearTwice =
         IsIntel(adapterDesc.VendorId) && IsSkylake(adapterDesc.DeviceId);
 
     // TODO(jmadill): Disable when we have a fixed driver version.
     workarounds.emulateTinyStencilTextures = IsAMD(adapterDesc.VendorId);
 
     // The tiny stencil texture workaround involves using CopySubresource or UpdateSubresource on a
     // depth stencil texture.  This is not allowed until feature level 10.1 but since it is not
     // possible to support ES3 on these devices, there is no need for the workaround to begin with