Commit 7a8ed2e1 by Alexis Hetu Committed by Alexis Hétu

Prevent initializing outline edges to out of bound values

When multisampling is enabled, outline edges were getting initialized to one of the primitive's X position. If the primitive was out of bounds, then the default position was out of bounds, which led to an initial out of bounds memory access. Added a clamp to fix the issue. Bug chromium:779364 Change-Id: I4661f4229ee28a3032c763ed18dde799d3c3926b Reviewed-on: https://swiftshader-review.googlesource.com/13528Tested-by: 's avatarAlexis Hétu <sugoi@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com>
parent 3d7c786f
......@@ -224,7 +224,9 @@ namespace sw
if(state.multiSample > 1)
{
Short x = Short((X[0] + 0xF) >> 4);
Int xMin = *Pointer<Int>(data + OFFSET(DrawData, scissorX0));
Int xMax = *Pointer<Int>(data + OFFSET(DrawData, scissorX1));
Short x = Short(Clamp((X[0] + 0xF) >> 4, xMin, xMax));
For(Int y = yMin - 1, y < yMax + 1, y++)
{
......
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