Commit 904f6f92 by Nicolas Capens

Optimize flat triangle edge rasterization.

Change-Id: Ibfd483ce3cba6ec036327b32cba1460d68f8c9e8 Reviewed-on: https://swiftshader-review.googlesource.com/3542Tested-by: 's avatarNicolas Capens <capn@google.com> Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com>
parent 8157d5ce
...@@ -559,15 +559,8 @@ namespace sw ...@@ -559,15 +559,8 @@ namespace sw
{ {
If(Ya != Yb) If(Ya != Yb)
{ {
Int xMin = *Pointer<Int>(data + OFFSET(DrawData,scissorX0));
Int xMax = *Pointer<Int>(data + OFFSET(DrawData,scissorX1));
Bool swap = Yb < Ya; Bool swap = Yb < Ya;
Pointer<Byte> leftEdge = primitive + q * sizeof(Primitive) + OFFSET(Primitive,outline->left);
Pointer<Byte> rightEdge = primitive + q * sizeof(Primitive) + OFFSET(Primitive,outline->right);
Pointer<Byte> edge = IfThenElse(swap, rightEdge, leftEdge);
Int X1 = IfThenElse(swap, Xb, Xa); Int X1 = IfThenElse(swap, Xb, Xa);
Int X2 = IfThenElse(swap, Xa, Xb); Int X2 = IfThenElse(swap, Xa, Xb);
Int Y1 = IfThenElse(swap, Yb, Ya); Int Y1 = IfThenElse(swap, Yb, Ya);
...@@ -578,6 +571,13 @@ namespace sw ...@@ -578,6 +571,13 @@ namespace sw
If(y1 < y2) If(y1 < y2)
{ {
Int xMin = *Pointer<Int>(data + OFFSET(DrawData,scissorX0));
Int xMax = *Pointer<Int>(data + OFFSET(DrawData,scissorX1));
Pointer<Byte> leftEdge = primitive + q * sizeof(Primitive) + OFFSET(Primitive,outline->left);
Pointer<Byte> rightEdge = primitive + q * sizeof(Primitive) + OFFSET(Primitive,outline->right);
Pointer<Byte> edge = IfThenElse(swap, rightEdge, leftEdge);
// Deltas // Deltas
Int DX12 = X2 - X1; Int DX12 = X2 - X1;
Int DY12 = Y2 - Y1; Int DY12 = Y2 - Y1;
......
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