Commit a28d04b2 by Nicolas Capens Committed by Nicolas Capens

Fix sign-correcting of masked stencil reference.

The stencil test compares the unsigned masked reference value against the unsigned masked stencil value. But because x86 vector instructions only support signed comparison, we have to add 0x80 to both sides. However, this offset was incorrectly added before the masking. Bug b/64683344 Change-Id: I49748e25d8d99e1c2b3c87d3dbe74a9dba75fb1c Reviewed-on: https://swiftshader-review.googlesource.com/12028Tested-by: 's avatarNicolas Capens <nicolascapens@google.com> Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com>
parent 660eba9a
......@@ -149,7 +149,7 @@ namespace sw
writeMaskQ = replicate(writeMask);
invWriteMaskQ = ~writeMaskQ;
referenceMaskedQ = referenceQ & testMaskQ;
referenceMaskedSignedQ = replicate((reference + 0x80) & 0xFF & testMask);
referenceMaskedSignedQ = replicate(((reference & testMask) + 0x80) & 0xFF);
}
static int64_t replicate(int b)
......
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