Bug 1347866 - Part3: ANGLE patch uplift for bug1325733; r?jgilbert
MozReview-Commit-ID: F9QiJ3hDuoZ
--- 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