Commit 9dcefbcb by Nicolas Capens

Make Reactor destination variables non-const.

Bug swiftshader:27 Change-Id: I53e2e4858b10d810f649907fda98dc7863752551 Reviewed-on: https://swiftshader-review.googlesource.com/8090Reviewed-by: 's avatarNicolas Capens <capn@google.com> Tested-by: 's avatarNicolas Capens <capn@google.com>
parent b5bdd27f
...@@ -29,10 +29,10 @@ namespace sw ...@@ -29,10 +29,10 @@ namespace sw
virtual ~Rasterizer() {}; virtual ~Rasterizer() {};
protected: protected:
const Pointer<Byte> primitive; Pointer<Byte> primitive;
const Int count; Int count;
const Int cluster; Int cluster;
const Pointer<Byte> data; Pointer<Byte> data;
}; };
} }
......
...@@ -868,7 +868,7 @@ namespace sw ...@@ -868,7 +868,7 @@ namespace sw
} }
} }
void PixelRoutine::blendFactor(const Vector4s &blendFactor, const Vector4s &current, const Vector4s &pixel, BlendFactor blendFactorActive) void PixelRoutine::blendFactor(Vector4s &blendFactor, const Vector4s &current, const Vector4s &pixel, BlendFactor blendFactorActive)
{ {
switch(blendFactorActive) switch(blendFactorActive)
{ {
...@@ -949,7 +949,7 @@ namespace sw ...@@ -949,7 +949,7 @@ namespace sw
} }
} }
void PixelRoutine::blendFactorAlpha(const Vector4s &blendFactor, const Vector4s &current, const Vector4s &pixel, BlendFactor blendFactorAlphaActive) void PixelRoutine::blendFactorAlpha(Vector4s &blendFactor, const Vector4s &current, const Vector4s &pixel, BlendFactor blendFactorAlphaActive)
{ {
switch(blendFactorAlphaActive) switch(blendFactorAlphaActive)
{ {
...@@ -1899,7 +1899,7 @@ namespace sw ...@@ -1899,7 +1899,7 @@ namespace sw
} }
} }
void PixelRoutine::blendFactor(const Vector4f &blendFactor, const Vector4f &oC, const Vector4f &pixel, BlendFactor blendFactorActive) void PixelRoutine::blendFactor(Vector4f &blendFactor, const Vector4f &oC, const Vector4f &pixel, BlendFactor blendFactorActive)
{ {
switch(blendFactorActive) switch(blendFactorActive)
{ {
...@@ -1970,7 +1970,7 @@ namespace sw ...@@ -1970,7 +1970,7 @@ namespace sw
} }
} }
void PixelRoutine::blendFactorAlpha(const Vector4f &blendFactor, const Vector4f &oC, const Vector4f &pixel, BlendFactor blendFactorAlphaActive) void PixelRoutine::blendFactorAlpha(Vector4f &blendFactor, const Vector4f &oC, const Vector4f &pixel, BlendFactor blendFactorAlphaActive)
{ {
switch(blendFactorAlphaActive) switch(blendFactorAlphaActive)
{ {
......
...@@ -76,11 +76,11 @@ namespace sw ...@@ -76,11 +76,11 @@ namespace sw
Bool depthTest(Pointer<Byte> &zBuffer, int q, Int &x, Float4 &z, Int &sMask, Int &zMask, Int &cMask); Bool depthTest(Pointer<Byte> &zBuffer, int q, Int &x, Float4 &z, Int &sMask, Int &zMask, Int &cMask);
// Raster operations // Raster operations
void blendFactor(const Vector4s &blendFactor, const Vector4s &current, const Vector4s &pixel, BlendFactor blendFactorActive); void blendFactor(Vector4s &blendFactor, const Vector4s &current, const Vector4s &pixel, BlendFactor blendFactorActive);
void blendFactorAlpha(const Vector4s &blendFactor, const Vector4s &current, const Vector4s &pixel, BlendFactor blendFactorAlphaActive); void blendFactorAlpha(Vector4s &blendFactor, const Vector4s &current, const Vector4s &pixel, BlendFactor blendFactorAlphaActive);
void readPixel(int index, Pointer<Byte> &cBuffer, Int &x, Vector4s &pixel); void readPixel(int index, Pointer<Byte> &cBuffer, Int &x, Vector4s &pixel);
void blendFactor(const Vector4f &blendFactor, const Vector4f &oC, const Vector4f &pixel, BlendFactor blendFactorActive); void blendFactor(Vector4f &blendFactor, const Vector4f &oC, const Vector4f &pixel, BlendFactor blendFactorActive);
void blendFactorAlpha(const Vector4f &blendFactor, const Vector4f &oC, const Vector4f &pixel, BlendFactor blendFactorAlphaActive); void blendFactorAlpha(Vector4f &blendFactor, const Vector4f &oC, const Vector4f &pixel, BlendFactor blendFactorAlphaActive);
void writeStencil(Pointer<Byte> &sBuffer, int q, Int &x, Int &sMask, Int &zMask, Int &cMask); void writeStencil(Pointer<Byte> &sBuffer, int q, Int &x, Int &sMask, Int &zMask, Int &cMask);
void writeDepth(Pointer<Byte> &zBuffer, int q, Int &x, Float4 &z, Int &zMask); void writeDepth(Pointer<Byte> &zBuffer, int q, Int &x, Float4 &z, Int &zMask);
......
...@@ -555,25 +555,23 @@ namespace sw ...@@ -555,25 +555,23 @@ namespace sw
} }
} }
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 xMin = *Pointer<Int>(data + OFFSET(DrawData,scissorX0));
Int xMax = *Pointer<Int>(data + OFFSET(DrawData,scissorX1)); 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> leftEdge = primitive + q * sizeof(Primitive) + OFFSET(Primitive,outline->left);
Pointer<Byte> rightEdge = primitive + q * sizeof(Primitive) + OFFSET(Primitive,outline->right); Pointer<Byte> rightEdge = primitive + q * sizeof(Primitive) + OFFSET(Primitive,outline->right);
Pointer<Byte> edge = IfThenElse(swap, rightEdge, leftEdge); Pointer<Byte> edge = IfThenElse(swap, rightEdge, leftEdge);
Int X0 = X1; Int X1 = IfThenElse(swap, Xb, Xa);
Int Y0 = Y1; Int X2 = IfThenElse(swap, Xa, Xb);
X1 = IfThenElse(swap, X2, X1); Int Y1 = IfThenElse(swap, Yb, Ya);
X2 = IfThenElse(swap, X0, X2); Int Y2 = IfThenElse(swap, Ya, Yb);
Y1 = IfThenElse(swap, Y2, Y1);
Y2 = IfThenElse(swap, Y0, Y2);
Int y1 = Max((Y1 + 0x0000000F) >> 4, *Pointer<Int>(data + OFFSET(DrawData,scissorY0))); Int y1 = Max((Y1 + 0x0000000F) >> 4, *Pointer<Int>(data + OFFSET(DrawData,scissorY0)));
Int y2 = Min((Y2 + 0x0000000F) >> 4, *Pointer<Int>(data + OFFSET(DrawData,scissorY1))); Int y2 = Min((Y2 + 0x0000000F) >> 4, *Pointer<Int>(data + OFFSET(DrawData,scissorY1)));
......
...@@ -34,7 +34,7 @@ namespace sw ...@@ -34,7 +34,7 @@ namespace sw
private: private:
void setupGradient(Pointer<Byte> &primitive, Pointer<Byte> &triangle, Float4 &w012, Float4 (&m)[3], Pointer<Byte> &v0, Pointer<Byte> &v1, Pointer<Byte> &v2, int attribute, int planeEquation, bool flatShading, bool sprite, bool perspective, bool wrap, int component); void setupGradient(Pointer<Byte> &primitive, Pointer<Byte> &triangle, Float4 &w012, Float4 (&m)[3], Pointer<Byte> &v0, Pointer<Byte> &v1, Pointer<Byte> &v2, int attribute, int planeEquation, bool flatShading, bool sprite, bool perspective, bool wrap, int component);
void edge(Pointer<Byte> &primitive, Pointer<Byte> &data, const Int &X1, const Int &Y1, const Int &X2, const Int &Y2, Int &q); void edge(Pointer<Byte> &primitive, Pointer<Byte> &data, const Int &Xa, const Int &Ya, const Int &Xb, const Int &Yb, Int &q);
void conditionalRotate1(Bool condition, Pointer<Byte> &v0, Pointer<Byte> &v1, Pointer<Byte> &v2); void conditionalRotate1(Bool condition, Pointer<Byte> &v0, Pointer<Byte> &v1, Pointer<Byte> &v2);
void conditionalRotate2(Bool condition, Pointer<Byte> &v0, Pointer<Byte> &v1, Pointer<Byte> &v2); void conditionalRotate2(Bool condition, Pointer<Byte> &v0, Pointer<Byte> &v1, Pointer<Byte> &v2);
......
...@@ -29,10 +29,10 @@ namespace sw ...@@ -29,10 +29,10 @@ namespace sw
virtual ~VertexRoutinePrototype() {}; virtual ~VertexRoutinePrototype() {};
protected: protected:
const Pointer<Byte> vertex; Pointer<Byte> vertex;
const Pointer<Byte> batch; Pointer<Byte> batch;
const Pointer<Byte> task; Pointer<Byte> task;
const Pointer<Byte> data; Pointer<Byte> data;
}; };
class VertexRoutine : public VertexRoutinePrototype class VertexRoutine : public VertexRoutinePrototype
......
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