Commit a0ef97a3 by Alexis Hetu Committed by Alexis Hétu

Precision fix for inversesqrt.

Fixes all dEQP failures in inversesqrt and normalize. Change-Id: Ifd1ac2714fa95bab1c720b65c95a27bbf23ea933 Reviewed-on: https://swiftshader-review.googlesource.com/13728Tested-by: 's avatarAlexis Hétu <sugoi@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com>
parent 0b7003bd
...@@ -227,7 +227,7 @@ namespace sw ...@@ -227,7 +227,7 @@ namespace sw
Float4 rsq; Float4 rsq;
if(!pp && rsqPrecision >= IEEE) if(!pp)
{ {
rsq = Float4(1.0f) / Sqrt(abs); rsq = Float4(1.0f) / Sqrt(abs);
} }
...@@ -239,10 +239,9 @@ namespace sw ...@@ -239,10 +239,9 @@ namespace sw
{ {
rsq = rsq * (Float4(3.0f) - rsq * rsq * abs) * Float4(0.5f); rsq = rsq * (Float4(3.0f) - rsq * rsq * abs) * Float4(0.5f);
} }
}
int big = 0x7F7FFFFF; rsq = As<Float4>(CmpNEQ(As<Int4>(abs), Int4(0x7F800000)) & As<Int4>(rsq));
rsq = Min(rsq, Float4((float&)big)); }
return rsq; return rsq;
} }
......
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