Make Reactor destination variables non-const. Bug swiftshader:27 Change-Id: I53e2e4858b10d810f649907fda98dc7863752551 Reviewed-on: https://swiftshader-review.googlesource.com/8090 Reviewed-by: Nicolas Capens <capn@google.com> Tested-by: Nicolas Capens <capn@google.com> Reviewed-on: https://swiftshader-review.googlesource.com/8232 Reviewed-by: Alexis Hétu <sugoi@google.com>
diff --git a/src/Shader/SetupRoutine.cpp b/src/Shader/SetupRoutine.cpp index 1845047..c31bbec 100644 --- a/src/Shader/SetupRoutine.cpp +++ b/src/Shader/SetupRoutine.cpp
@@ -555,25 +555,23 @@ } } - void SetupRoutine::edge(Pointer<Byte> &primitive, Pointer<Byte> &data, const Int &X1, const Int &Y1, const Int &X2, const Int &Y2, Int &q) + void SetupRoutine::edge(Pointer<Byte> &primitive, Pointer<Byte> &data, const Int &Xa, const Int &Ya, const Int &Xb, const Int &Yb, Int &q) { - If(Y1 != Y2) + If(Ya != Yb) { Int xMin = *Pointer<Int>(data + OFFSET(DrawData,scissorX0)); Int xMax = *Pointer<Int>(data + OFFSET(DrawData,scissorX1)); - Bool swap = Y2 < Y1; + 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 X0 = X1; - Int Y0 = Y1; - X1 = IfThenElse(swap, X2, X1); - X2 = IfThenElse(swap, X0, X2); - Y1 = IfThenElse(swap, Y2, Y1); - Y2 = IfThenElse(swap, Y0, Y2); + Int X1 = IfThenElse(swap, Xb, Xa); + Int X2 = IfThenElse(swap, Xa, Xb); + Int Y1 = IfThenElse(swap, Yb, Ya); + Int Y2 = IfThenElse(swap, Ya, Yb); Int y1 = Max((Y1 + 0x0000000F) >> 4, *Pointer<Int>(data + OFFSET(DrawData,scissorY0))); Int y2 = Min((Y2 + 0x0000000F) >> 4, *Pointer<Int>(data + OFFSET(DrawData,scissorY1)));