Commit b0e6e412 by Jiawei-Shao Committed by Commit Bot

Workaround clear issue on Intel Skylake D3D driver

On some Intel D3D drivers on Skylake, calling clear may take no effect. To work around this bug, we call clear() twice when we attempt to do clear on these platforms. BUG=chromium:655534 Change-Id: I3b05892e80e5797d268861e8f52e080f5175855b Reviewed-on: https://chromium-review.googlesource.com/398522 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 705a9194
...@@ -94,6 +94,11 @@ struct WorkaroundsD3D ...@@ -94,6 +94,11 @@ struct WorkaroundsD3D
// this bug, we use an expression to emulate function isnan(). Tracking bug: // this bug, we use an expression to emulate function isnan(). Tracking bug:
// https://crbug.com/650547 // https://crbug.com/650547
bool emulateIsnanFloat = false; 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;
}; };
} // namespace rx } // namespace rx
......
...@@ -371,10 +371,24 @@ gl::Error Clear11::clearFramebuffer(const ClearParameters &clearParams, ...@@ -371,10 +371,24 @@ gl::Error Clear11::clearFramebuffer(const ClearParameters &clearParams,
rect.bottom = clearParams.scissor.y + clearParams.scissor.height; rect.bottom = clearParams.scissor.y + clearParams.scissor.height;
deviceContext1->ClearView(framebufferRTV, clearValues, &rect, 1); deviceContext1->ClearView(framebufferRTV, clearValues, &rect, 1);
if (mRenderer->getWorkarounds().callClearTwiceOnSmallTarget)
{
if (clearParams.scissor.width <= 16 || clearParams.scissor.height <= 16)
{
deviceContext1->ClearView(framebufferRTV, clearValues, &rect, 1);
}
}
} }
else else
{ {
deviceContext->ClearRenderTargetView(framebufferRTV, clearValues); deviceContext->ClearRenderTargetView(framebufferRTV, clearValues);
if (mRenderer->getWorkarounds().callClearTwiceOnSmallTarget)
{
if (framebufferSize.width <= 16 || framebufferSize.height <= 16)
{
deviceContext->ClearRenderTargetView(framebufferRTV, clearValues);
}
}
} }
} }
} }
......
...@@ -1859,6 +1859,8 @@ WorkaroundsD3D GenerateWorkarounds(const Renderer11DeviceCaps &deviceCaps, ...@@ -1859,6 +1859,8 @@ WorkaroundsD3D GenerateWorkarounds(const Renderer11DeviceCaps &deviceCaps,
(IsBroadwell(adapterDesc.DeviceId) || IsHaswell(adapterDesc.DeviceId)); (IsBroadwell(adapterDesc.DeviceId) || IsHaswell(adapterDesc.DeviceId));
workarounds.emulateIsnanFloat = workarounds.emulateIsnanFloat =
IsIntel(adapterDesc.VendorId) && IsSkylake(adapterDesc.DeviceId); IsIntel(adapterDesc.VendorId) && IsSkylake(adapterDesc.DeviceId);
workarounds.callClearTwiceOnSmallTarget =
IsIntel(adapterDesc.VendorId) && IsSkylake(adapterDesc.DeviceId);
// TODO(jmadill): Disable when we have a fixed driver version. // TODO(jmadill): Disable when we have a fixed driver version.
workarounds.emulateTinyStencilTextures = IsAMD(adapterDesc.VendorId); workarounds.emulateTinyStencilTextures = IsAMD(adapterDesc.VendorId);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment